Mathc complexes/a50
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
double f(
double x)
 return(sin(x)*sin(x));
char feq[] = "sin(x)*sin(x)";
double g(
double x)
 return(cos(x)*cos(x));
char geq[] = "cos(x)*cos(x)";
/* ------------------------------------ */
void fun(void)
double **A = rcsymmetric_mZ(i_mZ(RCA,RCA),99);
double **V = i_mZ(RCA,RCA);
double **cV_T = i_mZ(RCA,RCA);
double **T = i_mZ(RCA,RCA);
double **EigsValue = i_mZ(RCA,RCA);
double **sin_EValue = i_mZ(RCA,RCA);
double **cos_EValue = i_mZ(RCA,RCA);
double **sin_A = i_mZ(RCA,RCA);
double **cos_A = i_mZ(RCA,RCA);
 clrscrn();
 printf(" A :");
 p_mZ(A, S7,P0, S7,P0, C6);
 stop();
 clrscrn();
 eigs_V_uv_mZ(A,V,FACTOR_E);
 ctranspose_mZ(V,cV_T);
/* EigsValue = cV_T * A * V */ 
 mul_mZ(cV_T,A,T);
 mul_mZ(T,V,EigsValue); 
 f_eigs_uv_mZ(f,EigsValue,sin_EValue); 
 f_eigs_uv_mZ(g,EigsValue,cos_EValue); 
/* sin**2 = V * sin_EValue * cV_T*/ 
 mul_mZ(V,sin_EValue,T);
 mul_mZ(T,cV_T,sin_A); 
 printf(" sin(A)**2");
 p_mZ(sin_A, S7,P3, S7,P3, C6);
/* cos**2 = V * cos_EValue * cV_T*/ 
 mul_mZ(V,cos_EValue,T);
 mul_mZ(T,cV_T,cos_A);
 printf(" cos(A)**2");
 p_mZ(cos_A, S7,P3, S7,P3, C6); 
 add_mZ(sin_A,cos_A,A);
 printf(" sin(A)**2 + cos(A)**2 = 1");
 p_mZ(A, S7,P3, S7,P3, C6);
 f_mZ(A);
 f_mZ(V);
 f_mZ(cV_T);
 f_mZ(T);
 f_mZ(EigsValue);
 f_mZ(sin_EValue);
 f_mZ(cos_EValue);
 f_mZ(sin_A);
 f_mZ(cos_A);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun();
} while(stop_w());
 return 0;
/* ------------------------------------ */
Avec les matrices réelles nous avons calculer les vecteurs et valeurs propres des matrices symétriques. Avec les matrices complexes nous allons calculer les vecteurs et valeurs propres des matrices symétriques conjuguées.
Contrôle du facteur : 
Nous allons étudier une des propriétés des valeurs propres et des vecteurs propres :
 sin(A)**2 + cos(A)**2 = 1
 Exemple de sortie écran :
 A :
 +40842 +0i +14767 +5544i +4065 -14715i +30802 +17838i +4683 -4268i 
 +14767 -5544i +27510 +0i +1040 -11560i +9180 +3020i +10357 +11533i 
 +4065 +14715i +1040 +11560i +49349 +0i -1839 +12863i +17159 -6826i 
 +30802 -17838i +9180 -3020i -1839 -12863i +39734 +0i -3698 -6953i 
 +4683 +4268i +10357 -11533i +17159 +6826i -3698 +6953i +30380 +0i 
 Press return to continue. 
 ------------------------------------
 sin(A)**2
 +0.271 -0.000i -0.202 +0.038i -0.087 +0.128i -0.084 -0.073i +0.080 -0.110i 
 -0.202 -0.038i +0.465 -0.000i -0.010 -0.247i -0.239 +0.052i -0.019 +0.061i 
 -0.087 -0.128i -0.010 +0.247i +0.399 -0.000i +0.135 -0.194i -0.245 +0.113i 
 -0.084 +0.073i -0.239 -0.052i +0.135 +0.194i +0.396 -0.000i -0.130 +0.008i 
 +0.080 +0.110i -0.019 -0.061i -0.245 -0.113i -0.130 -0.008i +0.256 +0.000i 
 cos(A)**2
 +0.729 +0.000i +0.202 -0.038i +0.087 -0.128i +0.084 +0.073i -0.080 +0.110i 
 +0.202 +0.038i +0.535 +0.000i +0.010 +0.247i +0.239 -0.052i +0.019 -0.061i 
 +0.087 +0.128i +0.010 -0.247i +0.601 -0.000i -0.135 +0.194i +0.245 -0.113i 
 +0.084 -0.073i +0.239 +0.052i -0.135 -0.194i +0.604 -0.000i +0.130 -0.008i 
 -0.080 -0.110i +0.019 +0.061i +0.245 +0.113i +0.130 +0.008i +0.744 -0.000i 
 sin(A)**2 + cos(A)**2 = 1
 +1.000 -0.000i -0.000 +0.000i +0.000 -0.000i -0.000 -0.000i -0.000 -0.000i 
 -0.000 -0.000i +1.000 +0.000i +0.000 +0.000i -0.000 -0.000i +0.000 +0.000i 
 +0.000 +0.000i +0.000 -0.000i +1.000 -0.000i -0.000 +0.000i -0.000 +0.000i 
 -0.000 +0.000i +0.000 +0.000i -0.000 -0.000i +1.000 -0.000i -0.000 -0.000i 
 -0.000 +0.000i +0.000 -0.000i -0.000 -0.000i -0.000 +0.000i +1.000 +0.000i 
 Press return to continue
 Press X to stop

Mathc complexes/51
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00b.c */
/* ------------------------------------ */
void fun(void)
int r = RA;
int c = CA; 
double a[RA*(CA*C2)] ={ 1,2, 3,4, 5,3, 
 5,4, 1,3, 9,1,
 7,2, 5,1, 8,3,};
double **A = ca_A_mZ(a, i_mZ(r,c)); 
double **A_T = ctranspose_mZ(A,i_mZ(c,r));
double **V = i_mZ(r,c);
double **V_T = i_mZ(c,r);
double **U = i_mZ(r,c);
double **U_T = i_mZ(c,r); // :c,r 
double **U_TA = i_mZ(c,c); // c,r r,c :c,c
double **U_TA2 = i_mZ(c,r); // c,r :c,r 
double **U_TA2V = i_mZ(c,c); // c,r r,c :c,c X_Value
double **A2V = i_mZ(r,c); 
double **A2 = i_mZ(r,r); // A = U * X_Value * V_T 
 clrscrn();
 printf(" A :");
 p_mZ(A, S6,P1, S6,P1, C3);
 X_U_mZ(A_T,U,FACTOR_E);
 printf(" U :");
 p_mZ(U, S9,P4, S8,P4, C3);
 X_V_mZ(A_T,V,FACTOR_E);
 printf(" V :");
 p_mZ(V, S9,P4, S8,P4, C3);
 ctranspose_mZ(U,U_T);
 ctranspose_mZ(V,V_T); 
/* X_Value = U_T * A * V */
 mul_mZ( U_T, A, U_TA); // U_TA : c,c
 c_mZ( U_TA, U_TA2); // U_TA2 : c,r 
 mul_mZ( U_TA2, V, U_TA2V); // V : r,c
 printf(" X_Value = U_T * A * V :");
 p_mZ(U_TA2V, S9,P4, S8,P4, C3);
 stop();
 clrscrn();
/* A = U * X_Value * V_T */ 
 mul_mZ( U, U_TA2V, A2V); // U,U_T = 1;
 mul_mZ(A2V, V_T, A2); // V,V_T = 1;
 printf(" A2 = U * X_Value * V_T : \t\t U * (U_T*A*V) * V_T ");
 p_mZ(A2, S6,P1, S6,P1, C3); 
 printf(" A :");
 p_mZ(A, S6,P1, S6,P1, C3);
 stop();
 f_mZ(A); 
 f_mZ(A_T); 
 f_mZ(V); 
 f_mZ(V_T); 
 f_mZ(U); 
 f_mZ(U_T); 
 f_mZ(U_TA); 
 f_mZ(U_TA2); 
 f_mZ(U_TA2V); 
 f_mZ(A2V); 
 f_mZ(A2);
/* ------------------------------------ */
int main(void)
 fun();
 return 0;
/* ------------------------------------ */
 Diagonaliser une matrice carrée

Exemple de sortie écran :
 A :
 +1.0 +2.0i +3.0 +4.0i +5.0 +3.0i 
 +5.0 +4.0i +1.0 +3.0i +9.0 +1.0i 
 +7.0 +2.0i +5.0 +1.0i +8.0 +3.0i 
 U :
 +0.3772 +0.1725i -0.0706 +0.3672i -0.4502 -0.6968i 
 +0.6136 +0.0689i -0.6524 -0.3188i -0.0717 +0.2937i 
 +0.6683 +0.0000i +0.5770 +0.0000i +0.4695 +0.0000i 
 V :
 +0.5169 -0.1394i -0.0987 +0.0009i -0.8017 +0.2468i 
 +0.3600 -0.1324i -0.7923 +0.3282i +0.3050 -0.1562i 
 +0.7525 +0.0000i +0.5047 +0.0000i +0.4230 -0.0000i 
 X_Value = U_T * A * V :
 +17.7296 +3.0133i +0.0000 +0.0000i -0.0000 -0.0000i 
 +0.0000 -0.0000i -1.6373 +3.7646i +0.0000 +0.0000i 
 -0.0000 +0.0000i +0.0000 -0.0000i -2.2158 +1.9545i 
 Press return to continue. 
 ----------------------------------
 A2 = U * X_Value * V_T : U * (U_T*A*V) * V_T 
 +1.0 +2.0i +3.0 +4.0i +5.0 +3.0i 
 +5.0 +4.0i +1.0 +3.0i +9.0 +1.0i 
 +7.0 +2.0i +5.0 +1.0i +8.0 +3.0i 
 A :
 +1.0 +2.0i +3.0 +4.0i +5.0 +3.0i 
 +5.0 +4.0i +1.0 +3.0i +9.0 +1.0i 
 +7.0 +2.0i +5.0 +1.0i +8.0 +3.0i 
 Press return to continue.

Mathc complexes/a52
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
void fun(void)
int r = RA;
int c = CA; 
double a[RA*(CA*C2)] ={ 1,2, 3,4, 5,3, 
 5,4, 1,3, 9,1,
 7,2, 5,1, 8,3,};
double **A = ca_A_mZ(a, i_mZ(r,c)); 
double **A_T = ctranspose_mZ(A,i_mZ(c,r));
double **V = i_mZ(r,c);
double **U = i_mZ(r,c);
double **U_T = i_mZ(c,r); // :c,r 
double **U_TA = i_mZ(c,c); // c,r r,c :c,c
double **U_TA2 = i_mZ(c,r); // c,r :c,r 
double **U_TA2V = i_mZ(c,c); // c,r r,c :c,c X_Value
 clrscrn();
 printf(" A :");
 p_mZ(A, S6,P2, S6,P2, C3);
 X_U_mZ(A_T,U,FACTOR_E);
 printf(" U :");
 p_mZ(U, S9,P4, S8,P4, C3);
 X_V_mZ(A_T,V,FACTOR_E);
 printf(" V :");
 p_mZ(V, S9,P4, S8,P4, C3); 
 ctranspose_mZ(U,U_T);
/* X_Value = U_T * A * V */
 mul_mZ( U_T, A, U_TA); // U_TA : c,c
 c_mZ( U_TA, U_TA2); // U_TA2 : c,r 
 mul_mZ(U_TA2, V, U_TA2V); // V : r,c
 printf(" X_Value = U_T * A * V :");
 p_mZ(U_TA2V, S9,P4, S8,P4, C3);
 stop();
 f_mZ(A); 
 f_mZ(A_T);
 f_mZ(V); 
 f_mZ(U);
 f_mZ(U_T); 
 f_mZ(U_TA);
 f_mZ(U_TA2); 
 f_mZ(U_TA2V); 
/* ------------------------------------ */
int main(void)
 fun();
 return 0;
/* ------------------------------------ */
 Diagonaliser une matrice carrée