< Mathc matrices


Sommaire


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


gj_r3.c
'
/* ------------------------------------ */
/*  Save as :   gj_r3.c                 */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A  = r_mR(i_mR(r+C2,r),999.);
double **b  =      i_mR(r+C2,C1);
double **Ab = i_AbR0_mR(r+C2,r,C1);
/*            i_AbR0_mR(R_Ab,C_A,C_b));  */

  clrscrn();
  printf(" A :");
  p_mR(A,8,0,7);
  printf(" b :");
  p_mR(r_mR(b,999.),8,0,7);
  printf(" Ab :");
  p_mR(c_A_b_Ab_mR(A,b,Ab),8,0,7);
  getchar();

  clrscrn();
  printf(" Copy/Past into the octave window.\n\n");
  p_octave_mR(Ab,"Ab",1,0);
  printf("\n rref(Ab,.00000000001)\n\n");
  printf(" gj_mR(Ab) :");
  p_mR(gj_mR(Ab),10,5,7);

  f_mR(Ab);
  f_mR(b);
  f_mR(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
do
{
  fun(rp_I(5)+1);


} while(stop_w());

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


Déclaration des fichiers h.



Exemple de sortie écran :
 ------------------------------------ 
 A :
    -461     +892     +488     +982 
    -859     -171     -783       +8 
    -365     +578     +972     +660 
    +118     +408     +216     -999 
    +974     +820     +104     -169 
    -325     -985     +328       +4 

 b :
    -747 
    -423 
    -553 
     +88 
    -833 
    -531 

 Ab :
    -461     +892     +488     +982     -747 
    -859     -171     -783       +8     -423 
    -365     +578     +972     +660     -553 
    +118     +408     +216     -999      +88 
    +974     +820     +104     -169     -833 
    -325     -985     +328       +4     -531 


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

 Ab=[
-461,+892,+488,+982,-747;
-859,-171,-783,+8,-423;
-365,+578,+972,+660,-553;
+118,+408,+216,-999,+88;
+974,+820,+104,-169,-833;
-325,-985,+328,+4,-531]


 rref(Ab,.00000000001)

 gj_mR(Ab) :
 Error : gj_mR();

 The number of colums

 must be superior or egal

 to the number of rows

 Press return to continue.


Exemple de sortie Octave :
>>  Ab=[
-461,+892,+488,+982,-747;
-859,-171,-783,+8,-423;
-365,+578,+972,+660,-553;
+118,+408,+216,-999,+88;
+974,+820,+104,-169,-833;
-325,-985,+328,+4,-531]
Ab =

  -461   892   488   982  -747
  -859  -171  -783     8  -423
  -365   578   972   660  -553
   118   408   216  -999    88
   974   820   104  -169  -833
  -325  -985   328     4  -531

>>
>>
>>  rref(Ab,.00000000001)
ans =

   1   0   0   0   0
   0   1   0   0   0
   0   0   1   0   0
   0   0   0   1   0
   0   0   0   0   1
   0   0   0   0   0
Cet article est issu de Wikibooks. Le texte est sous licence Creative Commons - Attribution - Partage dans les Mêmes. Des conditions supplémentaires peuvent s'appliquer aux fichiers multimédias.