Mathc complexes/h09m

Un livre de Wikilivres.


Bibliothèque


Installer ce fichier dans votre répertoire de travail.

wgipivot.h
/* ------------------------------------ */
/*  Save as :   wgipivot.h              */
/* ------------------------------------ */
/* ------------------------------------
   pivotbest = |a+bI|^2 =  = a^2+b^2
   ------------------------------------ */
double pivotbestAId_mZ(
double **Ab,
int pivot_r,
int pivot_c
)
{
double pivotbest=Ab[pivot_r][pivot_c]   *Ab[pivot_r][pivot_c]
                                     +
                 Ab[pivot_r][pivot_c+C1]*Ab[pivot_r][pivot_c+C1];
double pivot = pivotbest;
int best_r = pivot_r;
int best_c = pivot_c;
int r;
int c;

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

    for( c=pivot_c; c<Ab[C_SIZE_A][C0]; c+=C2)
         {
          pivot = Ab[r][c]   *Ab[r][c] + 
                  Ab[r][c+C1]*Ab[r][c+C1];

           if(pivot>pivotbest)
             {
               pivotbest=pivot;
               best_r = r;
               best_c = c;
             }
         }
   c--;

 if(best_r!=pivot_r)   swapR_mZ(Ab,pivot_r,best_r);
 if(best_c!=pivot_c){swapC_mZ(Ab,pivot_c,best_c);
                     swapC_mZ(Ab,pivot_c+c,best_c+c);
                    }

 return(pivotbest);
}
/* ------------------------------------ */
/* ------------------------------------ */


Déclaration des fichiers h.