Mathc matrices/h16b

Un livre de Wikilivres.


Bibliothèque



Installer ce fichier dans votre répertoire de travail.

vgj3piv.h
/* ------------------------------------ */
/*  Save as :   vgj3piv.h               */
/* ------------------------------------ */
double pivotbest_gj3Ab_mR(
double **Ab,
int pivot_r,
int pivot_c
)
{
double pivotbest;

int r;
int best_r;

    best_r = pivot_r;
 pivotbest = fabs(Ab[pivot_r][pivot_c]);

  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);

 return(pivotbest);
}
/* ------------------------------------ */
void zero_under_pivot_gj3Ab_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 zero_below_pivot_gj3Ab_mR(
double **Ab,
int pivot_r,
int pivot_c
)
{
int r;

  if(fabs(Ab[pivot_r][pivot_c])>ERROR_E)

     for( r=(pivot_r-C1); r>=R1; r--) 

        addR_mR( Ab,(-Ab[r][pivot_c]),pivot_r,r);
}
/* ------------------------------------ */
/* ------------------------------------ */


Déclaration des fichiers h.