Étude du code


Installer et compiler ces fichiers dans votre répertoire de travail.


d02.c
/* ------------------------------------ */
/*  Save as :   d02.c                 */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
void XX_put_zeroR_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_zeroR_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_zeroR_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_zeroR_mR(Ab,Ab_free);  
  printf(" Ab_free : put_zeroR_mR();");  
  p_mR(Ab_free,S5,P1,C10);  
  stop();

  f_mR(Ab);
  f_mR(b);
  f_mR(A);
  
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */



Exemple de sortie écran :
 ------------------------------------ 
 Ab :
 +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 

 ------------------------------------ 
 Ab :
 +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 

 Ab_free : DEBUG 01 
 +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.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  +0.0  +0.0  +0.0  +0.0  +0.0  +0.0  +0.0 

 Ab_free :  put_zeroR_mR(); : Copy a line of Ab
 +1.0  -3.0  +4.5  -0.5  +4.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.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 
 +0.0  +0.0  +0.0  +0.0  +0.0  +0.0  +0.0  +0.0  +0.0  +0.0 

 ------------------------------------ 
 Ab :
 +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 

 Ab_free : DEBUG 02 
 +1.0  -3.0  +4.5  -0.5  +4.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.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 
 +0.0  +0.0  +0.0  +0.0  +0.0  +0.0  +0.0  +0.0  +0.0  +0.0 

 Ab_free :  put_zeroR_mR(); : A Zero Line
 +1.0  -3.0  +4.5  -0.5  +4.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.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 
 +0.0  +0.0  +0.0  +0.0  +0.0  +0.0  +0.0  +0.0  +0.0  +0.0 

 Press return to continue.