Aller au contenu

Mathc matrices/a113

Un livre de Wikilivres.


Application


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


gj_s2.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)]={
    +515,     +546,     -848,     +756, 
    +628,     -909,     +148,     -501, 
    +515,     +546,     -848,     +305    
};

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) :");
  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;
}
/* ------------------------------------ */
/* ------------------------------------ */


 Système incompatible           +0.0000 == -451.0000  ?

Exemple de sortie écran :
 ------------------------------------ 
 A :
    +515     +546     -848 
    +628     -909     +148 
    +515     +546     -848 

 b :
    +756 
    -501 
    +305 

 Ab :
    +515     +546     -848     +756 
    +628     -909     +148     -501 
    +515     +546     -848     +305 

 Press return to continue. 


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

 Ab=[
+515,+546,-848,+756;
+628,-909,+148,-501;
+515,+546,-848,+305]


 rref(Ab,.00000000001)

 Press return to continue. 

 ------------------------------------ 
 gj_mR(Ab) :
   +1.0000    +0.0000    -0.8508    +0.5100 
   +0.0000    +1.0000    -0.7506    +0.9035 
   +0.0000    +0.0000    +0.0000  -451.0000 

 This(ese) row(s) are incompatible.
 row 3;  
 The system is inconsistent. 
 I prefer to close the program.

 Press return to continue.