Mathc matrices/h10a
Bibliothèque
Installer ce fichier dans votre répertoire de travail.
/* Save as : vgconsit.h */
double add_coef_r_Ab_mR(
double **Ab,
int r
double x;
int c;
 x=0.;
 for ( c=C1; c<Ab[C_SIZE][C0]; c++)
 x+=fabs(Ab[r][c]);
 return(x);
/* ------------------------------------ */
double add_coef_r_A_mR(
double **Ab,
int r
double x;
int c;
 x=0.;
 for ( c=C1; c<Ab[C_SIZE_A][C0]; c++)
 x+=fabs(Ab[r][c]);
 return(x);
/* ------------------------------------ */
void is_system_consistent_mR(
double **Ab
int r;
int consistent = 1;
 for ( r=R1; r<Ab[R_SIZE][C0]; r++)
 if((add_coef_r_A_mR(Ab,r)<ERROR_E) && (add_coef_r_Ab_mR(Ab,r)>ERROR_E))
 if(consistent) /* Print this line only the fisrt time */
 printf(" This(ese) row(s) are incompatible.\n");
 printf(" row %d; ",r);
 consistent=0;
 if(!consistent)
 printf("\n The system is inconsistent. \n");
 printf(" I prefer to close the program.\n");
 printf(" Press return to continue. \n");
 fflush(stdout);
 getchar();
 exit(EXIT_FAILURE);
/* ------------------------------------ */
 Déclaration des fichiers h.

Mathc matrices/h10b
Bibliothèque
Installer ce fichier dans votre répertoire de travail.
/* Save as : vgc_free.h */
void put_freevariable_mR(
double **Ab,
int r_not_0
int r;
int t;
 for( r=r_not_0,t=1; r<Ab[C_SIZE_A][C0]; r++,t++)
 c_s_mR(1.,Ab,r,r);
 c_s_mR(1.,Ab,r,Ab[C_SIZE_A][C0]+t);
/* ------------------------------------ */
 fichier h.

Mathc matrices/h10c
Bibliothèque
Installer ce fichier dans votre répertoire de travail.
/* Save as : v_g.h */
/* ------------------------------------ */ 
/* Gauss jordan */
/* ------------------------------------ */
 Les fichiers h.

Mathc matrices/h10d
Bibliothèque
Installer ce fichier dans votre répertoire de travail.
/* Save as : vgp_free.h */
void p_freeV(
double **b,
int e,
int d)
 int m;
 int r;
 int c;
char v;
 m = 0;
 for(r=R1; r<b[R_SIZE][C0]; r++)
 v = 'y' - (b[R_SIZE][C0]-C1);
 printf("\n");
 m++;
 printf(" x%d = ",m);
 for(c=C1; c<b[C_SIZE][C0]; c++)
 if(c==C1) printf(" %+*.*f",e,d,b[r][c]);
 else
 if(fabs(b[r][c])>ERROR_E) printf(" %+*.*f*%c",e,d,b[r][c],v);
 else printf(" %+*.*f*%c",e,d,0.,v);
 v++;
 printf("\n\n");
/* ------------------------------------ */
/* ------------ Chemistry ------------ */
void p_coefxn(
double **b
 int r;
 for(r=R1; r<b[R_SIZE][C0]; r++)
 printf("double x%d = %+0.8f;\n",r,b[r][C2]);
 printf("\n\n");
/* ------------------------------------ */
 Fichier h.

Mathc matrices/h10e
Bibliothèque
Installer ce fichier dans votre répertoire de travail.
/* Save as : vgj3free.h */
/* ------------------------------------ */
void 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++;
/* ------------------------------------ */
void put_freeV_mR(
double **Ab_free
int r;
int t=1;
 for (r=R1; r<Ab_free[R_SIZE][C0]; r++)
 if(Ab_free[r][r]< ERROR_E)
 c_s_mR(1.,Ab_free,r,r); 
 c_s_mR(1.,Ab_free,r,rsize_R(Ab_free)+C1+t);
 t++; 
/* ------------------------------------ */
 fichier h.

Mathc matrices/h10f
Étude du code
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : e01.c */
/* ------------------------------------ */
void XX_put_freeV_mR(
double **Ab_free
int r;
int t=1;
 for (r=R1; r<Ab_free[R_SIZE][C0]; r++)
 if(Ab_free[r][r]< ERROR_E)
 printf(" Ab_free : DEBUG 01 "); 
 p_mR(Ab_free,S5,P0,C11); 
 c_s_mR(1.,Ab_free,r,r); 
 c_s_mR(1.,Ab_free,r,rsize_R(Ab_free)+C1+t);
 t++; 
 printf(" Ab_free : put_freeV_mR(); Pivot[%d,%d]",r,r); 
 p_mR(Ab_free,S5,P0,C11);
 stop();
 clrscrn();
/* ------------------------------------ */
int main(void)
double ab[R4*C7]={
 1, 0, 0, 0, 0, 0, 0,
 0, 2, 0, 0, 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+C4);
 clrscrn();
// printf(" Ab :");
// p_mR(Ab,S3,P0,C7);
 put_var_mR(Ab,Ab_free); 
 printf(" Ab_free : "); 
 p_mR(Ab_free,S3,P0,C11); 
 stop(); 
 clrscrn(); 
 XX_put_freeV_mR(Ab_free);
 printf(" Ab_free : put_freeV_mR(Ab_free);"); 
 p_mR(Ab_free,S3,P0,C11); 
 stop();
 f_mR(Ab);
 f_mR(Ab_free);
 f_mR(b);
 f_mR(A);
 return 0;
/* ------------------------------------ */

Exemple de sortie écran :
 Ab_free : 
 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 
 +0 +2 +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 +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. 
 Ab_free : DEBUG 01 
 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 
 +0 +2 +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 +0 +0 
 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 
 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 
 Ab_free : put_freeV_mR(); Pivot[3,3]
 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 
 +0 +2 +0 +0 +0 +0 +0 +0 +0 +0 +0 
 +0 +0 +1 +0 +0 +0 +0 +1 +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 +0 +0 +0 +0 +0 +0 +0 
 Press return to continue.

Mathc matrices/h10g
Bibliothèque
Installer ce fichier dans votre répertoire de travail.
/* Save as : vgj1.h */
double **gj1_T_mR(
double **Ab
int r= R1;
 while(r<Ab[R_SIZE][C0])
 if(fabs(pivotbest_gj1Ab_mR(Ab,r))>ERROR_E) 
 zero_under_pivot_gj1Ab_mR(Ab,r);
 r++;

while(r>R1)
 zero_below_pivot_gj1Ab_mR(Ab,--r);
return(Ab);
/* ------------------------------------ */
double **gj_TP_mR(
double **Ab
 gj1_T_mR(Ab);
 sort_c_mR(Ab);
 sort_r_mR(Ab);
return(Ab);
/* ------------------------------------ */
double **gj1_mR(
double **Ab
 gj_TP_mR(Ab);
return(Ab);
/* ------------------------------------ */
 fichier h.

Mathc matrices/h10h
Étude du code
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : e02.c */
/* ------------------------------------ */
void XX_put_freeV_mR(
double **Ab_free
int r;
int t=1;
 for (r=R1; r<Ab_free[R_SIZE][C0]; r++)
 if(Ab_free[r][r]< ERROR_E)
 clrscrn();
 printf(" Ab_free : DEBUG 01 "); 
 p_mR(Ab_free,S6,P1,C11);
 c_s_mR(1.,Ab_free,r,r); 
 c_s_mR(1.,Ab_free,r,rsize_R(Ab_free)+C1+t);
 t++; 
 printf(" Ab_free : "
 "put_freeV_mR(Ab_free) Pivot[%d,%d]",r,r); 
 p_mR(Ab_free,S6,P1,C11);
 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,S6,P1,C7); 
 put_var_mR(Ab,Ab_free);
 printf(" Ab_free : put_var_mR(Ab,Ab_free);"); 
 p_mR(Ab_free,S6,P1,C11); 
 stop(); 
 clrscrn(); 
 XX_put_freeV_mR(Ab_free);
 printf(" Ab_free : put_freeV_mR(Ab_free);"); 
 p_mR(Ab_free,S6,P1,C11); 
 stop();
 f_mR(Ab);
 f_mR(Ab_free);
 f_mR(b);
 f_mR(A);
 return 0;
/* ------------------------------------ */