Mathc complexes/Fichiers h : vpm

Un livre de Wikilivres.
Sauter à la navigation Sauter à la recherche


Installer ce fichier dans votre répertoire de travail.

Crystal Clear mimetype source h.png wpm.h
'
/* ------------------------------------ */
/*  Save as :   wpm.h                   */
/* ------------------------------------ */
double **p_mZ(
double **A,
int er,
int dr,
int ei,
int di,
int n
)
{
int r;
int c;
int n_c;
int n_c_LAST;
int n_c_FIRST;

n_c = R1;

while(n_c<A[C_SIZE][C0])
     {
      n_c+=n*C2;
                          n_c_FIRST = n_c-n*C2;
      if(n_c<A[C_SIZE][C0])n_c_LAST  = n_c;
      else                n_c_LAST  = A[C_SIZE][C0];

 	  for(r=R1; r<A[R_SIZE][C0]; r++)
         {
          printf("\n");
 	      for (c=n_c_FIRST; c<n_c_LAST; c+=C2)
               printf("%+*.*f%+*.*fi ",er,dr,A[r][c],ei,di,A[r][c+C1]);
          }
      printf("\n");
     }
printf("\n");

return(A);
}
/* ------------------------------------ */
double **pE_mZ(
double **A,
int er,
int dr,
int ei,
int di,
int n
)
{
int r;
int c;
int n_c;
int n_c_LAST;
int n_c_FIRST;

n_c = R1;

while(n_c<A[C_SIZE][C0])
     {
      n_c+=n*C2;
                          n_c_FIRST = n_c-n*C2;
      if(n_c<A[C_SIZE][C0])n_c_LAST  = n_c;
      else                n_c_LAST  = A[C_SIZE][C0];

 	  for(r=R1; r<A[R_SIZE][C0]; r++)
         {
          printf("\n");
 	      for (c=n_c_FIRST; c<n_c_LAST; c+=C2)
               printf("%+*.*e%+*.*ei ",er,dr,A[r][c],ei,di,A[r][c+C1]);
          }
      printf("\n");
     }
printf("\n");

return(A);
}
/* ------------------------------------ */
double **p_mRZ(
double **A,
int er,
int dr,
int n
)
{
int r;
int c;
int n_c;
int n_c_LAST;
int n_c_FIRST;

n_c = C1;

while(n_c<A[C_SIZE][C0])
     {
      n_c+=n*C2;
                          n_c_FIRST = n_c-n*C2;
      if(n_c<A[C_SIZE][C0])n_c_LAST = n_c;
      else                n_c_LAST  = A[C_SIZE][C0];

 	  for(r=R1; r<A[R_SIZE][C0]; r++)
         {
          printf("\n");
 	      for (c=n_c_FIRST; c<n_c_LAST; c+=C2)
               printf("%+*.*f ",er,dr,A[r][c]);
          }
      printf("\n");
     }
printf("\n");

return(A);
}
/* ------------------------------------ */
double **pE_mRZ(
double **A,
int er,
int dr,
int n
)
{
int r;
int c;
int n_c;
int n_c_LAST;
int n_c_FIRST;

n_c = C1;

while(n_c<A[C_SIZE][C0])
     {
      n_c+=n*C2;
                          n_c_FIRST = n_c-n*C2;
      if(n_c<A[C_SIZE][C0])n_c_LAST = n_c;
      else                n_c_LAST  = A[C_SIZE][C0];

 	  for(r=R1; r<A[R_SIZE][C0]; r++)
         {
          printf("\n");
 	      for (c=n_c_FIRST; c<n_c_LAST; c+=C2)
               printf("%+*.*e ",er,dr,A[r][c]);
          }
      printf("\n");
     }
printf("\n");

return(A);
}


Ces fonctions permettent d'imprimer une matrice à l'écran.

On peut contrôler la taille des colonnes, le nombre de chiffres après la virgule, le nombre de colonnes par ligne.