Index: branch/best/sp4a3/sp4a3_kalman.c
===================================================================
--- branch/best/sp4a3/sp4a3_kalman.c	(revision 295)
+++ branch/best/sp4a3/sp4a3_kalman.c	(revision 296)
@@ -172,18 +172,6 @@
 						 {0, 0, 0, 1}};
 	double FT[4][4];
 	Transpose_Mat(4,4,F,FT);
-	double tampon22[2][2] = {{0, 0},
-                             {0, 0}};
-    double tampon22bis[2][2] = {{0, 0},
-                                {0, 0}};
-    double tampon22bisbis[2][2] = {{0, 0},
-                                   {0, 0}};
-    double tampon24[2][4] = {{0, 0, 0, 0},
-                             {0, 0, 0, 0}};
-    double tampon42[4][2] = {{0, 0},
-                             {0, 0},
-                             {0, 0},
-                             {0, 0}};
     double tampon44[4][4] = {{0, 0, 0, 0},
                              {0, 0, 0, 0},
                              {0, 0, 0, 0},
@@ -192,28 +180,6 @@
                                 {0, 0, 0, 0},
                                 {0, 0, 0, 0},
                                 {0, 0, 0, 0}};
-    double tampon44bisbis[4][4] = {{0, 0, 0, 0},
-                                {0, 0, 0, 0},
-                                {0, 0, 0, 0},
-                                {0, 0, 0, 0}};
-    double tampon44bisbisbis[4][4] = {{0, 0, 0, 0},
-                                {0, 0, 0, 0},
-                                {0, 0, 0, 0},
-                                {0, 0, 0, 0}};
-    double tampon44bisbisbisbis[4][4] = {{0, 0, 0, 0},
-                                {0, 0, 0, 0},
-                                {0, 0, 0, 0},
-                                {0, 0, 0, 0}};
-    double tampon21[2][1] = {{0},
-                             {0}};
-    double tampon41[4][1] = {{0},
-                             {0},
-                             {0},
-                             {0}};
-    double tampon41bis[4][1] = {{0},
-                             {0},
-                             {0},
-                             {0}};
     double obs[2][1];
     double Delta[2][1];
 
@@ -237,8 +203,9 @@
 			///Ajouter votre code ci-dessous///
 			// Kalman
 			// X = F*X
-            Mul_Mat_Mat(4,4,F,4,1,X,tampon41);//tampon41 vaut X(k+1/k)
-			Plot_Mat(tampon41," X(k+1|k) = ");
+            Mul_Mat_Mat(4,4,F,4,1,X,tampon44);//tampon41 vaut X(k+1/k)
+            Cop_Mat(4,1,tampon44,X);
+			Plot_Mat(X," X(k+1|k) = ");
 			//P = F*P*F'+Q;
 			Mul_Mat_Mat(4,4,F,4,4,P,tampon44);//P=F*P
             Mul_Mat_Mat(4,4,tampon44,4,4,FT,tampon44bis);//*F'
@@ -245,29 +212,30 @@
             Add_Mat_Mat(4,4,tampon44bis,4,4,Q,P);//+Q
 			Plot_Mat(P,"P(k+1|k) = F.P(k|k).FT + Q = ");
 			// K = P*H' / ( H*P*H' + R);
-            Mul_Mat_Mat(2,4,H,4,4,P,tampon24);//H*P
-            Mul_Mat_Mat(2,4,tampon24,4,2,HT,tampon22);//*H'
-            Add_Mat_Mat(2,2,tampon22,2,2,R,tampon22bis);//+R
-            Inverse_Mat_22(2,2,tampon22bis,tampon22bisbis);//Inverse
-            Mul_Mat_Mat(4,2,HT,2,2,tampon22bisbis,tampon42);//H'*
-            Mul_Mat_Mat(4,4,P,4,2,tampon42,K);//P*
+            Mul_Mat_Mat(2,4,H,4,4,P,tampon44);//H*P
+            Mul_Mat_Mat(2,4,tampon44,4,2,HT,K);//*H'
+            Add_Mat_Mat(2,2,K,2,2,R,tampon44);//+R
+            Inverse_Mat_22(2,2,tampon44,K);//Inverse
+            Mul_Mat_Mat(4,2,HT,2,2,K,tampon44);//H'*
+            Mul_Mat_Mat(4,4,P,4,2,tampon44,K);//P*
             Plot_Mat(K,"K = ");
 			//X = X + K*([xb(i);yb(i)]-H*X);
 			obs[0][0] = x;
 			obs[1][0] = y;
 			Plot_Mat(obs," Obs = ");
-			Mul_Mat_Mat(2,4,H,4,1,tampon41,tampon21);
-			Sub_Mat_Mat(2,1,obs,2,1,tampon21,Delta);
+			Mul_Mat_Mat(2,4,H,4,1,X,tampon44);
+			Sub_Mat_Mat(2,1,obs,2,1,tampon44,Delta);
 			Plot_Mat(Delta,"DELTA = Obs - H.X(k+1|k)");
 			// X = X + K.Delta
-            Mul_Mat_Mat(4,2,K,2,1,Delta,tampon41bis);
-            Add_Mat_Mat(4,1,tampon41,4,1,tampon41bis,X);
+            Mul_Mat_Mat(4,2,K,2,1,Delta,tampon44);
+            Add_Mat_Mat(4,1,X,4,1,tampon44,tampon44bis);
+            Cop_Mat(4,1,tampon44bis,X);
             Plot_Mat(X," X(k+1|k+1) = X(k+1|k) + K.Delta = ");
 			// P = P - K*H*P;
-			Mul_Mat_Mat(4,2,K,2,4,H,tampon44bisbis);
-			Mul_Mat_Mat(4,4,tampon44bisbis,4,4,P,tampon44bisbisbis);
-            Sub_Mat_Mat(4,4,P,4,4,tampon44bisbisbis,tampon44bisbisbisbis);
-            Cop_Mat(4,4,tampon44bisbisbisbis,P);
+			Mul_Mat_Mat(4,2,K,2,4,H,tampon44);
+			Mul_Mat_Mat(4,4,tampon44,4,4,P,tampon44bis);
+            Sub_Mat_Mat(4,4,P,4,4,tampon44bis,tampon44);
+            Cop_Mat(4,4,tampon44,P);
             Plot_Mat(P," P(k+1|k+1) = P(k+1|k) - K.H.P(k+1|k) = ");
 
 			/// La matrice X doit contenir la position filtrée ///
