Mathc matrices/c101d
Application 
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : gj_s2.c */
void fun(int r)
double **Ab = r_singular_Ab_mR(i_Abr_Ac_bc_mR(r,r,C1),999);
double **A = c_Ab_A_mR(Ab,i_mR(r,r));
double **b = c_Ab_b_mR(Ab,i_mR(r,C1));
 clrscrn();
 printf(" A :");
 p_mR(A,S8,P0,C7);
 printf(" b :");
 r_mR(b,999.); /* I change the value of 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);
 f_mR(Ab);
 f_mR(b);
 f_mR(A);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun(rp_I(R5)+R1);
} while(stop_w());
 return 0;
/* ------------------------------------ */
 Système incompatible +0.00000 == +654.00000 +0.00000 == +526.00000 
 Exemple de sortie écran :
 A :
 -255 -569 -35 -391 -155 
 +380 +426 +622 -899 -779 
 -497 -429 -509 -655 +20 
 +380 +426 +622 -899 -779 
 +380 +426 +622 -899 -779 
 b :
 +424 
 +80 
 +208 
 +734 
 +606 
 Ab :
 -255 -569 -35 -391 -155 +424 
 +380 +426 +622 -899 -779 +80 
 -497 -429 -509 -655 +20 +208 
 +380 +426 +622 -899 -779 +734 
 +380 +426 +622 -899 -779 +606 
 Press return to continue. 
 Copy/Past into the octave window.
 Ab=[
-255,-569,-35,-391,-155,+424;
+380,+426,+622,-899,-779,+80;
-497,-429,-509,-655,+20,+208;
+380,+426,+622,-899,-779,+734;
+380,+426,+622,-899,-779,+606]
 rref(Ab.00000000001)
 Press return to continue. 
 gj_mR(Ab) :
 +1.00000 +0.00000 +0.00000 +8.74503 +3.88021 -1.38717 
 +0.00000 +1.00000 -0.00000 -2.93820 -1.29837 -0.19161 
 +0.00000 +0.00000 +1.00000 -4.77563 -2.73372 +1.10732 
 +0.00000 +0.00000 +0.00000 -0.00000 +0.00000 +654.00000 
 +0.00000 +0.00000 +0.00000 -0.00000 +0.00000 +526.00000 
 This(ese) row(s) are incompatible.
 row 4; row 5; 
 The system is inconsistent. 
 I prefer to close the program.
 Press return to continue.

Mathc matrices/c101e
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c06.c */
int main(void)
double ab[R4*C7]={
 +1, -3, +4, -2, +5, +4, 0,
 +2, -6, +9, -1, +8, +2, 0,
 +2, -6, +9, -1, +9, +7, 0, 
 -1, 3, -4, 2, -5, -4, 0, 
double **Ab = ca_A_mR(ab,i_Abr_Ac_bc_mR(R4,C6,C1));
double **A = c_Ab_A_mR(Ab,i_mR(R4,C6));
double **b = c_Ab_b_mR(Ab,i_mR(R4,C1));
double **Ab_free = i_Abr_Ac_bc_mR(csize_A_R(Ab),csize_A_R(Ab),C1+C3);
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); 
 stop();
 clrscrn(); 
 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");
 stop();
 clrscrn(); 
 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;
/* ------------------------------------ */
Imprimer les variables libres.

Exemple de sortie écran :
 A :
 +1.0 -3.0 +4.0 -2.0 +5.0 +4.0 
 +2.0 -6.0 +9.0 -1.0 +8.0 +2.0 
 +2.0 -6.0 +9.0 -1.0 +9.0 +7.0 
 -1.0 +3.0 -4.0 +2.0 -5.0 -4.0 
 b :
 +0.0 
 +0.0 
 +0.0 
 +0.0 
 Ab :
 +1.0 -3.0 +4.0 -2.0 +5.0 +4.0 +0.0 
 +2.0 -6.0 +9.0 -1.0 +8.0 +2.0 +0.0 
 +2.0 -6.0 +9.0 -1.0 +9.0 +7.0 +0.0 
 -1.0 +3.0 -4.0 +2.0 -5.0 -4.0 +0.0 
 Press return to continue. 
 Copy/Past into the octave window.
 Ab_free=[
+1.0,-3.0,+4.5,-0.5,+4.0,+1.0,+0.0,+0.0,+0.0,+0.0;
+0.0,+1.0,+0.0,+0.0,+0.0,+0.0,+0.0,+1.0,+0.0,+0.0;
-0.0,-0.0,+1.0,+3.0,-2.0,-6.0,-0.0,+0.0,+0.0,+0.0;
+0.0,+0.0,+0.0,+1.0,+0.0,+0.0,+0.0,+0.0,+1.0,+0.0;
+0.0,+0.0,+0.0,+0.0,+1.0,+5.0,+0.0,+0.0,+0.0,+0.0;
+0.0,+0.0,+0.0,+0.0,+0.0,+1.0,+0.0,+0.0,+0.0,+1.0]
 rref(Ab_free.00000000001)
 Press return to continue. 
 Ab_free : zero_below_pivot_gj1Ab_mR(Ab_free,r--);
 +1.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +3.0 +14.0 +37.0 
 +0.0 +1.0 +0.0 +0.0 +0.0 +0.0 +0.0 +1.0 +0.0 +0.0 
 +0.0 +0.0 +1.0 +0.0 +0.0 +0.0 +0.0 +0.0 -3.0 -4.0 
 +0.0 +0.0 +0.0 +1.0 +0.0 +0.0 +0.0 +0.0 +1.0 +0.0 
 +0.0 +0.0 +0.0 +0.0 +1.0 +0.0 +0.0 +0.0 +0.0 -5.0 
 +0.0 +0.0 +0.0 +0.0 +0.0 +1.0 +0.0 +0.0 +0.0 +1.0 
 Press return to continue. 
 b_free :
 +0.0000 +3.0000 +14.0000 +37.0000 
 +0.0000 +1.0000 +0.0000 +0.0000 
 +0.0000 +0.0000 -3.0000 -4.0000 
 +0.0000 +0.0000 +1.0000 +0.0000 
 +0.0000 +0.0000 +0.0000 -5.0000 
 +0.0000 +0.0000 +0.0000 +1.0000 
 b_free : free variables
 x1 = +0.0000 +3.0000*s +14.0000*t +37.0000*u
 x2 = +0.0000 +1.0000*s +0.0000*t +0.0000*u
 x3 = +0.0000 +0.0000*s -3.0000*t -4.0000*u
 x4 = +0.0000 +0.0000*s +1.0000*t +0.0000*u
 x5 = +0.0000 +0.0000*s +0.0000*t -5.0000*u
 x6 = +0.0000 +0.0000*s +0.0000*t +1.0000*u
 Press return to continue.

Mathc matrices/c101f
Étude du code
La fonction put_var_mR(Ab,Ab_free); installe les coefficients de la matrice Ab dans la matrice Ab_free. Il faut qu'elle tienne compte de la position du pivot de chaque ligne, et éventuellement ajouter des lignes vides pour que chaque pivot soit sur sa bonne ligne.
La fonction put_freeV_mR(Ab_free); permet de positionner les variables libres, et de les initialiser. 
La fonction p_freeV(b_free,S3,P0); permet de leurs donner un nom.

Mathc complexes/c101b
Bibliothèque
Copier la bibliothèque dans votre répertoire de travail avec les fichiers des parties précédentes :
Exemple pour tester la bibliothèque :

Mathc complexes/c101c
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c00a.c */
void fun(int r)
double **A = r_mZ(i_mZ(r+C2,r),999);
double **b = i_mZ(r+C2,C1);
double **Ab = i_Abr_Ac_bc_mZ(r+C2,r,C1);
 clrscrn();
 printf(" A :");
 p_mZ(A, S5,P0, S4,P0, C6);
 printf(" b :");
 p_mZ(r_mZ(b,999.), S5,P0, S4,P0, C6);
 stop();
 clrscrn();
 printf(" Copy/Past into the octave window.\n\n");
 p_Octave_mZ(c_A_b_Ab_mZ(A,b,Ab),"Ab",P0, P0);
 printf(" rref(Ab.00000000001)\n\n");
 printf(" gj_mZ(Ab) :");
 p_mZ(gj_mZ(Ab), S1,P4, S1,P4,C3);
 f_mZ(Ab);
 f_mZ(b);
 f_mZ(A);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun(rp_I(R3)+R1);
} while(stop_w());
 return 0;
/* ------------------------------------ */