Aller au contenu

Mathc matrices/a227

Un livre de Wikilivres.


Application


Installer et compiler ces fichiers dans votre répertoire de travail.


c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(void)
{
double d1 = 5;
double d2 = 3;
double d3 = 4;
	
double a[R3*C3] = {  5,  5 + 2,  3,
                     3,  3 + 4,  1,
                     4,  4 + 2,  5};       

double a1[R3*C3] = { 1,  5 + 2,  3,
                     0,  3 + 4,  1,
                     0,  4 + 2,  5};                

double a2[R3*C3] = { 0,  5 + 2,  3,
                     1,  3 + 4,  1,
                     0,  4 + 2,  5};  
                     
double a3[R3*C3] = { 0,  5 + 2,  3,
                     0,  3 + 4,  1,
                     1,  4 + 2,  5};                      
                                                                          
double **A  = ca_A_mR(a ,i_mR(R3,C3));
double **A1 = ca_A_mR(a1,i_mR(R3,C3));
double **A2 = ca_A_mR(a2,i_mR(R3,C3));
double **A3 = ca_A_mR(a3,i_mR(R3,C3));
  
  clrscrn();
  printf("  A  :            " 
         "                                     det_R(A) = %+.0f",
                                                      det_R(A));
  p_mR(A,S3,P0,C6);
  
  printf(" A1 :       d1 = %.0f; " 
         " d1 det_R(A1) + d2 det_R(A2) + d3 det_R(A3) = %+.0f",  
           d1, d1*det_R(A1) + d2*det_R(A2) + d3*det_R(A3));
  p_mR(A1,S3,P0,C6);
  
  printf(" A2 :       d2 = %.0f;", d2);
  p_mR(A2,S3,P0,C6);
 
  printf(" A3 :       d3 = %.0f;", d3);
  p_mR(A3,S3,P0,C6); 
           
  stop();

  f_mR(A);
  f_mR(A1); 
  f_mR(A2);  
  f_mR(A3);  
}
/* ------------------------------------ */
int main(void)
{
  fun();

  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */




Exemple de sortie écran :
 ------------------------------------
  A  :                                                 det_R(A) = +38
 +5  +7  +3 
 +3  +7  +1 
 +4  +6  +5 

 A1 :       d1 = 5;  d1 det_R(A1) + d2 det_R(A2) + d3 det_R(A3) = +38
 +1  +7  +3 
 +0  +7  +1 
 +0  +6  +5 

 A2 :       d2 = 3;
 +0  +7  +3 
 +1  +7  +1 
 +0  +6  +5 

 A3 :       d3 = 4;
 +0  +7  +3 
 +0  +7  +1 
 +1  +6  +5 

 Press return to continue.