Exemple de sortie écran :
 A :
 +2 +0 
 +0 +3 
 U :
 +1 
 +1 
 V :
 +3 
 +2 
 W :
 +0 
 -1 
 UplsV :
 +4 
 +3 
 Press return to continue. 
 ------------------------------------ 
 <U+V,W> = <U,W>+<V,W> [Additivity axiom] 
 <u+v,w> = -9 
 <u,w>+<v,w> = -9 
 Press return to continue.

Mathc matrices/c20m
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00d.c */
void fun(void)
double a[R2*C2]={ 2,0,
 0,3};
double v[R2*C1]={ 3,
 2}; 
double **A = ca_A_mR(a,i_mR(R2,C2));
double **V = ca_A_mR(v,i_mR(R2,C1));
 clrscrn();
 printf(" A :");
 p_mR(A,S3,P0,C6);
 printf(" V :");
 p_mR(V,S3,P0,C6);
 printf(" ||u|| = sqrt(%.0f) \n\n", dot_Diag_R(A,V,V));
 f_mR(A);
 f_mR(V);
/* ------------------------------------ */
int main(void)
 fun();
 stop();
 return 0;
/* ------------------------------------ */

Exemple de sortie écran :
 A :
 +2 +0 
 +0 +3 
 V :
 +3 
 +2 
 ||u|| = sqrt(30) 
 Press return to continue.

Mathc matrices/c20n
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00g.c */
void fun(int r)
double **A = rpdiag_mR(i_mR(r,r),9.);
double **U = r_mR(i_mR(r,r),9.);
double **Orth = i_mR(r,r);
double **D = i_mR(r,r);
 clrscrn();
 printf(" A :");
 p_mR(A,S3,P0,C6);
 printf(" u :");
 p_mR(U,S3,P0,C6); 
 stop();
 clrscrn();
 orth_Diag_mR(A,U,Orth);
 printf(" Orth :");
 p_mR(Orth,S9,P3,C6);
 mul_Diag_mR(A,Orth,Orth,D);
 printf(" D : <Orth,Orth> ");
 p_mR(D,S9,P3,C6);
 f_mR(A);
 f_mR(U);
 f_mR(Orth);
 f_mR(D);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun(rp_I(R3)+R2);
} while(stop_w());
 return 0;
/* ------------------------------------ */
On orthogonalise la matrice u

Exemple de sortie écran :
 A :
 +8 +0 +0 
 +0 +1 +0 
 +0 +0 +4 
 u :
 +9 -2 +8 
 +3 -9 -7 
 -2 -9 -1 
 Press return to continue. 
 Orth :
 +9.000 -0.676 +0.557 
 +3.000 -8.559 -8.419 
 -2.000 -9.294 +1.857 
 D : <Orth,Orth> 
 +673.000 -0.000 +0.000 
 -0.000 +422.437 +0.000 
 +0.000 +0.000 +87.164 
 Press return to continue
 Press X to stop

Mathc matrices/c20o
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00h.c */
void fun(int r)
double **A = rpdiag_mR(i_mR(r,r),9.);
double **U = r_mR(i_mR(r,r),9.);
double **Orth = i_mR(r,r);
double **D = i_mR(r,r);
 clrscrn();
 printf(" A :");
 p_mR(A,S3,P0,C6);
 printf(" u :");
 p_mR(U,S3,P0,C6); 
 stop();
 clrscrn();
 orth_Diag_mR(A,U,Orth); 
 printf(" Orth :");
 p_mR(Orth,S6,P3,C6);
 Normalize_Diag_mR(A,Orth);
 printf(" N_Orth : Normalise");
 p_mR(Orth,S6,P3,C6);
 mul_Diag_mR(A,Orth,Orth,D);
 printf(" D : <N_Orth,N_Orth> ");
 p_mR(D,S6,P3,C6);
 f_mR(A);
 f_mR(U);
 f_mR(Orth);
 f_mR(D);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun(rp_I(R3)+R2);
} while(stop_w());
 return 0;
/* ------------------------------------ */
On orthogonalise la matrice u

Exemple de sortie écran :
 A :
 +3 +0 +0 +0 +0 
 +0 +5 +0 +0 +0 
 +0 +0 +6 +0 +0 
 +0 +0 +0 +3 +0 
 +0 +0 +0 +0 +6 
 u :
 +4 +4 -8 +2 -2 
 -1 -6 +3 +1 -7 
 -3 -8 +7 -5 +3 
 +6 +7 -3 -6 +6 
 -4 -1 -7 +2 +2 
 Press return to continue. 
 ------------------------------------ 
 Orth :
+4.000 -0.785 -7.388 +0.544 +1.328 
-1.000 -4.804 -3.338 +2.035 -1.063 
-3.000 -4.412 +0.357 -3.238 +0.582 
+6.000 -0.177 -0.846 -5.288 -1.044 
-4.000 +3.785 -3.901 -1.689 -0.334 
 N_Orth : Normalise
+0.227 -0.044 -0.417 +0.040 +0.323 
-0.057 -0.269 -0.188 +0.149 -0.259 
-0.170 -0.247 +0.020 -0.238 +0.141 
+0.340 -0.010 -0.048 -0.388 -0.254 
-0.227 +0.212 -0.220 -0.124 -0.081 
 D : <N_Orth,N_Orth> 
+1.000 -0.000 -0.000 +0.000 +0.000 
-0.000 +1.000 -0.000 -0.000 -0.000 
-0.000 -0.000 +1.000 +0.000 +0.000 
+0.000 -0.000 +0.000 +1.000 +0.000 
+0.000 -0.000 +0.000 +0.000 +1.000 
 Press return to continue
 Press X to stop

Mathc matrices/c20p
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00i.c */
void fun(int r)
double **A = rpdiag_mR(i_mR(r,r),9.);
double **U = r_mR(i_mR(r,r),9.);
double **Q = i_mR(r,r);
double **R = i_mR(r,r);
double **QR = i_mR(r,r);
 clrscrn();
 printf(" A :");
 p_mR(A,S3,P3,C6);
 printf(" U :");
 p_mR(U,S3,P3,C6);
 stop();
 clrscrn(); 
 QR_Diag_mR(A,U,Q,R);
 printf(" Q :");
 p_mR(Q,S3,P5,C6);
 printf(" R :");
 p_mR(R,S10,P5,C6);
 stop();
 clrscrn();
 printf(" U :");
 p_mR(U,S3,P3,C6);
 printf(" U = Q * R :"); 
 mul_mR(Q,R, QR);
 p_mR(QR,S3,P3,C6); 
 f_mR(A);
 f_mR(U);
 f_mR(Q);
 f_mR(R);
 f_mR(QR);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun(rp_I(R3)+R2);
} while(stop_w());
 return 0;
/* ------------------------------------ */
On calcul la qr décomposition.

Exemple de sortie écran :
 A :
+4.000 +0.000 +0.000 +0.000 +0.000 
+0.000 +5.000 +0.000 +0.000 +0.000 
+0.000 +0.000 +9.000 +0.000 +0.000 
+0.000 +0.000 +0.000 +6.000 +0.000 
+0.000 +0.000 +0.000 +0.000 +7.000 
 U :
+3.000 +8.000 +3.000 +9.000 +6.000 
+6.000 +2.000 -2.000 +6.000 -6.000 
-5.000 +1.000 +6.000 -9.000 -6.000 
+7.000 +7.000 +4.000 +6.000 -1.000 
+4.000 -2.000 -7.000 +8.000 +5.000 
 Press return to continue. 
 Q :
+0.10308 +0.31428 -0.37084 -0.01879 -0.05224 
+0.20616 -0.02194 +0.08495 -0.32395 -0.21179 
-0.17180 +0.14219 +0.06282 -0.19425 +0.14035 
+0.24052 +0.19123 +0.20343 +0.09826 +0.14563 
+0.13744 -0.16951 -0.13628 -0.10443 +0.25643 
 R :
 +29.10326 +11.99178 -11.06405 +40.16732 +8.93371 
 +0.00000 +21.52202 +24.56451 -3.46983 -6.55752 
 -0.00000 -0.00000 +9.65256 -16.19801 -20.83125 
 -0.00000 -0.00000 +0.00000 +3.02846 +15.51242 
 +0.00000 +0.00000 -0.00000 +0.00000 +5.62242 
 Press return to continue. 
 U :
+3.000 +8.000 +3.000 +9.000 +6.000 
+6.000 +2.000 -2.000 +6.000 -6.000 
-5.000 +1.000 +6.000 -9.000 -6.000 
+7.000 +7.000 +4.000 +6.000 -1.000 
+4.000 -2.000 -7.000 +8.000 +5.000 
 U = Q * R :
+3.000 +8.000 +3.000 +9.000 +6.000 
+6.000 +2.000 -2.000 +6.000 -6.000 
-5.000 +1.000 +6.000 -9.000 -6.000 
+7.000 +7.000 +4.000 +6.000 -1.000 
+4.000 -2.000 -7.000 +8.000 +5.000 
 Press return to continue
 Press X to stop

Mathc matrices/c20q
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00k.c */
void fun(int r,int rn)
double **A = rpdiag_mR(i_mR(r+rn,r+rn),9.);
double **U = r_mR(i_mR(r+rn,r),9.);
double **Q = i_mR(r+rn,r);
double **R = i_mR(r,r);
double **QR = i_mR(r+rn,r);
 clrscrn();
 printf(" A :");
 p_mR(A,S3,P3,C6);
 printf(" U :");
 p_mR(U,S3,P3,C6);
 stop();
 clrscrn(); 
 QR_Diag_mR(A,U,Q,R);
 printf(" Q :");
 p_mR(Q,S3,P5,C6);
 printf(" R :");
 p_mR(R,S10,P5,C6);
 stop();
 clrscrn(); 
 printf(" U :");
 p_mR(U,S3,P3,C6); 
 printf(" U = Q * R :"); 
 mul_mR(Q,R, QR);
 p_mR(QR,S3,P3,C6); 
 f_mR(A);
 f_mR(U);
 f_mR(Q);
 f_mR(R);
 f_mR(QR);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun(rp_I(R2)+R2,rp_I(R2));
} while(stop_w());
 return 0;
/* ------------------------------------ */
On calcul la qr décomposition.