Exemple de sortie écran :
 A :
+88 -45 -95 -55 
-85 -73 -77 -19 
-49 -45 +28 -63 
-83 +32 +76 -51 
 Press return to continue. 
/* --------- DEBUG 1 ---------- */
 Ab : pivot[4][[4]
 +1.0000 -0.9263 +0.5789 +0.4737 -0.0000 -0.0105 -0.0000 -0.0000 
 -0.0000 +1.0000 -0.1636 +0.2337 -0.0000 +0.0052 -0.0000 -0.0064 
 -0.0000 -0.0000 +1.0000 +0.0109 -0.0000 -0.0089 -0.0103 +0.0008 
 -0.0000 -0.0000 -0.0000 +1.0000 -0.0192 +0.0063 +0.0165 +0.0015 
 Ab : zero_below_pivot_gj1Ab_mR(Ab,--r);
 +1.0000 -0.9263 +0.5789 +0.0000 +0.0091 -0.0135 -0.0078 -0.0007 
 +0.0000 +1.0000 -0.1636 +0.0000 +0.0045 +0.0037 -0.0038 -0.0068 
 +0.0000 +0.0000 +1.0000 +0.0000 +0.0002 -0.0090 -0.0105 +0.0008 
 -0.0000 -0.0000 -0.0000 +1.0000 -0.0192 +0.0063 +0.0165 +0.0015 
 Press return to continue. 
/* --------- DEBUG 1 ---------- */
 Ab : pivot[3][[3]
 +1.0000 -0.9263 +0.5789 +0.0000 +0.0091 -0.0135 -0.0078 -0.0007 
 +0.0000 +1.0000 -0.1636 +0.0000 +0.0045 +0.0037 -0.0038 -0.0068 
 +0.0000 +0.0000 +1.0000 +0.0000 +0.0002 -0.0090 -0.0105 +0.0008 
 -0.0000 -0.0000 -0.0000 +1.0000 -0.0192 +0.0063 +0.0165 +0.0015 
 Ab : zero_below_pivot_gj1Ab_mR(Ab,--r);
 +1.0000 -0.9263 +0.0000 +0.0000 +0.0090 -0.0083 -0.0017 -0.0012 
 +0.0000 +1.0000 +0.0000 +0.0000 +0.0045 +0.0023 -0.0056 -0.0066 
 +0.0000 +0.0000 +1.0000 +0.0000 +0.0002 -0.0090 -0.0105 +0.0008 
 -0.0000 -0.0000 -0.0000 +1.0000 -0.0192 +0.0063 +0.0165 +0.0015 
 Press return to continue. 
/* --------- DEBUG 1 ---------- */
 Ab : pivot[2][[2]
 +1.0000 -0.9263 +0.0000 +0.0000 +0.0090 -0.0083 -0.0017 -0.0012 
 +0.0000 +1.0000 +0.0000 +0.0000 +0.0045 +0.0023 -0.0056 -0.0066 
 +0.0000 +0.0000 +1.0000 +0.0000 +0.0002 -0.0090 -0.0105 +0.0008 
 -0.0000 -0.0000 -0.0000 +1.0000 -0.0192 +0.0063 +0.0165 +0.0015 
 Ab : zero_below_pivot_gj1Ab_mR(Ab,--r);
 +1.0000 +0.0000 +0.0000 +0.0000 +0.0132 -0.0062 -0.0069 -0.0073 
 +0.0000 +1.0000 +0.0000 +0.0000 +0.0045 +0.0023 -0.0056 -0.0066 
 +0.0000 +0.0000 +1.0000 +0.0000 +0.0002 -0.0090 -0.0105 +0.0008 
 -0.0000 -0.0000 -0.0000 +1.0000 -0.0192 +0.0063 +0.0165 +0.0015 
 Press return to continue. 
 Copy/Past into the octave window.
format short e
 A=[
+88,-45,-95,-55;
-85,-73,-77,-19;
-49,-45,+28,-63;
-83,+32,+76,-51]
 inv(A)
 +2.2515e-03 -6.6172e-03 +4.5301e-03 -5.5588e-03 
 +6.2632e-03 +1.5128e-03 -1.9241e-02 +1.6451e-02 
 -6.2066e-03 -7.3174e-03 +1.3189e-02 -6.8733e-03 
 -8.9834e-03 +8.1395e-04 +2.0933e-04 -1.0482e-02 
 A * inv(A)
 +1.0000 +0.0000 +0.0000 -0.0000 
 +0.0000 +1.0000 +0.0000 -0.0000 
 +0.0000 +0.0000 +1.0000 -0.0000 
 -0.0000 +0.0000 -0.0000 +1.0000 
 Press return to continue
 Press X to stop

Mathc matrices/c09a08
Étude du code
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : inv08.c */
/* ------------------------------------ */
double **xx_sort_c_mR(
double **Ab
double **T = i_RC_mR(Ab[R_SIZE][C0],Ab[C_SIZE][C0]);
int c;
 for(c=C1; c<Ab[C_SIZE][C0]; c++)
 c_c_withR0_mR( Ab, c,
 T, Ab[R0][c]);
 c_withR0_mR(T,Ab);
 f_mR(T);
 return(Ab);
/* ------------------------------------ */
double **XX_invgj_mR(
double **A,
double **invA
double **ID = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]);
double **AID;
int r = A[R_SIZE][C0];
 r--;
 AID = i_Abr_Ac_bc_mR(r,r,r);
 eye_mR(ID);
 c_A_b_Ab_mR(A,ID,AID);
 invgj_pivot_mR(AID);
 xx_sort_c_mR(AID);
 sort_r_mR(AID);
 c_Inv_A_mR(AID,invA);
 f_mR(AID);
 f_mR(ID);
return(invA);
/* ------------------------------------ */
void fun(int r)
double **A = r_mR( i_mR(r,r), 99.);
double **Inv = i_mR(r,r);
double **AInv = i_mR(r,r);
 clrscrn();
 XX_invgj_mR(A,Inv);
 printf(" Copy/Past into the octave window.\n\n");
 printf("format short e\n");
 p_Octave_mR(A,"A",P0);
 printf(" inv(A)");
 pE_mR(Inv,S12,P4,C6);
 printf(" A * inv(A)");
 mul_mR(A,Inv,AInv);
 p_mR(AInv,S12,P4,C6);
 f_mR(AInv); 
 f_mR(Inv);
 f_mR(A);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun(rp_I(C2)+C2);
} while(stop_w());
 return 0;
/* ------------------------------------ */
 Nous allons voir une nouvelle fonction, sort_c_mR(); que nous appellerons xx_sort_c_mR();

Exemple de sortie écran :
 Copy/Past into the octave window.
format short e
 A=[
-73,+14,-97;
+38,+78,-87;
-43,+94,-39]
 inv(A)
 -5.2751e-03 +8.8042e-03 -6.5199e-03 
 -5.3645e-03 +1.3599e-03 +1.0309e-02 
 -7.1136e-03 -6.4296e-03 +6.3946e-03 
 A * inv(A)
 +1.0000 +0.0000 +0.0000 
 +0.0000 +1.0000 +0.0000 
 -0.0000 +0.0000 +1.0000 
 Press return to continue
 Press X to stop

Mathc matrices/c09a09
Étude du code
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : inv09.c */
/* ------------------------------------ */
double **xx_sort_c_mR(
double **Ab
double **T = i_RC_mR(Ab[R_SIZE][C0],Ab[C_SIZE][C0]);
int c;
 for(c=C1; c<Ab[C_SIZE][C0]; c++)
clrscrn(); 
printf("/* --------- DEBUG 1 ---------- */\n\n"); 
printf(" Copy C[%d] of Ab into C[%.0f] of T\n",c,Ab[R0][c]);
pall_mR(Ab,S8,P4,C8);
 c_c_withR0_mR( Ab, c,
 T, Ab[R0][c]);
printf(" T[R0][%.0f]\n",Ab[R0][c]);
pall_mR(T,S8,P4,C8);
stop();
clrscrn(); 
/* --------- DEBUG 1 ---------- */

c_withR0_mR(T,Ab);
 f_mR(T);
 return(Ab);
/* ------------------------------------ */
double **XX_invgj_mR(
double **A,
double **invA
double **ID = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]);
double **AID;
int r = A[R_SIZE][C0];
 r--;
 AID = i_Abr_Ac_bc_mR(r,r,r);
 eye_mR(ID);
 c_A_b_Ab_mR(A,ID,AID);
 invgj_pivot_mR(AID);
 xx_sort_c_mR(AID);
 sort_r_mR(AID);
 c_Inv_A_mR(AID,invA);
 f_mR(AID);
 f_mR(ID);
return(invA);
/* ------------------------------------ */
void fun(int r)
double **A = r_mR( i_mR(r,r), 99.);
double **Inv = i_mR(r,r);
double **AInv = i_mR(r,r);
 clrscrn();
 XX_invgj_mR(A,Inv);
 printf(" Copy/Past into the octave window.\n\n");
 printf("format short e\n");
 p_Octave_mR(A,"A",P0);
 printf(" inv(A)\n");
 pE_mR(Inv,S12,P4,C6);
 printf(" A * inv(A)\n");
 mul_mR(A,Inv,AInv);
 p_mR(AInv,S12,P4,C6);
 f_mR(AInv); 
 f_mR(Inv);
 f_mR(A);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun(C3);
} while(stop_w());
 return 0;
/* ------------------------------------ */
 Nous utilisons la fonction pall_mR(); au lieu de p_mR(); pour voir l'index des colonnes.