Mathc matrices/c101c
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c05.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);
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(); 
 f_mR(Ab);
 f_mR(b);
 f_mR(A);
 return 0;
/* ------------------------------------ */
On résout le système et on vérifie avec octave.

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.

Mathc matrices/c102a
Étude du code
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : d01.c */
/* ------------------------------------ */
void XX_put_var_mR(
double **Ab,
double **Ab_free
int r;
int c;
int r_free= R1;
int t=0;
 for (r=R1; r<Ab[R_SIZE][C0]; r++)
 for (c=r+t; c<Ab[C_SIZE_A][C0]; c++)
 if(Ab[r][c]> ERROR_E)
 c_r_mR(Ab,r,Ab_free,r_free);
 c = Ab[C_SIZE_A][C0];
 r_free++;
 else
 r_free++;
 t++;
/* ------------------------------------ */
int main(void)
double ab[R4*C7]={
 1, 0, 0, 0, 0, 0, 0,
 0, 2, 3, 4, 5, 6, 0, 
 0, 0, 0, 0, 0, 0, 0, 
 0, 0, 0, 0, 0, 0, 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);
 clrscrn();
 printf(" Ab :");
 p_mR(Ab,S8,P0,C7);
 XX_put_var_mR(Ab,Ab_free);
 printf(" Ab_free : put_var_mR(); "); 
 p_mR(Ab_free,S8,P0,C8); 
 stop();
 f_mR(Ab);
 f_mR(b);
 f_mR(A);
 return 0;
/* ------------------------------------ */

Exemple de sortie écran :
 Ab :
 +1 +0 +0 +0 +0 +0 +0 
 +0 +2 +3 +4 +5 +6 +0 
 +0 +0 +0 +0 +0 +0 +0 
 +0 +0 +0 +0 +0 +0 +0 
 Ab_free : put_var_mR(); 
 +1 +0 +0 +0 +0 +0 +0 
 +0 +2 +3 +4 +5 +6 +0 
 +0 +0 +0 +0 +0 +0 +0 
 +0 +0 +0 +0 +0 +0 +0 
 +0 +0 +0 +0 +0 +0 +0 
 +0 +0 +0 +0 +0 +0 +0 
 Press return to continue.

Mathc matrices/c102b
Étude du code
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : d02.c */
/* ------------------------------------ */
void XX_put_var_mR(
double **Ab,
double **Ab_free
int r;
int c;
int r_free= R1;
int t=0;
 for (r=R1; r<Ab[R_SIZE][C0]; r++)
 for (c=r+t; c<Ab[C_SIZE_A][C0]; c++)
 if(Ab[r][c]> ERROR_E)
 clrscrn();
 printf(" Ab :");
 p_mR(Ab,S5,P1,C10);
 printf(" Ab_free : DEBUG 01 "); 
 p_mR(Ab_free,S5,P1,C10); 
 c_r_mR(Ab,r,Ab_free,r_free);
 printf(" Ab_free : put_var_mR(); : Copy a line of Ab"); 
 p_mR(Ab_free,S5,P1,C10);
 stop();
 clrscrn(); 
 c = Ab[C_SIZE_A][C0];
 r_free++; 
 else
 clrscrn();
 printf(" Ab :");
 p_mR(Ab,S5,P1,C10);
 printf(" Ab_free : DEBUG 02 "); 
 p_mR(Ab_free,S5,P1,C10); 
 r_free++;
 t++;
 printf(" Ab_free : put_var_mR(); : A Zero Line"); 
 p_mR(Ab_free,S5,P1,C10);
 stop();
 clrscrn(); 
/* ------------------------------------ */
int main(void)
double ab[R4*C7]={
 +1.0, -3.0, +4.5, -0.5, +4.0, +1.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, +1.0, +5.0, +0.0, 
 +0.0, +0.0, +0.0, +0.0, +0.0, +0.0, +0.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);
 clrscrn();
 printf(" Ab :");
 p_mR(Ab,S5,P1,C10);
 stop();
 clrscrn(); 
 XX_put_var_mR(Ab,Ab_free); 
 printf(" Ab_free : put_var_mR();"); 
 p_mR(Ab_free,S5,P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