Mathc matrices/a111
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, -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 **Inv = i_mR(RA,CA);
double **X = i_mR(RA,Cb);
double **T = i_mR(RA,Cb);
 clrscrn();
 printf(" \n");
 printf(" Linear systems with common coefficient matrix.\n\n");
 printf(" Ax1=b1 \n");
 printf(" Ax2=b2 \n");
 printf(" ... \n");
 printf(" Axn=bn \n\n");
 printf(" We can write these equalities in this maner. \n\n");
 printf(" A|x1|x2|...|xn| = b1|b2|...|bn| \n\n");
 printf(" or simply : \n\n");
 printf(" AX = B \n\n");
 printf(" where B = b1|b2|...|bn \n\n");
 printf(" and X = x1|x2|...|xn \n\n");
 stop();
 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,C6);
 printf(" b1 b2 ... bn :\n");
 p_mR(B,S9,P0,C6);
 stop();
 clrscrn();
 printf(" inv(A) :\n");
 pE_mR(invgj_mR(A,Inv),S1,P4,C6);
 printf(" X = inv(A) * B :\n\n");
 printf(" x1 x2 ... xn\n");
 p_mR(mul_mR(Inv,B,X),S9,P4,C6);
 stop();
 clrscrn();
 printf(" b1 b2 ... bn :\n");
 p_mR(B,S9,P0,C6);
 printf(" Ax1 Ax2 ... Axn :\n");
 p_mR(mul_mR(A,X,T),S9,P0,C6);
 stop();
 f_mR(T);
 f_mR(X);
 f_mR(B);
 f_mR(Inv);
 f_mR(A);
 return 0;
/* ------------------------------------ */

Exemple de sortie écran :
 Linear systems with common coefficient matrix.
 Ax1=b1 
 Ax2=b2 
 Axn=bn 
 We can write these equalities in this maner. 
 A|x1|x2|...|xn| = b1|b2|...|bn| 
 or simply : 
 AX = B 
 where B = b1|b2|...|bn 
 and X = x1|x2|...|xn 
 Press return to continue. 
 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 
 b1 b2 ... bn :
 +437 -146 -175 -954 -432 
 -233 +243 +772 +920 -98 
 +444 -886 -604 -15 +946 
 Press return to continue. 
 ------------------------------------ 
 inv(A) :
-6.5676e-03 -5.7471e-04 -1.3807e-03 
-6.9674e-03 -9.4468e-04 -3.0912e-04 
-1.3892e-04 +9.1861e-04 +2.2000e-04 
 X = inv(A) * B :
 x1 x2 ... xn
 -3.3492 +2.0425 +1.5396 +5.7575 +1.5874 
 -2.9619 +1.0616 +0.6767 +5.7825 +2.8101 
 -0.1771 +0.0486 +0.6006 +0.9744 +0.1781 
 Press return to continue. 
 b1 b2 ... bn :
 +437 -146 -175 -954 -432 
 -233 +243 +772 +920 -98 
 +444 -886 -604 -15 +946 
 Ax1 Ax2 ... Axn :
 +437 -146 -175 -954 -432 
 -233 +243 +772 +920 -98 
 +444 -886 -604 -15 +946 
 Press return to continue.

Mathc matrices/a112
Application 
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00a.c */
int main(void)
double ab[RA*(CA+Cb)]={
 -804, -884, +529, +30, 
 -783, +367, +583, -826, 
 -804, -884, +529, +30 
double **Ab = ca_A_mR(ab,i_Abr_Ac_bc_mR(RA,CA,Cb));
double **A = c_Ab_A_mR(Ab,i_mR(RA,CA));
double **b = c_Ab_b_mR(Ab,i_mR(RA,Cb));
 clrscrn();
 printf(" A :");
 p_mR(A,S8,P0,C7);
 printf(" b :");
 p_mR(b,S8,P0,C7); 
 printf(" Ab :");
 p_mR(c_A_b_Ab_mR(A,b,Ab),S8,P0,C7);
 stop();
 clrscrn();
 printf(" Copy/Past into the octave window.\n\n");
 p_Octave_mR(Ab,"Ab",P0);
 printf("\n rref(Ab.00000000001)\n\n");
 stop();
 clrscrn();
 printf(" gj_mR(Ab) : The system is consistent"); 
 gj_PP_mR(Ab,YES);
 p_mR(Ab,S10,P4,C7);
 is_system_consistent_mR(Ab);
 stop();
 f_mR(Ab);
 f_mR(b);
 f_mR(A);
 return 0;
/* ------------------------------------ */

Exemple de sortie écran :
 A :
 -804 -884 +529 
 -783 +367 +583 
 -804 -884 +529 
 b :
 +30 
 -826 
 +30 
 Ab :
 -804 -884 +529 +30 
 -783 +367 +583 -826 
 -804 -884 +529 +30 
 Press return to continue. 
 ------------------------------------ 
 Copy/Past into the octave window.
 Ab=[
-804,-884,+529,+30;
-783,+367,+583,-826;
-804,-884,+529,+30]
 rref(Ab.00000000001)
 Press return to continue. 
 ------------------------------------ 
 gj_mR(Ab) : The system is consistent
 +1.0000 +0.0000 -0.7187 +0.7285 
 +0.0000 +1.0000 +0.0552 -0.6965 
 +0.0000 +0.0000 +0.0000 +0.0000 
 Press return to continue.

Mathc matrices/a113
Application 
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00a.c */
int main(void)
double ab[RA*(CA+Cb)]={
 +515, +546, -848, +756, 
 +628, -909, +148, -501, 
 +515, +546, -848, +305 
double **Ab = ca_A_mR(ab,i_Abr_Ac_bc_mR(RA,CA,Cb));
double **A = c_Ab_A_mR(Ab,i_mR(RA,CA));
double **b = c_Ab_b_mR(Ab,i_mR(RA,Cb));
 clrscrn();
 printf(" A :");
 p_mR(A,S8,P0,C7);
 printf(" b :");
 p_mR(b,S8,P0,C7); 
 printf(" Ab :");
 p_mR(c_A_b_Ab_mR(A,b,Ab),S8,P0,C7);
 stop();
 clrscrn();
 printf(" Copy/Past into the octave window.\n\n");
 p_Octave_mR(Ab,"Ab",P0);
 printf("\n rref(Ab.00000000001)\n\n");
 stop();
 clrscrn();
 printf(" gj_mR(Ab) :");
 gj_PP_mR(Ab,YES);
 p_mR(Ab,S10,P4,C7);
 is_system_consistent_mR(Ab);
 stop();
 f_mR(Ab);
 f_mR(b);
 f_mR(A);
 return 0;
/* ------------------------------------ */
 Système incompatible +0.0000 == -451.0000 ?
 Exemple de sortie écran :
 A :
 +515 +546 -848 
 +628 -909 +148 
 +515 +546 -848 
 b :
 +756 
 -501 
 +305 
 Ab :
 +515 +546 -848 +756 
 +628 -909 +148 -501 
 +515 +546 -848 +305 
 Press return to continue. 
 ------------------------------------ 
 Copy/Past into the octave window.
 Ab=[
+515,+546,-848,+756;
+628,-909,+148,-501;
+515,+546,-848,+305]
 rref(Ab.00000000001)
 Press return to continue. 
 gj_mR(Ab) :
 +1.0000 +0.0000 -0.8508 +0.5100 
 +0.0000 +1.0000 -0.7506 +0.9035 
 +0.0000 +0.0000 +0.0000 -451.0000 
 This(ese) row(s) are incompatible.
 row 3; 
 The system is inconsistent. 
 I prefer to close the program.
 Press return to continue.

Mathc matrices/a114
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00a.c */
int main(void)
double ab[RA*(CA+C1)]={
 -3, -9, +12, 
 +2, +6, -8, 
double **Ab = ca_A_mR(ab,i_Abr_Ac_bc_mR(RA,CA,Cb));
double **A = c_Ab_A_mR(Ab,i_mR(RA,CA));
double **b = c_Ab_b_mR(Ab,i_mR(RA,Cb));
double **Ab_free = i_Abr_Ac_bc_mR(csize_A_R(Ab),csize_A_R(Ab),Cb+C1);
double **b_free = i_mR(rsize_R(Ab_free),csize_b_R(Ab_free)); 
int r;
 clrscrn();
 printf(" A :");
 p_mR(A,S6,P1,C10);
 printf(" b :");
 p_mR(b,S6,P1,C10);
 printf(" Ab :");
 p_mR(Ab,S6,P1,C10);
 stop();
 clrscrn();
 printf(" Copy/Past into the octave window.\n\n");
 p_Octave_mR(Ab,"Ab",P1);
 printf("\n rref(Ab.00000000001)\n\n");
 printf(" Ab : gj_PP_mR(Ab,NO) :");
 gj_PP_mR(Ab,NO);
 p_mR(Ab,S6,P1,C10);
 stop();
 clrscrn(); 
 put_var_mR(Ab,Ab_free); 
 printf(" Ab_free : put_var_mR(Ab,Ab_free);"); 
 p_mR(Ab_free,S6,P1,C10); 
 put_freeV_mR(Ab_free);
 printf(" Ab_free : put_freeV_mR(Ab_free);"); 
 p_mR(Ab_free,S6,P1,C10); 
 stop();
 clrscrn();
 printf(" Copy/Past into the octave window.\n\n");
 p_Octave_mR(Ab_free,"Ab_free",P1);
 printf("\n rref(Ab_free.00000000001)\n\n");
 r = rsize_R(Ab_free);
 while(r>R1) 
 zero_below_pivot_gj1Ab_mR(Ab_free,r--);
 printf(" Ab_free : zero_below_pivot_gj1Ab_mR(Ab_free,r--);"); 
 p_mR(Ab_free,S6,P1,C10); 
 stop(); 
 clrscrn();
 c_Ab_b_mR(Ab_free,b_free);
 printf(" b_free :"); 
 p_mR(b_free,S10,P4,C7);
 printf(" b_free : free variables");
 p_freeV(b_free,S8,P4);
 stop();
 f_mR(Ab);
 f_mR(Ab_free);
 f_mR(b_free);
 f_mR(b);
 f_mR(A);
 return 0;
/* ------------------------------------ */