Étude du code


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


c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */     
#define RCA          RC3  
/* ------------------------------------ */       
/* ------------------------------------ */
void fun(void)
{                          
double a[RCA*RCA] ={   
 +80,  +28,  -78, 
 +28,   +5,  -38, 
 -78,  -38,  +94  
};
                       
double **A      =   ca_A_mR(a, i_mR(RCA,RCA));
double **V      = eigs_V_mR(A, i_mR(RCA,RCA));
double **invV   =    inv_mR(V, i_mR(RCA,RCA));
double **EValue =   eigs_mR(A, i_mR(RCA, RCA));

double **T      =              i_mR(RCA,RCA);

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

  printf(" V :");
  p_mR(V, S9,P5, C4); 
 
  printf(" EValue = invV * A * V");
  mul_mR(invV,A,T);
  mul_mR(T,V,EValue);
  pE_mR(clean_eye_mR(EValue), S12,P4, C3); 
         
  printf(" A = V * EValue * invV");
  mul_mR(V,EValue,T);
  mul_mR(T,invV,A); 
  p_mR(A, S8,P0, C3);
  stop();
              
  f_mR(A);
  f_mR(V);  
  f_mR(invV);  
  f_mR(T);  
  f_mR(EValue);
}
/* ------------------------------------ */
int main(void)
{
    fun();
    
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Exemple de référence


Exemple de sortie écran :
 A :
     +80      +28      -78 
     +28       +5      -38 
     -78      -38      +94 

 V :
 -0.64550  +0.76339  +0.02384 
 -0.26197  -0.25062  +0.93196 
 +0.71743  +0.59533  +0.36177 

 EValue = invV * A * V
 +1.7806e+02  +0.0000e+00  +0.0000e+00 
 +0.0000e+00  +9.9787e+00  +0.0000e+00 
 +0.0000e+00  +0.0000e+00  -9.0344e+00 

 A = V * EValue * invV
     +80      +28      -78 
     +28       +5      -38 
     -78      -38      +94 

 Press return to continue.