< Mathc complexes


Sommaire


Installer ce fichier dans votre répertoire de travail.

wg_i.h
'
/* ------------------------------------ */
/*  Save as :   wg_i.h                  */
/* ------------------------------------ */
double **i_AbR0_mZ(
int     Ab_r,
int      A_c,
int      b_c
)
{
double **Ab;
int    c;
int    T;
int Ab_c;

   if( Ab_r < R2 || A_c<C2 || b_c<C1)
            {
            printf(" Error : double **iAbR0_mZ(); \n\n");
            printf(" A_c, b_c must be : Ab_r < R2 || A_c<C2 || b_c<C1 \n\n");
            printf(" This matrix is to study linear sytem.\n\n");
            fflush(stdout);
            getchar();
            exit(EXIT_FAILURE);
            }

   Ab_c = A_c + b_c;

     Ab = i_mZ( Ab_r, Ab_c);  /* create the matrix */

   for(c=C1,T=C1; c<Ab[C_SIZE][C0]; c+=C2,T++) /* index the columns */

        Ab[R0][c] = T;

    Ab[C_SIZE_A][C0] = A_c*C2+C1; /*  Ab[C_SIZE][C0]; The size of A */

return(Ab);
}
/* ------------------------------------ */
double **i_duplicateR0_mZ(
int      r,
int      c
)
{
double **A;
double T;

  r =  (r-C1);
  c = ((c-C1)/C2);

  A = i_mZ(r,c);

   for(c=C1,T=R1; c<A[C_SIZE][C0]; c+=C2,T++) /* index the columns */

        A[R0][c] = T;

return(A);
}
/* ------------------------------------ */
double **i_duplicateAbR0_Ab_c_A_c_mZ(
int     Ab_r,
int     Ab_c,
int      A_c
)
{
double **Ab;
int T;

  Ab_r--;
  Ab_c = ((Ab_c-C1)/C2);

/* DEBUG :
           printf("  r:%d  c:%d  A_c:%d  \n\n",Ab_r,Ab_c,A_c);
           getchar();
*/
  Ab = i_mZ(Ab_r,Ab_c);

  for(Ab_c=C1,T=R1; Ab_c<Ab[C_SIZE][C0]; Ab_c+=C2,T++)

        Ab[R0][Ab_c] = T;

  Ab[C_SIZE_A][C0] = A_c;

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


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.