Bibliothèque


Installer ce fichier dans votre répertoire de travail.

wgconsit.h
/* ------------------------------------ */
/*  Save as :   wgconsit.h              */
/* ------------------------------------ */
double add_coef_r_Ab_mZ(
double **Ab,
int r
)
{
double x=0.;
int c;
    
    for ( c=C1; c<Ab[C_SIZE][C0]; c++)

              x+=fabs(Ab[r][c]);
 return(x);
}
/* ------------------------------------ */
double add_coef_r_A_mZ(
double **A,
int r
)
{
double x=0.;
int c;
    
    for ( c=C1; c<A[C_SIZE_A][C0]; c++)

              x+=fabs(A[r][c]);
 return(x);
}
/* ------------------------------------ */
int is_system_consistent_mZ(
double **Ab,
double **c_Ab
)
{
double **Ab_T=i_RC_mZ(Ab[R_SIZE][C0],Ab[C_SIZE][C0]);
int consistent = 1;
int r_T=R1;
int r;
    
    for ( r=R1; r<Ab[R_SIZE][C0]; r++)

            if(add_coef_r_A_mZ(c_Ab,r)>ERROR_E)
              {
                c_r_mZ(Ab,r,Ab_T,r_T);
                r_T++;
              }
            else if((add_coef_r_A_mZ(c_Ab,r)<ERROR_E) &&
                    (add_coef_r_Ab_mZ(c_Ab,r)>ERROR_E))
                     {
                      if(consistent)
                      printf(" This(ese) row(s) are incompatible.\n");

                      printf(" row %d;  ",r);
                      consistent=0;
                     }

  c_mZ(Ab_T,Ab);

  f_mZ(Ab_T);

  if(!consistent)
    {
     printf("\n\n This(ese) equation(s) was already defined\n");
     printf(" with an other value(s)        \n");
     printf("\n The system is inconsistent. \n");
     printf(" I prefer to close the program.\n");
     printf(" Press return to continue.     \n");
     fflush(stdout);
     getchar();
     exit(EXIT_FAILURE);
    }

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


Déclaration des fichiers h.