Matrices triangulaires


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

c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int rc)
{
double **A     = rlower_mR(i_mR(rc,rc),9);
double **invA  =           i_mR(rc,rc);
double **AinvA =           i_mR(rc,rc);

  clrscrn();

  printf(" A : ");
  p_mR(A,S4,P0,C6);

  printf(" invA : ");
  p_mR(inv_mR(A,invA),S4,P5,C6);

  printf(" A * invA : ");
  p_mR(mul_mR(A,invA,AinvA),S4,P5,C6);
    
  f_mR(A);
  f_mR(invA);
  f_mR(AinvA);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
  
   do 
         fun(rp_I(RC4)+RC1);
        
    while(stop_w());
        
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Exemple de sortie écran :

 A : 
  +6   +0   +0   +0   +0 
  -1   -5   +0   +0   +0 
  +7   +3   -7   +0   +0 
  +4   +5   -1   +3   +0 
  +5   +8   -1   +2   +3 

 invA : 
+0.16667 -0.00000 +0.00000 -0.00000 -0.00000 
-0.03333 -0.20000 -0.00000 +0.00000 +0.00000 
+0.15238 -0.08571 -0.14286 +0.00000 -0.00000 
-0.11587 +0.30476 -0.04762 +0.33333 -0.00000 
-0.06085 +0.30159 -0.01587 -0.22222 +0.33333 

 A * invA : 
+1.00000 +0.00000 +0.00000 +0.00000 +0.00000 
-0.00000 +1.00000 +0.00000 +0.00000 +0.00000 
-0.00000 -0.00000 +1.00000 +0.00000 +0.00000 
+0.00000 +0.00000 +0.00000 +1.00000 +0.00000 
+0.00000 +0.00000 +0.00000 +0.00000 +1.00000 


 Press   return to continue
 Press X return to stop