Linear Algebra and the C Language/a09k


Code study: put_zeroR_mR();

  • I copy the coefficients of Ab into Ab_free.
  • I do not copy the coefficient less than ERROR_E (+1.E-010).


/* ------------------------------------ */
/* ------------------------------------ */
void 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)
          { 
            c_r_mR(Ab,r,Ab_free,r_free);
            c = Ab[C_SIZE_A][C0];
            r_free++;
          }
        else
        {
		  r_free++;
		  t++;
	    }

}
/* ------------------------------------ */
/* ------------------------------------ */