Mathc complexes/a188
Application
Installer et compiler ce fichier dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
double u[TAB][RU*C2]=; 
double **U[TAB];
double **B = i_mZ(RU,RU);
double w[RU*C2] = {+2,1, +2,3};
double **W = ca_A_mZ(w,i_mZ(RU,C1));
double **BW = i_mZ(RU,C1);
double **InvB = i_mZ(RU,RU);
int c;
 clrscrn();
 for(c=C0; c<TAB; c++)
 U[c] = ca_A_mZ( u[c],i_mZ(RU,C1));
 c_c_mZ(U[c],C1, B,c+C1);

printf(" Two U vectors in the Standard Basis \n\n" 
 " U[0] U[1] :"); 
 p_mZ(B,S6,P0,S3,P0,C10);
 printf(" The W vector in the standard basis : "); 
 p_mZ(W,S6,P0,S3,P0,C10); 
 printf(" Find the coordinate of W into the U basis");
 mul_mZ(inv_mZ(B,InvB),W,BW);
 p_mZ(BW,S6,P0,S3,P0,C10);
 stop();
 for(c=C0; c<TAB; c++)
 f_mZ(U[c]); 
 f_mZ(B); 
 f_mZ(InvB); 
 f_mZ(W);
 f_mZ(BW);
/* ------------------------------------ */
int main(void)
 fun();
 return 0;
/* ------------------------------------ */
 Introduction du vecteur V.
Exemple de sortie écran :
 Two U vectors in the Standard Basis 
 U[0] U[1] :
 +2 +1i +1 +5i 
 +2 +3i +5 +2i 
 The W vector in the standard basis : 
 +2 +1i 
 +2 +3i 
 Find the coordinate of W into the U basis
 +1 +0i 
 -0 +0i 
 Press return to continue.

Mathc matrices/a108
Application 
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : gj_r2.c */
int main(void)
double at[RA*CA]={
 +10, -150, -148, 
 +207, -215, +997, 
 -858, +803, +289 
double bt[RA*Cb]={
 +437, -146, -175, -954, -432, 
 -233, +243, +772, +920, -98, 
 +444, -886, -604, -15, +946 
double **A = ca_A_mR(at,i_mR(RA,CA));
double **b = ca_A_mR(bt,i_mR(RA,Cb));
double **Ab = i_Abr_Ac_bc_mR(RA,CA,Cb);
 clrscrn();
 printf(" A :");
 p_mR(A,S8,P0,C6);
 printf(" b1 b2 ... bn :\n");
 p_mR(b,S8,P0,C6);
 stop();
 clrscrn(); 
 printf(" Ab :");
 c_A_b_Ab_mR(A,b,Ab);
 p_mR(Ab,S8,P0,C6);
 stop();
 clrscrn();
 printf(" Copy/Past into the octave window.\n\n");
 p_Octave_mR(Ab,"Ab",P0);
 printf("\n rref(Ab.00000000001)\n\n");
 printf(" gj_TP_mR(Ab) :");
 gj_TP_mR(Ab);
 p_mR(Ab,S10,P4,C6);
 stop();
 f_mR(Ab);
 f_mR(b);
 f_mR(A);
 return 0;
/* ------------------------------------ */
Nous utilisons la fonction gj_TP_mR(Ab); pour résoudre ce système.

Exemple de sortie écran :
 A :
 +10 -150 -148 
 +207 -215 +997 
 -858 +803 +289 
 b1 b2 ... bn :
 +437 -146 -175 -954 -432 
 -233 +243 +772 +920 -98 
 +444 -886 -604 -15 +946 
 Press return to continue. 
 Ab :
 +10 -150 -148 +437 -146 -175 
 +207 -215 +997 -233 +243 +772 
 -858 +803 +289 +444 -886 -604 
 -954 -432 
 +920 -98 
 -15 +946 
 Press return to continue. 
 ------------------------------------ 
 Copy/Past into the octave window.
 Ab=[
+10,-150,-148,+437,-146,-175,-954,-432;
+207,-215,+997,-233,+243,+772,+920,-98;
-858,+803,+289,+444,-886,-604,-15,+946]
 rref(Ab.00000000001)
 gj_TP_mR(Ab) :
 +1.0000 +0.0000 -0.0000 -3.3492 +2.0425 +1.5396 
 -0.0000 +1.0000 -0.0000 -2.9619 +1.0616 +0.6767 
 +0.0000 +0.0000 +1.0000 -0.1771 +0.0486 +0.6006 
 +5.7575 +1.5874 
 +5.7825 +2.8101 
 +0.9744 +0.1781 
 Press return to continue.

Mathc matrices/a109
Application 
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c00.c */
int main(void)
double at[RA*CA]={
 +10, -150, -148, 
 +207, -215, +997, 
 -858, +803, +289 
double **A = ca_A_mR(at,i_mR(RA,CA));
double **b = eye_mR( i_mR(RA,Cb));
double **Ab = i_Abr_Ac_bc_mR(RA,CA,Cb);
double **invA = i_mR(RA,CA);
 clrscrn();
 printf(" A :");
 p_mR(A,S8,P0,C6);
 printf(" b : ID :");
 p_mR(b,S8,P0,C6);
 stop();
 clrscrn(); 
 printf(" Ab :");
 c_A_b_Ab_mR(A,b,Ab);
 p_mR(Ab,S8,P0,C6);
 printf(" gj_TP_mR(Ab) :"); 
 gj_TP_mR(Ab);
 pE_mR(Ab,S12,P4,C6);;
 stop();
 clrscrn(); 
 printf(" Copy/Past into the octave window.\n\n");
 p_Octave_mR(A,"A",P0);
 printf("format short e\n");
 printf(" inv(A)\n\n");
 printf(" invA : c_Inv_A_mR(Ab,invA);"); 
 c_Inv_A_mR(Ab,invA);
 pE_mR(invA,S12,P4,C6);
 stop();
 f_mR(invA);
 f_mR(Ab);
 f_mR(b);
 f_mR(A);
 return 0;
/* ------------------------------------ */
 Utiliser la fonction gj_TP_mR(Ab); pour inverser une matrice.
 Exemple de sortie écran :
 A :
 -828 +6 +321 +504 
 +555 +300 +507 -830 
 +303 +959 +719 -612 
 -458 -594 -64 -25 
 b : ID :
 +1 +0 +0 +0 
 +0 +1 +0 +0 
 +0 +0 +1 +0 
 +0 +0 +0 +1 
 Press return to continue. 
 ------------------------------------
 Ab :
 -828 +6 +321 +504 
 +555 +300 +507 -830 
 +303 +959 +719 -612 
 -458 -594 -64 -25 
 +1 +0 +0 +0 
 +0 +1 +0 +0 
 +0 +0 +1 +0 
 +0 +0 +0 +1 
 gj_TP_mR(Ab) :
 +1.0000e+00 +0.0000e+00 +0.0000e+00 +0.0000e+00 
 +0.0000e+00 +1.0000e+00 +0.0000e+00 +0.0000e+00 
 +0.0000e+00 +0.0000e+00 +1.0000e+00 +0.0000e+00 
 +0.0000e+00 +0.0000e+00 +0.0000e+00 +1.0000e+00 
 +9.6778e-04 +2.4025e-03 -2.3558e-03 -2.5803e-03 
 -1.1140e-03 -2.3055e-03 +2.1822e-03 +6.6390e-04 
 +2.6791e-03 +3.5312e-03 -2.4923e-03 -2.2132e-03 
 +1.8810e-03 +1.7253e-03 -2.3089e-03 -2.8374e-03 
 Press return to continue. 
 ------------------------------------
 Copy/Past into the octave window.
 A=[
-828,+6,+321,+504;
+555,+300,+507,-830;
+303,+959,+719,-612;
-458,-594,-64,-25]
format short e
 inv(A)
 invA : c_Inv_A_mR(Ab,invA);
 +9.6778e-04 +2.4025e-03 -2.3558e-03 -2.5803e-03 
 -1.1140e-03 -2.3055e-03 +2.1822e-03 +6.6390e-04 
 +2.6791e-03 +3.5312e-03 -2.4923e-03 -2.2132e-03 
 +1.8810e-03 +1.7253e-03 -2.3089e-03 -2.8374e-03 
 Press return to continue
 Press X return to stop

Mathc matrices/a110
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c00.c */
int main(void)
double at[RA*CA]={
 +10, -150, -148, 
 +207, -215, +997, 
 -858, +803, +289 
double bt[RA*Cb]={
 +437, 
 -233, 
 +444 
double **A = ca_A_mR(at,i_mR(RA,CA));
double **B = ca_A_mR(bt,i_mR(RA,Cb));
double **Inv = i_mR(RA,C3);
double **X = i_mR(RA,Cb);
double **T = i_mR(RA,Cb);
 clrscrn();
 printf(" We want to find X such as, \n\n");
 printf(" AX = B \n\n");
 printf(" If A is a square matrix and, \n\n");
 printf(" If A has an inverse matrix, \n\n");
 printf(" you can find X by this method\n\n");
 printf(" X = inv(A) B \n\n\n");
 printf(" To verify the result you can \n\n");
 printf(" multiply the matrix A by X. \n\n");
 printf(" You must refind B. \n\n");
 stop();
 clrscrn();
 printf(" A :\n");
 p_mR(A,S5,P0,C7);
 printf(" B :\n");
 p_mR(B,S5,P0,C7);
 stop();
 clrscrn();
 printf(" inv(A) :\n");
 pE_mR(invgj_mR(A,Inv),S1,P3,C7);
 printf(" X = inv(A) * B :\n");
 p_mR(mul_mR(Inv,B,X),S13,P4,C7);
 stop();
 clrscrn();
 printf(" B :\n");
 p_mR(B,S5,P0,C7);
 printf(" AX :\n");
 p_mR(mul_mR(A,X,T),S5,P0,C7);
 stop();
 f_mR(T);
 f_mR(X);
 f_mR(B);
 f_mR(Inv);
 f_mR(A);
 return 0;
/* ------------------------------------ */

Exemple de sortie écran :
 We want to find X such as, 
 AX = B 
 If A is a square matrix and, 
 If A has an inverse matrix, 
 you can find X by this method
 X = inv(A) B 
 To verify the result you can 
 multiply the matrix A by X. 
 You must refind B. 
 Press return to continue. 
 ------------------------------------ 
 A :
 +10 -150 -148 
 +207 -215 +997 
 -858 +803 +289 
 B :
 +437 
 -233 
 +444 
 Press return to continue. 
 ------------------------------------ 
 inv(A) :
-6.568e-03 -5.747e-04 -1.381e-03 
-6.967e-03 -9.447e-04 -3.091e-04 
-1.389e-04 +9.186e-04 +2.200e-04 
 X = inv(A) * B :
 -3.3492 
 -2.9619 
 -0.1771 
 Press return to continue. 
 ------------------------------------ 
 B :
 +437 
 -233 
 +444 
 AX :
 +437 
 -233 
 +444 
 Press return to continue.