Mathc complexes/h09k

Un livre de Wikilivres.


Bibliothèque


Installer ce fichier dans votre répertoire de travail.

wgsort.h
/* ------------------------------------ */
/*  Save as :   wgsort.h                */
/* ------------------------------------ */
void sort_c_mZ(
double **Ab
)
{
double **T = i_RC_mZ(Ab[R_SIZE][C0],Ab[C_SIZE][C0]);
int c;
nb_Z c_T;

  for(c=C1; c<Ab[C_SIZE][C0]; c+=C2)
      {
           c_T = i_Z( Ab[R0][c],Ab[R0][c+C1]); 
            cR0_c_mZ(Ab,
                     c,
                     T,
                     ((c_T.r-C1)*C2+C1) );
      }

  cR0_mZ(T,Ab);
  f_mZ(T);
}
/* ------------------------------------ */
void sort_r_mZ(
double **Ab
)
{
nb_Z pivot;
double abs_pivot = 0.;
int r_pivot = R1;
int r = R1;
int c;

    for ( c=C1; c<Ab[C_SIZE_A][C0]; c+=C2)
      {
              r = r_pivot;
      abs_pivot = 0.;
      while((abs_pivot<ERROR_E) &&
             r<Ab[R_SIZE][C0])
         {
          pivot = i_Z( Ab[r][c],Ab[r][c+C1]);

          abs_pivot = (pivot.r*pivot.r)+(pivot.i*pivot.i);
          if(abs_pivot>ERROR_E) {
                                 swapR_mZ(Ab,r,r_pivot);
                                 r_pivot++;
                                }
          r++;
         }
       }
}
/* ------------------------------------ */
void sort4_r_coef_r0_mZ(
double **Ab
)
{
double **Ab_T = i_RC_mZ(Ab[R_SIZE][C0],Ab[C_SIZE][C0]);
int c;
int r;
int r_T;
nb_Z T;

  

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

        for ( c=C1; c<Ab[C_SIZE][C0]; c+=C2)
            {
             T= i_Z( Ab[R0][(((r-C1)*C2)+C1)],
                     Ab[R0][(((r-C1)*C2)+C1)+C1]);
             
             r_T = T.r;
             Ab_T[r_T][c]    = Ab[r][c];
             Ab_T[r_T][c+C1] = Ab[r][c+C1];
            }


  cR0_mZ(Ab_T,Ab);
  f_mZ(Ab_T);
}
/* ------------------------------------ */
/* ------------------------------------ */


Déclaration des fichiers h.