Révision 242
Ajouté par magraffin il y a presque 4 ans
sp4a3_kalman.c | ||
---|---|---|
|
||
#include "sp4a3_kalman_extra.h"
|
||
|
||
#define assert(cond) if(!cond) exit(-1)
|
||
//#define assert(cond) if(!cond) exit(-1)
|
||
|
||
|
||
void Add_Mat_Mat(int na,int ma,double A[na][ma],int nb,int mb,double B[nb][mb], double out[na][ma]){
|
||
... | ... | |
}
|
||
|
||
void Inverse_Mat_22(int n,int m,double A[n][m],double B[n][m]){
|
||
B[0][0]=A[1][1];
|
||
B[0][1]=-A[0][1];
|
||
B[1][0]=-A[1][0];
|
||
B[0][1]=A[1][0];
|
||
float fac;
|
||
fac=1/((A[0][0]*A[1][1])-(A[0][1]*A[1][0]));
|
||
B[0][0]=fac*A[1][1];
|
||
B[0][1]=fac*(-1*A[0][1]);
|
||
B[1][0]=fac*(-1*A[1][0]);
|
||
B[1][1]=fac*A[0][0];
|
||
}
|
||
|
||
void Transpose_Mat(int n,int m,double A[n][m],double R[m][n]){
|
||
... | ... | |
}
|
||
|
||
void Mul_Mat_Mat(int na,int ma,double A[na][ma], int nb,int mb,double B[nb][mb], double out[na][mb]){
|
||
|
||
int i,j,k,somme;
|
||
for (i=0;i<na;i++){
|
||
for (j=0;j<mb;j++){
|
||
somme=0;
|
||
for (k=0;k<ma;k++){
|
||
somme+=A[i][k]*B[k][i];
|
||
}
|
||
out[i][j]=somme;
|
||
}
|
||
}
|
||
}
|
||
|
||
|
Formats disponibles : Unified diff
kalman : implantation de la fonction multiplier et changement de la fonction inverse