Révision 552
Ajouté par Ramazan CELIK il y a environ 3 ans
branch/CELIK/sp4a3/sp4a3_kalman.c | ||
---|---|---|
#include "sp4a3_kalman_extra.h"
|
||
|
||
|
||
void Add_Mat_Mat(int na,int ma,double A[na][ma],int nb,int mb,double B[nb][mb], double R[na][ma]){
|
||
|
||
void Add_Mat_Mat(int na, int ma, double A[na][ma], int nb, int mb, double B[nb][mb], double R[na][ma])
|
||
{
|
||
int i,j; /* indice i et j permettant de parcourir les matrices A et B */
|
||
for(i=0; i<na; i++)
|
||
{
|
||
for (j=0; j<ma; j++)
|
||
{
|
||
R[i][j] = A[i][j] + B[i][j]; /* l'addition entre la matrice A et B est stocke dans R */
|
||
}
|
||
}
|
||
}
|
||
|
||
void Inverse_Mat_22(int n,int m,double A[n][m],double B[n][m]){
|
||
|
||
void Inverse_Mat_22(int n, int m, double A[n][m], double B[n][m])
|
||
{
|
||
double det = 1/((A[0][0]*A[1][1])-(A[0][1]*A[1][0])); /* resultat du determinant */
|
||
B[0][0] = A[1][1]*det;
|
||
B[1][1] = A[0][0]*det;
|
||
B[0][1] = -A[0][1]*det;
|
||
B[1][0] = -A[1][0]*det;
|
||
|
||
printf("\n%.6f %.6f\n%.6f %.6f\n", B[0][0], B[0][1], B[1][0], B[1][1]); /* permet de verifier la fonction de la matrice inverse */
|
||
}
|
||
|
||
void Transpose_Mat(int n,int m,double A[n][m],double R[m][n]){
|
||
void Transpose_Mat(int n,int m,double A[n][m],double R[m][n])
|
||
{
|
||
int i,j;
|
||
for (i=0;i<n;i++)
|
||
for (j=0;j<m;j++)
|
||
R[j][i]=A[i][j];
|
||
R[j][i]=A[i][j]; /* les lignes deviennent des colonnes et les colonnes deviennent des lignes */
|
||
}
|
||
|
||
void Sub_Mat_Mat(int na,int ma,double A[na][ma],int nb,int mb,double B[nb][mb], double R[na][ma]){
|
||
void Sub_Mat_Mat(int na,int ma,double A[na][ma],int nb,int mb,double B[nb][mb], double R[na][ma])
|
||
{
|
||
|
||
}
|
||
|
||
void Mul_Mat_Mat(int na,int ma,double A[na][ma], int nb,int mb,double B[nb][mb], double R[na][mb]){
|
||
void Mul_Mat_Mat(int na,int ma,double A[na][ma], int nb,int mb,double B[nb][mb], double R[na][mb])
|
||
{
|
||
|
||
}
|
||
|
Formats disponibles : Unified diff
Implantation de la fonction Add et Inv