< Mathc matrices


Sommaire


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


gj_r2.c
'
/* ------------------------------------ */
/*  Save as :   gj_r2.c                 */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A  = r_mR(i_mR(r,r+C2),999.);
double **b  = i_mR(r,C1);
double **Ab = i_AbR0_mR(r,r+C2,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 :
    -543     -823     +346     -917     -705 
    -491     +480     +854     +934     +342 
    +850     -493       +4     +812     -411 

 b :
    -189 
    +948 
    +516 

 Ab :
    -543     -823     +346     -917     -705     -189 
    -491     +480     +854     +934     +342     +948 
    +850     -493       +4     +812     -411     +516 

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

 Ab=[
-543,-823,+346,-917,-705,-189;
-491,+480,+854,+934,+342,+948;
+850,-493,+4,+812,-411,+516]


 rref(Ab,.00000000001)

 gj_mR(Ab) :
  +1.00000   +0.00000   +0.00000   +1.41027   -0.00196   +0.77518 
  +0.00000   +1.00000   -0.00000   +0.79627   +0.82974   +0.30111 
  +0.00000   +0.00000   +1.00000   +1.45695   -0.06703   +1.38651 


 Press return to continue
 Press X      to stop
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.