< Mathc matrices


Sommaire


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


gjfree_a.c
'
/* ------------------------------------ */
/*  Save as :   gjfree_a.c                 */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
int main(void)
{
double ab[4*7]={
 1,  3, -2,  0,  2,  0,  0,
 2,  6, -5, -2,  4, -3, -1,
 0,  0,  5, 10,  0, 15,  5,
 2,  6,  0,  8,  4, 18,  6,
};

/*                       i_AbR0_mR(R_Ab,C_A,C_b));  */

double **Ab = ca_A_mR(ab,i_AbR0_mR(R4,C6,C1));
double **A  = c_Ab_A_mR(Ab,i_mR(R4,C6));
double **b  = c_Ab_b_mR(Ab,i_mR(R4,C1));

  clrscrn();
  printf(" A :");
  p_mR(A,5,0,9);
  printf(" b :");
  p_mR(b,5,0,9);
  stop();

  clrscrn();
  printf(" Ab ");
  p_mR(Ab,5,0,9);
  gj_freevariable_mR(Ab,1,4);
  stop();

  f_mR(Ab);
  f_mR(b);
  f_mR(A);
  return 0;
}

/* ------------------------------------ */
/* ------------------------------------ */


Déclaration des fichiers h.



Exemple de sortie écran :
 ------------------------------------ 
 A :
   +1    +3    -2    +0    +2    +0 
   +2    +6    -5    -2    +4    -3 
   +0    +0    +5   +10    +0   +15 
   +2    +6    +0    +8    +4   +18 

 b :
   +0 
   -1 
   +5 
   +6 

 Press return to continue. 


 ------------------------------------ 
 Ab 
   +1    +3    -2    +0    +2    +0    +0 
   +2    +6    -5    -2    +4    -3    -1 
   +0    +0    +5   +10    +0   +15    +5 
   +2    +6    +0    +8    +4   +18    +6 


 x1 =  +0.0000 +u
 x2 =  +0.0000 +0.6667*s -0.6667*t -0.3333*u
 x3 =  +0.0000 +s
 x4 =  +0.0000 -0.5000*s
 x5 =  +0.0000 +t
 x6 =  +0.3333
 Press return to continue.
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.