< Mathc matrices


Sommaire


Installer ce fichier dans votre répertoire de travail.

vgc_coef.h
'
/* ------------------------------------ */
/*  Save as :   vgc_coef.h                  */
/* ------------------------------------ */
double c_coef_R(
double **A,
int r,
int c
)
{
    if( r<R1 ||
        c<C1 ||
        r>A[R_SIZE][C0] ||
        c>A[C_SIZE][C0] )
    {
     printf("\n Error : c_coef_R(); \n\n");
     printf("\n r = %d;  c = %d; \n",r,c);
     printf("\n r and c must be : \n");
     printf("\n r>=1; c>=1;\n r=<%.0f; c=<%.0f;\n",
              A[R_SIZE][C0],
              A[C_SIZE][C0]);
     printf("\n Press return to continue. \n");
     fflush(stdout);
     getchar();
     exit(EXIT_FAILURE);
    }
    return( A[r][c] );
}
/* ------------------------------------ */
double c_coefR0_R(
double **A,
int r,
int c
)
{
    if( r<C0 ||
        c<C0 ||
        r>A[R_SIZE][C0] ||
        c>A[C_SIZE][C0] )
    {
     printf("\n Error : c_coef_R(); \n\n");
     printf("\n r = %d;  c = %d; \n",r,c);
     printf("\n r and c must be : \n");
     printf("\n r>=0; c>=0;\n r=<%.0f; c=<%.0f;\n",
              A[R_SIZE][C0],
              A[C_SIZE][C0]);
     printf("\n Press return to continue. \n");
     fflush(stdout);
     getchar();
     exit(EXIT_FAILURE);
    }
    return( A[r][c] );
}
/* ------------------------------------ */
int c_index_R(
double **A,
int c
)
{
    return( A[R0][c] );
}
/* ------------------------------------ */
void c_s_mR(
double  s,
double **A,
int r,
int c
)
{
    if( r<R1 ||
        c<C1 ||
        r>A[R_SIZE][C0] ||
        c>A[C_SIZE][C0] )
    {
     printf("\n Error : c_coef_R(); \n\n");
     printf("\n r = %d;  c = %d; \n",r,c);
     printf("\n r and c must be : \n");
     printf("\n r>=1; c>=1;\n r=<%.0f; c=<%.0f;\n",
              A[R_SIZE][C0],
              A[C_SIZE][C0]);
     printf("\n Press return to continue. \n");
     fflush(stdout);
     getchar();
     exit(EXIT_FAILURE);
    }
         A[r][c] = s;
}
/* ------------------------------------ */
/* ------------------------------------ */


Déclaration des fichiers 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.