Mathc matrices/a112

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"
/* ------------------------------------ */
#define   RA R3
#define   CA C3
#define   Cb C1
/* ------------------------------------ */
int main(void)
{
double ab[RA*(CA+Cb)]={
    -804,     -884,     +529,      +30, 
    -783,     +367,     +583,     -826, 
    -804,     -884,     +529,      +30   
};

double **Ab = ca_A_mR(ab,i_Abr_Ac_bc_mR(RA,CA,Cb));
double **A  = c_Ab_A_mR(Ab,i_mR(RA,CA));
double **b  = c_Ab_b_mR(Ab,i_mR(RA,Cb));

  clrscrn();
  printf(" A :");
  p_mR(A,S8,P0,C7);
  printf(" b :");
  p_mR(b,S8,P0,C7); 
  printf(" Ab :");
  p_mR(c_A_b_Ab_mR(A,b,Ab),S8,P0,C7);
  stop();

  clrscrn();
  printf(" Copy/Past into the octave window.\n\n");
  p_Octave_mR(Ab,"Ab",P0);
  printf("\n rref(Ab,.00000000001)\n\n");
  stop();
  
  clrscrn();
  printf(" gj_mR(Ab) :                       The system is consistent");  
  gj_PP_mR(Ab,YES);
  p_mR(Ab,S10,P4,C7);
  
  is_system_consistent_mR(Ab);
  stop();

  f_mR(Ab);
  f_mR(b);
  f_mR(A);

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



Exemple de sortie écran :
 ------------------------------------ 
 A :
    -804     -884     +529 
    -783     +367     +583 
    -804     -884     +529 

 b :
     +30 
    -826 
     +30 

 Ab :
    -804     -884     +529      +30 
    -783     +367     +583     -826 
    -804     -884     +529      +30 

 Press return to continue. 


 ------------------------------------ 
 Copy/Past into the octave window.

 Ab=[
-804,-884,+529,+30;
-783,+367,+583,-826;
-804,-884,+529,+30]


 rref(Ab,.00000000001)

 Press return to continue. 


 ------------------------------------ 
 gj_mR(Ab) :                       The system is consistent
   +1.0000    +0.0000    -0.7187    +0.7285 
   +0.0000    +1.0000    +0.0552    -0.6965 
   +0.0000    +0.0000    +0.0000    +0.0000 

 Press return to continue.