Aller au contenu

Mathc matrices/a228

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 a21 = 3;
double a31 = 4;

double a[R3*C3] = {  a11,  2,  3,
                     a21,  4,  1,
                     a31,  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 column \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 - a21 M21 + a31 M31 = %+.0f\n\n",
   
                + a11 * minor_R(A, R1, C1) 
                - a21 * minor_R(A, R2, C1) 
                + a31 * minor_R(A, R3, C1) ); 
                
  printf("\n"
         " det_R(A) = a11 C11 + a21 C21 + a31 C31 = %+.0f\n\n",
  
                + a11 * cofactor_R(A, R1, C1)  
                + a21 * cofactor_R(A, R2, C1)               
                + a31 * cofactor_R(A, R3, C1) ); 
   
  stop();

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

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


Exemple de sortie écran :
 ------------------------------------

 M = Minor;   C = cofactor 

 We work with the first column 


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


 det_R(A) = a11 M11 - a21 M21 + a31 M31 = +38


 det_R(A) = a11 C11 + a21 C21 + a31 C31 = +38

 Press return to continue.