Étude du code


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


e02.c
/* ------------------------------------ */
/*  Save as :   e02.c                 */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
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_zeroR_mR(Ab,Ab_free);
    
  printf(" Ab_free : put_zeroR_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;
}
/* ------------------------------------ */
/* ------------------------------------ */




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_free : put_zeroR_mR(Ab,Ab_free);
  +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   +1.0   +3.0   -2.0   -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 
  +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   +0.0   +0.0   +0.0   +0.0   +0.0 

 Press return to continue. 

 ------------------------------------
 Ab_free : DEBUG 01 
  +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   +1.0   +3.0   -2.0   -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 
  +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   +0.0   +0.0   +0.0   +0.0   +0.0 

 Ab_free : put_freeV_mR(Ab_free) Pivot[2,2]
  +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   +0.0   +0.0   +0.0   +0.0   +0.0   +0.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   +0.0   +0.0   +0.0   +0.0   +0.0 

 Press return to continue.