Projet

Général

Profil

« Précédent | Suivant » 

Révision 243

Ajouté par thcoulaud il y a presque 4 ans

Implémentation des fonctions réalisée

Voir les différences:

branch/coulaud/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 out[na][ma]){
void Add_Mat_Mat(int na,int ma,double A[na][ma],int nb,int mb,double B[nb][mb], double out[na][ma]){
int I,J=0;
for (I=0; I<na; I++){
for (J=0; J<ma; J++){
out[I][J] = A[I][J]+B[I][J];
}
}
}
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]){
float d;
d=1/((A[0][0]*A[1][1])-(A[0][1]*A[1][0]));
B[0][0]=d*A[1][1];
B[1][1]=d*A[0][0];
B[0][1]=-d*(A[0][1]);
B[1][0]=-d*(A[1][0]);
}
......
R[j][i]=A[i][j];
}
void Sub_Mat_Mat(int na,int ma,double A[na][ma],int nb,int mb,double b[nb][mb], double out[na][ma]){
void Sub_Mat_Mat(int na,int ma,double A[na][ma],int nb,int mb,double B[nb][mb], double out[na][ma]){
int I,J=0;
for (I=0; I<na; I++){
for (J=0; J<ma; J++){
out[I][J] = A[I][J]-B[I][J];
}
}
}
void Mul_Mat_Mat(int na,int ma,double A[na][ma], int nb,int mb,double B[nb][mb], double out[na][mb]){
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=0;
int j=0;
int k=0;
for(i = 0; i < na; i++)
{
for(j = 0; j < mb; j++)
{
out[i][j]=0;
for(k = 0; k < ma; k++)
{
out[i][j] += A[i][k] * B[k][j];
}
}
}
}

Formats disponibles : Unified diff