Aller au contenu

Mathc matrices/c15b

Un livre de Wikilivres.


Application

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

c00c.c
/* ------------------------------------ */
/*  Save as:   c00c.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define Cb C4
/* ------------------------------------ */
void fun(int r)
{
double **A  =        r_mR(     i_mR(r,r),999);
double **b  =        r_mR(     i_mR(r,Cb),999);
double **Ab = c_A_b_Ab_mR(A,b, i_Abr_Ac_bc_mR(r,r,Cb));

  clrscrn();
  printf(" A:");
  p_mR(A, S8,P0,C4);

  printf("       b1       b2      ...      bn:");
  p_mR(b, S8,P0,C4);
  stop();
  
  clrscrn();
  printf(" Copy/Paste into the octave window.\n\n");
  p_Octave_mR(Ab,"Ab",P0);
  printf(" rref(Ab,.00000000001)\n\n");
  
  printf(" gj_TP_mR(Ab):");
  p_mR(gj_TP_mR(Ab), S10,P4,C4);

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

  srand(time(&t));
do
{
  fun(RC4);


} while(stop_w());

  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Nous utilisons la fonction gj_TP_mR(Ab); pour résoudre ce système.
Exemple de sortie écran :
 A:
    +758     +899       -9     +123 
    +699     -563     -334     +766 
      +4     -318     +249     -542 
    +611     +990     -322     -754 

       b1       b2      ...      bn:
    +444     -687     -699     +904 
    -255     +287     +321     +754 
    +724     -115      -52     +271 
    +274     -866     +175     +393 

 Press return to continue. 


 Copy/Paste into the octave window.

 Ab=[
+758,+899,-9,+123,+444,-687,-699,+904;
+699,-563,-334,+766,-255,+287,+321,+754;
+4,-318,+249,-542,+724,-115,-52,+271;
+611,+990,-322,-754,+274,-866,+175,+393]

 rref(Ab,.00000000001)

 gj_TP_mR(Ab):
   +1.0000    +0.0000    +0.0000    +0.0000 
   +0.0000    +1.0000    +0.0000    +0.0000 
   +0.0000    +0.0000    +1.0000    +0.0000 
   +0.0000    +0.0000    +0.0000    +1.0000 

   +0.8527    -0.4450    -0.3028    +1.3773 
   -0.1374    -0.4377    -0.4850    -0.1484 
   +1.5748    -0.2847    -1.6837    +0.9055 
   -0.5254    +0.3349    -0.3952    +0.0132 


 Press   return to continue
 Press X return to stop