Aller au contenu

Mathc matrices/a229

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 a11 = 5;
double a12 = 2;
double a13 = 3;

double a[R3*C3] = {  a11, a12, a13,
                       3,   4,   1,
                       4,   2,   5};                           
                                                                          
double **A  = ca_A_mR(a ,i_mR(R3,C3));
  
  clrscrn();
  printf(" M = Minor;   C = cofactor \n\n"
         " We work with the first row \n\n\n");
         
  printf("  A  :                         det_R(A) = %+.0f", det_R(A));
  p_mR(A,S3,P0,C6);
  
  printf("\n"
         " det_R(A) = a11 M11 - a12 M12 + a13 M13 = %+.0f\n\n",
   
                + a11 * minor_R(A, R1, C1) 
                - a12 * minor_R(A, R1, C2) 
                + a13 * minor_R(A, R1, C3) ); 
                
  printf("\n"
         " det_R(A) = a11 C11 + a12 C12 + a13 C13 = %+.0f\n\n",
  
                + a11 * cofactor_R(A, R1, C1)   
                + a12 * cofactor_R(A, R1, C2)                
                + a13 * cofactor_R(A, R1, C3) ); 
   
  stop();

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

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


Exemple de sortie écran :
 ------------------------------------
 M = Minor;   C = cofactor 

 We work with the first row 


  A  :                         det_R(A) = +38
 +5  +2  +3 
 +3  +4  +1 
 +4  +2  +5 


 det_R(A) = a11 M11 - a12 M12 + a13 M13 = +38


 det_R(A) = a11 C11 + a12 C12 + a13 C13 = +38

 Press return to continue.