< Mathc matrices


Sommaire


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


inv_r.c
'
/* ------------------------------------ */
/*  Save as :   inv_r.c                 */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A   = i_mR(r,r);
double **Inv = i_mR(r,r);

  clrscrn();
  printf(" A\n");
  p_mR(r_mR(A,9999.),8,0,6);
  stop();

  clrscrn();
  printf(" invgj_mR(A,invA); gauss jordan (AId)\n");
  pE_mR(invgj_mR(A,Inv),12,4,6);
  printf(" inv_mR(A,Inv);  det,...,adjoint,... \n");
  pE_mR(inv_mR(A,Inv),12,4,6);
  stop();

  clrscrn();
  printf(" Copy/Past into the octave window.\n\n");
  p_octave_mR(A,"A",1,0);
  printf(" inv(A)\n");
  pE_mR(Inv,12,4,6);

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

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

} while(stop_w());

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


Déclaration des fichiers h.



Exemple de sortie écran :
 ------------------------------------
 A

    -821    -4131 
   -5773    +3154 

 Press return to continue. 


 ------------------------------------
 invgj_mR(A,invA); gauss jordan (AId)

 -1.1930e-04  -1.5625e-04 
 -2.1836e-04  +3.1054e-05 

 inv_mR(A,Inv);  det,...,adjoint,... 

 -1.1930e-04  -1.5625e-04 
 -2.1836e-04  +3.1054e-05 

 Press return to continue. 


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

 A=[
-821,-4131;
-5773,+3154]

 inv(A)

 -1.1930e-04  -1.5625e-04 
 -2.1836e-04  +3.1054e-05 


 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.