Mathc matrices/a69
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00b.c */
void fun(void)
double b[RB*CB]={
-3.00,+3.00,
+6.00,+8.00,
+8.00,-9.00,
-1.00,-4.00 
double **B = ca_A_mR(b, i_mR(RB,CB));
double **B_T = transpose_mR(B,i_mR(CB,RB));
double **S = i_mR(CB,C1);
double **U = i_mR(RB,CB);
double **V = i_mR(CB,CB);
 clrscrn(); 
 printf(" Copy/Past into the octave windows \n\n\n");
 p_Octave_mR(B,"B",P2);
 printf(" [U, S, V] =svd (B,10)\n\n\n");
 stop();
 clrscrn(); 
 svd_U_Rn_uv_mR(B_T,U); 
 svd_V_Rn_uv_mR(B_T,V); 
 svd_value_uv_mR(B,S);
 printf(" U :");
 p_mR(U,S5,P5,C10); 
 printf(" S :");
 p_mR(S,S5,P5,C10);
 printf(" V:");
 p_mR(V,S5,P5,C10);
 stop(); 
 f_mR(B_T);
 f_mR(B);
 f_mR(S); 
 f_mR(U);
 f_mR(V); 
/* ------------------------------------ */
int main(void)
 fun();
 return 0;
/* ------------------------------------ */
Cet version fonctionne quand il y a plus de lignes que de colonnes.. 
 svd_U_Rn_uv_mR(B_T,U); 
 svd_V_Rn_uv_mR(B_T,V);

Exemple de sortie écran :
 Copy/Past into the octave windows 
 B=[
-3.00,+3.00;
+6.00,+8.00;
+8.00,-9.00;
-1.00,-4.00]
 [U, S, V] =svd (B,10)
 Press return to continue. 
 ------------------------------------ 
 U :
-0.28974 -0.16712 
-0.38334 +0.86361 
+0.84140 +0.40785 
+0.24728 -0.24477 
 S :
+13.48055 
+9.91336 
 V:
-0.37484 +0.92709 
+0.92709 +0.37484 
 Press return to continue.

Mathc complexes/a87
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,4, 1,3,
 7,2, 5,1};
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 avec un nombre de lignes supérieur ou égal aux nombres de colonnes

Exemple de sortie écran :
 A :
 +1.00 +2.00i +3.00 +4.00i 
 +5.00 +4.00i +1.00 +3.00i 
 +7.00 +2.00i +5.00 +1.00i 
 U :
 +0.2940 +0.2567i -0.6119 +0.4960i 
 +0.4702 +0.3112i +0.1304 -0.5579i 
 +0.7278 +0.0000i +0.2265 -0.0000i 
 V :
 +0.7964 +0.0735i -0.5977 -0.0552i 
 +0.6002 -0.0000i +0.7998 +0.0000i 
 +0.0000 +0.0000i +0.0000 +0.0000i 
 X_Value = U_T * A * V :
 +11.5820 +3.7205i +0.0000 -0.0000i 
 -0.0000 +0.0000i -0.3277 -3.4507i 
 Press return to continue.

Mathc complexes/a88
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,4, 1,3,
 7,2, 5,1};
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 avec un nombre de lignes supérieur ou égal aux nombres de colonnes

Exemple de sortie écran :
 A :
 +1.0 +2.0i +3.0 +4.0i 
 +5.0 +4.0i +1.0 +3.0i 
 +7.0 +2.0i +5.0 +1.0i 
 U :
 +0.2940 +0.2567i -0.6119 +0.4960i 
 +0.4702 +0.3112i +0.1304 -0.5579i 
 +0.7278 +0.0000i +0.2265 -0.0000i 
 V :
 +0.7964 +0.0735i -0.5977 -0.0552i 
 +0.6002 -0.0000i +0.7998 +0.0000i 
 +0.0000 +0.0000i +0.0000 +0.0000i 
 X_Value = U_T * A * V :
 +11.5820 +3.7205i +0.0000 -0.0000i 
 -0.0000 +0.0000i -0.3277 -3.4507i 
 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 +0.0 +0.0i 
 +5.0 +4.0i +1.0 +3.0i +0.0 +0.0i 
 +7.0 +2.0i +5.0 +1.0i +0.0 +0.0i 
 A :
 +1.0 +2.0i +3.0 +4.0i 
 +5.0 +4.0i +1.0 +3.0i 
 +7.0 +2.0i +5.0 +1.0i 
 Press return to continue.

Mathc complexes/a89
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00c.c */
/* ------------------------------------ */
void fun(void)
int r = RA;
int c = CA; 
double a[RA*(CA*C2)] ={ 1,2, 3,4, 
 5,4, 1,3,
 7,2, 5,1};
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 **invU_TA2V = i_mZ(c,c); // c,r r,c :c,c invX_Value
double **VinvU_TA2V = i_mZ(r,c);
double **VinvU_TA2VU_T = i_mZ(r,r);
double **VinvU_TA2VU_TA2 = i_mZ(r,c); // r,c | r,r
 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(); 
 X_inv_mZ(U_TA2V, invU_TA2V);
 printf(" invX_Value invU_TA2V:");
 pE_mZ(invU_TA2V, S12,P4, S8,P4, C3);
/* invA = V * invX_Value * U_T */ 
 mul_mZ(V,invU_TA2V,VinvU_TA2V);
 mul_mZ(VinvU_TA2V,U_T,VinvU_TA2VU_T); 
 printf(" PseudoinverseA = V * invX_Value * U_T:");
 pE_mZ(VinvU_TA2VU_T, S12,P4, S8,P4, C3); 
 mul_mZ(VinvU_TA2VU_T,A,VinvU_TA2VU_TA2); 
 printf(" Ide = PseudoinverseA * A ");
 p_mZ(VinvU_TA2VU_TA2, S9,P4, S8,P4, 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(invU_TA2V);
 f_mZ(VinvU_TA2V);
 f_mZ(VinvU_TA2VU_T);
 f_mZ(VinvU_TA2VU_TA2); 
/* ------------------------------------ */
int main(void)
 fun();
 return 0;
/* ------------------------------------ */
 Diagonaliser une matrice avec un nombre de lignes supérieur ou égal aux nombres de colonnes