< Mathc matrices


Sommaire


Installer ce fichier dans votre répertoire de travail.

vgpivot4.h
'
/* ------------------------------------ */
/*  Save as :   vgpivot4.h                   */
/* ------------------------------------ */
double pivotbest_gj4r0_mR(
double **Ab,
int pivot_r,
int pivot_c
)
{
double pivotbest = fabs(Ab[pivot_r][pivot_c]);
int best_r = pivot_r;
int r;

  for   ( r=pivot_r; r<Ab[R_SIZE][C0]; r++)

            if(fabs(Ab[r][pivot_c])>pivotbest)
             {
               pivotbest = fabs(Ab[r][pivot_c]);
                  best_r = r;
              }

 if(best_r!=pivot_r) 
   { 
    swapR_mR(Ab,pivot_r,best_r);
    swapcoefR0_mR(Ab,pivot_r,best_r);
   }

 return(pivotbest);
}
/* ------------------------------------ */
void zero_under_pivot_gj4Ab_mR(
double **Ab,
int pivot_r,
int pivot_c
)
{
double pivot = Ab[pivot_r][pivot_c];
int r;

  if(fabs(pivot)>ERROR_E)
    {
     mulR_mR( Ab,(1./pivot),pivot_r); 

     for( r=(pivot_r+C1); r<Ab[R_SIZE][C0]; r++) 

         addR_mR( Ab,(-Ab[r][pivot_c]),pivot_r,r);
    }
}
/* ------------------------------------ */
/* ------------------------------------ */
void zero4_under_all_pivot_mR(
double **Ab
)
{
int r= R1;
int c= C1;

    while((r<Ab[R_SIZE][C0]) &&
          (c<Ab[C_SIZE_A][C0])
         )
       {
        if(fabs(pivotbest_gj2Ab_mR(Ab,r,r))>ERROR_E)  
                zero_under_pivot_gj2Ab_mR(Ab,r,r);
        r++;
       }
}
/* ------------------------------------ */
/* ------------------------------------ */


fichier h.
 


Cet article est issu de Wikibooks. Le texte est sous licence Creative Commons - Attribution - Partage dans les Mêmes. Des conditions supplémentaires peuvent s'appliquer aux fichiers multimédias.