Mathc matrices/c12an8
Application
La QR décomposition :
Comparons la résolution d'un système entre la QR décomposition et GaussJordan :
Méthode des moindres carrés :
Ajustement d'une courbe linéaire aux données.
Ajustement d'une courbe quadratique aux données.
Ajustement d'une courbe cubique aux données.
Ajustement d'une courbe quartique aux données.
L'équation d'un conique :
L'équation d'un cercle :

Mathc matrices/c11cn
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c00a.c */
/* ------------------------------------ */
void fun(void)
double **A = rsymmetric_mR(i_mR(RCA,RCA),999.);
double **a = i_mR(RCA,RCA);
double **EigsVector = i_mR(RCA,RCA);
double **T_EigsVector = i_mR(RCA,RCA);
double **EigsValue = i_mR(RCA,RCA);
double **T1 = i_mR(RCA,RCA);
 clrscrn();
 printf(" A :");
 p_mR(A,S10,P2,C6); 
 eigs_V_uv_mR(A,EigsVector); 
 transpose_mR(EigsVector,T_EigsVector); 
/* EigsValue = T_EigsVector * A * EigsVector */ 
 mul_mR(T_EigsVector,A,T1);
 mul_mR(T1,EigsVector,EigsValue); 
 mul_mR(EigsVector,EigsValue,T1);
 mul_mR(T1,T_EigsVector,a); 
 printf(" A : EigsVector * EigsValue * T_EigsVector"); 
 p_mR(a,S10,P2,C6); 
 f_mR(A);
 f_mR(a);
 f_mR(EigsVector);
 f_mR(T_EigsVector);
 f_mR(EigsValue); 
 f_mR(T1);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun();
} while(stop_w());
 return 0;
/* ------------------------------------ */
 A = V * EValue * T_V

Exemple de sortie écran :
 A :
 +806.0000 -447.0000 -207.0000 +644.0000 
 -447.0000 -539.0000 +192.0000 -311.0000 
 -207.0000 +192.0000 -949.0000 -523.0000 
 +644.0000 -311.0000 -523.0000 +986.0000 
 A : EigsVector * EigsValue * T_EigsVector
 +806.0000 -447.0000 -207.0000 +644.0000 
 -447.0000 -539.0000 +192.0000 -311.0000 
 -207.0000 +192.0000 -949.0000 -523.0000 
 +644.0000 -311.0000 -523.0000 +986.0000 
 Press return to continue
 Press X to stop

Mathc matrices/c11dn
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c00a.c */
/* ------------------------------------ */
double f(
double x)
 return(1.0/(x));
char feq[] = "1.0/(x)";
/* ------------------------------------ */
void fun(void)
double **A = rsymmetric_mR(i_mR(RCA,RCA),999.);
double **invA = i_mR(RCA,RCA);
double **EigsVector = i_mR(RCA,RCA);
double **T_EigsVector = i_mR(RCA,RCA);
double **EigsValue = i_mR(RCA,RCA);
double **invEigsValue = i_mR(RCA,RCA);
double **T1 = i_mR(RCA,RCA);
 clrscrn();
 printf(" Copy/Past into the octave windows \n\n");
 p_Octave_mR(A,"a",P0);
 printf("format short e\n");
 printf(" inv (a) \n\n");
 eigs_V_uv_mR(A,EigsVector); 
 transpose_mR(EigsVector,T_EigsVector); 
/* EigsValue : T_EigsVector * A * EigsVector */ 
 mul_mR(T_EigsVector,A,T1);
 mul_mR(T1,EigsVector,EigsValue); 
 f_eigs_uv_mR(f,EigsValue,invEigsValue);
//A == EigsVector * EigsValue * T_EigsVector 
 mul_mR(EigsVector,invEigsValue,T1);
 mul_mR(T1,T_EigsVector,invA);
 printf(" invA : EigsVector * invEigsValue * T_EigsVector"); 
 pE_mR(invA,S10,P4,C6); 
 printf(" Ide = A * invA "); 
 p_mR(mul_mR(A,invA,T1),S10,P5,C10); 
 f_mR(A);
 f_mR(invA);
 f_mR(EigsVector);
 f_mR(T_EigsVector);
 f_mR(EigsValue);
 f_mR(invEigsValue); 
 f_mR(T1);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun();
} while(stop_w());
 return 0;
/* ------------------------------------ */
 invA = V * invEValue * T_V

Exemple de sortie écran :
 Copy/Past into the octave windows 
 a=[
+754,+802,-773;
+802,-445,-911;
-773,-911,-779]
format short e
 inv (a) 
 invA : EigsVector * invEigsValue * T_EigsVector
-3.1542e-04 +8.6740e-04 -7.0139e-04 
+8.6740e-04 -7.7337e-04 +4.3696e-05 
-7.0139e-04 +4.3696e-05 -6.3881e-04 
 Ide = A * invA 
 +1.00000 -0.00000 +0.00000 
 +0.00000 +1.00000 +0.00000 
 -0.00000 +0.00000 +1.00000 
 Press return to continue
 Press X to stop

Mathc matrices/c11en
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c00a.c */
/* ------------------------------------ */
double f(
double x)
 return((x)*(x)*(x));
char feq[] = "(x)*(x)*(x)";
/* ------------------------------------ */
void fun(void)
double **A = rsymmetric_mR(i_mR(RCA,RCA),999.);
double **A_p3 = i_mR(RCA,RCA);
double **EigsVector = i_mR(RCA,RCA);
double **T_EigsVector = i_mR(RCA,RCA);
double **EigsValue = i_mR(RCA,RCA);
double **f_EigsValue = i_mR(RCA,RCA);
double **T1 = i_mR(RCA,RCA);
 clrscrn();
 printf(" Copy/Past into the octave windows \n");
 p_Octave_mR(A,"A",P0);
 printf(" A*A*A\n\n");
 stop();
 clrscrn(); 
 eigs_V_uv_mR(A,EigsVector); 
 transpose_mR(EigsVector,T_EigsVector);
/* EigsValue : T_EigsVector * A * EigsVector */
 mul_mR(T_EigsVector,A,T1);
 mul_mR(T1,EigsVector,EigsValue); 
 f_eigs_uv_mR(f,EigsValue,f_EigsValue);
/* A == EigsVector * EigsValue * T_EigsVector */ 
 mul_mR(EigsVector,f_EigsValue,T1);
 mul_mR(T1,T_EigsVector,A_p3); 
 printf(" A**3 : EigsVector * EigsValue**3 * T_EigsVector\n"); 
 pE_mR(A_p3,S10,P4,C6); 
 printf(" A**3"); 
 pow_mR(3,A,T1); 
 pE_mR(T1,S10,P4,C6); 
 f_mR(A);
 f_mR(A_p3);
 f_mR(EigsVector);
 f_mR(T_EigsVector);
 f_mR(EigsValue);
 f_mR(f_EigsValue); 
 f_mR(T1);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun();
} while(stop_w());
 return 0;
/* ------------------------------------ */
 A**3 = V EValue**3 T_V
 Exemple de sortie écran :
 Copy/Past into the octave windows 
 A=[
-999,+832,+542;
+832,-899,+736;
+542,+736,+964]
 A*A*A
 Press return to continue. 
 A**3 : EigsVector * EigsValue**3 * T_EigsVector
-2.6423e+09 +3.1484e+09 +7.7870e+08 
+3.1484e+09 -2.4507e+09 +1.3441e+09 
+7.7870e+08 +1.3441e+09 +2.3899e+09 
 A**3
-2.6423e+09 +3.1484e+09 +7.7870e+08 
+3.1484e+09 -2.4507e+09 +1.3441e+09 
+7.7870e+08 +1.3441e+09 +2.3899e+09 
 Press return to continue
 Press X to stop

Mathc matrices/c11fn
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c00a.c */
/* ------------------------------------ */
double f(
double x)
 return((x)*(x)*(x)*(x));
char feq[] = "(x)*(x)*(x)*(x)";
/* ------------------------------------ */
void fun(void)
double **A = rsymmetric_mR(i_mR(RCA,RCA),99.);
double **A_p4 = i_mR(RCA,RCA);
double **EigsVector = i_mR(RCA,RCA);
double **T_EigsVector = i_mR(RCA,RCA);
double **EigsValue = i_mR(RCA,RCA);
double **f_EigsValue = i_mR(RCA,RCA);
double **T1 = i_mR(RCA,RCA);
 clrscrn();
 printf(" Copy/Past into the octave windows \n\n");
 p_Octave_mR(A,"A",P0);
 printf(" A*A*A*A\n\n");
 eigs_V_uv_mR(A,EigsVector); 
 transpose_mR(EigsVector,T_EigsVector);
/* EigsValue : T_EigsVector * A * EigsVector */
 mul_mR(T_EigsVector,A,T1);
 mul_mR(T1,EigsVector,EigsValue); 
 f_eigs_uv_mR(f,EigsValue,f_EigsValue);
//A == EigsVector * EigsValue * T_EigsVector 
 mul_mR(EigsVector,f_EigsValue,T1);
 mul_mR(T1,T_EigsVector,A_p4);
 printf(" A**4 : EigsVector * EigsValue**4 * T_EigsVector"); 
 pE_mR(A_p4,S10,P4,C6); 
 printf(" A**4"); 
 pow_mR(4,A,T1); 
 pE_mR(T1,S10,P4,C6); 
 f_mR(A);
 f_mR(A_p4);
 f_mR(EigsVector);
 f_mR(T_EigsVector);
 f_mR(EigsValue);
 f_mR(f_EigsValue); 
 f_mR(T1);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun();
} while(stop_w());
 return 0;
/* ------------------------------------ */
 A**4 = V EValue**4 T_V
 Exemple de sortie écran :
 Copy/Past into the octave windows 
 A=[
-781,+206,-165,+270;
+206,+150,+962,-865;
-165,+962,-81,+738;
+270,-865,+738,+850]
 A*A*A*A
 Press return to continue. 
 A**4 : EigsVector * EigsValue**4 * T_EigsVector
+1.2094e+12 -1.6001e+12 +1.6212e+12 -9.1411e+11 
-1.6001e+12 +3.6726e+12 -2.2160e+12 -4.6210e+10 
+1.6212e+12 -2.2160e+12 +3.0157e+12 -1.2021e+12 
-9.1411e+11 -4.6210e+10 -1.2021e+12 +4.5455e+12 
 A**4
+1.2094e+12 -1.6001e+12 +1.6212e+12 -9.1411e+11 
-1.6001e+12 +3.6726e+12 -2.2160e+12 -4.6210e+10 
+1.6212e+12 -2.2160e+12 +3.0157e+12 -1.2021e+12 
-9.1411e+11 -4.6210e+10 -1.2021e+12 +4.5455e+12 
 Press return to continue
 Press X to stop