Aller au contenu

Mathc matrices/007

Un livre de Wikilivres.


Application


Installer et compiler ce fichier dans votre répertoire de travail.

c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
int main(void)
{
 double **A     =    i_mR(R3,C5);
 
   clrscrn();
   printf("       Math : A[%d][%d]:",rsize_R(A),csize_R(A));
   p_mR(A, S4,P0,C7);

   printf(" The pall_mR(); function shows the internal\n"
          " structure of the matrix.\n\n");   	
   printf(" C language : A[%d][%d]:\n",rsize_R(A),csize_R(A));
   pall_mR(A, S4,P0,C7);
   
   printf(" The columns have an index.\n\n"
          " On the left you have the size of the matrix.\n"
          " Four rows with the row zero and\n"
          " six columns with the column zero.\n\n"); 
             
   stop();

   f_mR(A);
  
   return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Dans cet exemple, on peut voir la structure interne de la matrice, grâce à la fonction pall_mR();


Exemple de sortie écran :

        Math : A[3][5]:
  +0   +0   +0   +0   +0 
  +0   +0   +0   +0   +0 
  +0   +0   +0   +0   +0 

 The pall_mR(); function shows the internal
 structure of the matrix.

 C language : A[3][5]:
+4        +1   +2   +3   +4   +5 

+6        +0   +0   +0   +0   +0 
+0        +0   +0   +0   +0   +0 
+0        +0   +0   +0   +0   +0 

 The columns have an index.

 On the left you have the size of the matrix.
 Four rows with the row zero and
 six columns with the column zero.

 Press return to continue.