Mathc matrices/a74
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c00a.c */
void fun(void)
int i;
double **A [C4]; 
double **Log_EValue[C4];
double **Log [C4];
double **V = i_mR(RCA,RCA);
double **V_T = i_mR(RCA,RCA);
double **EValue = i_mR(RCA,RCA); 
double **T = i_mR(RCA,RCA);
 for(i = C0; i < C4; i++)
 clrscrn();
 if(i < C2) 
 A[i] = rEsymmetric_mR(i_mR(RCA,RCA),999,+1.E-3);
 else if(i == C2) 
 A[i] = mul_mR(A[C0],A[C1],i_mR(RCA,RCA));
 else if(i == C3) 
 A[i] = mul_mR(A[C1],A[C0],i_mR(RCA,RCA)); 
 if(i== C2) printf(" ERROR : A2 = A0 * A1 \n\n"
 " My work is not correct if the matrix\n"
 " is not symetric \n\n"); 
 if(i== C3) printf(" ERROR : A3 = A1 * A0 \n\n"
 " My work is not correct if the matrix\n"
 " is not symetric \n\n"); 
 printf(" Copy/Past into the octave window.\n\n");
 pAi_Octave_mR(A[i],"A",i, P4);
 printf(" logm (A%d)\n\n\n",i);
 stop(); 
 clrscrn();
 Log_EValue[i] = i_mR(RCA,RCA); 
 Log[i] = i_mR(RCA,RCA); 
 printf(" A[%d] :",i);
 p_mR(A[i], S9,P4, C6);
 eigs_V_uv_mR(A[i],V);
 transpose_mR(V,V_T);
/* EValue = V_T * A * V */ 
 mul_mR(V_T,A[i],T);
 mul_mR(T,V,EValue); 
 f_eigs_uv_mR(log,EValue, Log_EValue[i]);
 printf(" Log_EValue[A%d] :",i);
 p_mR( Log_EValue[i], S9,P4, C6);
/* Log[i] = V * Log_EValue[i] * V_T*/ 
 mul_mR(V,Log_EValue[i],T);
 mul_mR(T,V_T,Log[i]); 
 printf(" log[A%d]",i);
 p_mR(Log[i], S9,P4, C6);
 stop();
 clrscrn();
 printf(" Copy/Past into the octave window. \n\n"
 " logm (A0) + logm (A1) \n"
 " logm (A0*A1) \n" 
 " logm (A1*A0) \n\n");
 stop(); 
 clrscrn(); 
 printf(" logm (A0) + logm (A1)");
 p_mR( add_mR(Log[C0],Log[C1],T), S12,P4, C6); 
 printf(" logm (A0*A1)"); 
 p_mR( Log[C2], S12,P4, C6);
 printf(" logm (A1*A0)"); 
 p_mR( Log[C3], S12,P4, C6);
 for(i = C0; i < C3; i++)
 f_mR(A[i]);
 f_mR(Log_EValue[i]);
 f_mR(Log[i]);

f_mR(V);
 f_mR(V_T);
 f_mR(EValue); 
 f_mR(T); 
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun();
} while(stop_w());
 return 0;
/* ------------------------------------ */
 Log(A0) + Log(A1) != Log(A0 * A1)

Exemple de sortie écran :
 Copy/Past into the octave window.
 A0=[
+1.455516,-0.579784,-1.013202,+0.959212;
-0.579784,+1.526599,+0.388638,-0.786304;
-1.013202,+0.388638,+1.109385,-0.819279;
+0.959212,-0.786304,-0.819279,+0.824059]
 logm (A0)
 Press return to continue. 
 ------------------------------------ 
 A[0] :
+1.455516 -0.579784 -1.013202 +0.959212 
-0.579784 +1.526599 +0.388638 -0.786304 
-1.013202 +0.388638 +1.109385 -0.819279 
+0.959212 -0.786304 -0.819279 +0.824059 
 Log_EValue[A0] :
+1.261668 +0.000000 +0.000000 +0.000000 
+0.000000 +0.120153 +0.000000 +0.000000 
+0.000000 +0.000000 -1.376334 +0.000000 
+0.000000 +0.000000 +0.000000 -5.501275 
 log[A0]
-0.515538 +0.017638 -0.621409 +1.545901 
+0.017638 -0.079295 -0.318895 -1.590864 
-0.621409 -0.318895 -1.013247 -1.807474 
+1.545901 -1.590864 -1.807474 -3.887708 
 Press return to continue. 
 ------------------------------------ 
 Copy/Past into the octave window.
 A1=[
+1.295464,-1.345756,-0.130998,-1.156990;
-1.345756,+1.952888,+0.516858,+1.368264;
-0.130998,+0.516858,+1.914190,-0.647146;
-1.156990,+1.368264,-0.647146,+2.001337]
 logm (A1)
 Press return to continue. 
 ------------------------------------ 
 A[1] :
+1.295464 -1.345756 -0.130998 -1.156990 
-1.345756 +1.952888 +0.516858 +1.368264 
-0.130998 +0.516858 +1.914190 -0.647146 
-1.156990 +1.368264 -0.647146 +2.001337 
 Log_EValue[A1] :
+1.473865 +0.000000 +0.000000 +0.000000 
+0.000000 +0.846403 +0.000000 +0.000000 
+0.000000 +0.000000 -1.258573 +0.000000 
+0.000000 +0.000000 +0.000000 -1.701029 
 log[A1]
-0.655188 -1.043299 -0.085599 -0.688968 
-1.043299 -0.289976 +0.614267 +0.951494 
-0.085599 +0.614267 +0.381614 -0.705396 
-0.688968 +0.951494 -0.705396 -0.075783 
 Press return to continue. 
 ------------------------------------ 
 ERROR : A2 = A0 * A1 
 My work is not correct if the matrix
 is not symetric 
 Copy/Past into the octave window.
 A2=[
+1.688745,-2.302249,-3.050547,+0.098081;
-1.946684,+2.886524,+2.117766,+0.934430;
-1.033008,+1.574894,+2.987365,-0.653563;
+1.454694,-2.122350,-2.633605,-0.006257]
 logm (A2)
 Press return to continue. 
 ------------------------------------ 
 A[2] :
+1.688745 -2.302249 -3.050547 +0.098081 
-1.946684 +2.886524 +2.117766 +0.934430 
-1.033008 +1.574894 +2.987365 -0.653563 
+1.454694 -2.122350 -2.633605 -0.006257 
 Log_EValue[A2] :
+1.852941 +0.000000 +0.000000 +0.000000 
+0.000000 +0.049875 +0.000000 +0.000000 
+0.000000 +0.000000 -2.086795 +0.000000 
+0.000000 +0.000000 +0.000000 -5.951143 
 log[A2]
-0.883057 -1.158002 -0.757761 -0.000416 
-1.158002 -1.749314 +1.792392 +1.705457 
-0.757761 +1.792392 -0.808994 -2.412698 
-0.000416 +1.705457 -2.412698 -2.693757 
 Press return to continue. 
 ------------------------------------ 
 ERROR : A3 = A1 * A0 
 My work is not correct if the matrix
 is not symetric 
 Copy/Past into the octave window.
 A3=[
+1.688745,-1.946684,-1.033008,+1.454694;
-2.302249,+2.886524,+1.574894,-2.122350;
-3.050547,+2.117766,+2.987365,-2.633605;
+0.098081,+0.934430,-0.653563,-0.006257]
 logm (A3)
 Press return to continue. 
 ------------------------------------ 
 A[3] :
+1.688745 -1.946684 -1.033008 +1.454694 
-2.302249 +2.886524 +1.574894 -2.122350 
-3.050547 +2.117766 +2.987365 -2.633605 
+0.098081 +0.934430 -0.653563 -0.006257 
 Log_EValue[A3] :
+1.852941 +0.000000 +0.000000 +0.000000 
+0.000000 +0.049875 +0.000000 +0.000000 
+0.000000 +0.000000 -2.086795 +0.000000 
+0.000000 +0.000000 +0.000000 -5.951143 
 log[A3]
-1.387816 -0.420531 -0.854620 +1.600051 
-0.420531 +0.104174 -0.005559 -1.274053 
-0.854620 -0.005559 -0.219532 -1.524936 
+1.600051 -1.274053 -1.524936 -4.631948 
 Press return to continue. 
 ------------------------------------ 
 Copy/Past into the octave window. 
 logm (A0) + logm (A1) 
 logm (A0*A1) 
 logm (A1*A0) 
 Press return to continue. 
 ------------------------------------ 
 logm (A0) + logm (A1)
 -1.170726 -1.025661 -0.707007 +0.856933 
 -1.025661 -0.369272 +0.295373 -0.639370 
 -0.707007 +0.295373 -0.631633 -2.512870 
 +0.856933 -0.639370 -2.512870 -3.963492 
 logm (A0*A1)
 -0.883057 -1.158002 -0.757761 -0.000416 
 -1.158002 -1.749314 +1.792392 +1.705457 
 -0.757761 +1.792392 -0.808994 -2.412698 
 -0.000416 +1.705457 -2.412698 -2.693757 
 logm (A1*A0)
 -1.387816 -0.420531 -0.854620 +1.600051 
 -0.420531 +0.104174 -0.005559 -1.274053 
 -0.854620 -0.005559 -0.219532 -1.524936 
 +1.600051 -1.274053 -1.524936 -4.631948 
 Press return to continue
 Press X to stop