Application

Installer et compiler ce fichier dans votre répertoire de travail.

c00a.c
/* ------------------------------------ */
/*  Save as :  c00a.c                   */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define  TAB  R4 
#define  RCA  R3  
/* ------------------------------------ */
void fun(void)
{
double **A[TAB];
double **P[TAB];
double **InvP[TAB];

double **T = i_mZ(RCA,RCA);
double **EigsValue = i_mZ(RCA,C1);

int c;

  for(c=C0; c<TAB; c++)
     {   
         A[c] = i_mZ(RCA,RCA); 
         P[c] = r_mZ(i_mZ(RCA,RCA),999); 
      InvP[c] = inv_mZ(P[c],i_mZ(RCA,RCA));       
	   } 

  rcsymmetric_mZ(A[0],99);
  
    for(c=C0; c<(TAB-C1); c++)
     {   
        mul_mZ(InvP[c],A[c],T); 
        mul_mZ(T,P[c],A[c+C1]);
	   } 

  clrscrn();
  for(c=C0; c<TAB; c++)
     {
	  printf(" A[%d] : ",c); 
      p_mZ(A[c],S10,P2,S10,P2,C6);
      
	  printf(" EigsValue  of A[%d] : ",c); 
	  eigs_mZ(A[c],EigsValue); 
      p_mZ(EigsValue,S10,P2,S10,P2,C6); 
      stop();
     } 

  for(c=C0; c<TAB; c++)
     { 
	   f_mZ(A[c]);
	   f_mZ(P[c]);		 
	   f_mZ(InvP[c]); 
	   }
	   
  f_mZ(T);       
  f_mZ(EigsValue); 
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
  
  do{
        fun();
        
  }while(stop_w());

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


Je crée une suite de quatre Matrices semblables.


Exemple de sortie écran :

 -------------------------------------------
 A[0] : 
 +17139.00     +0.00i   +1867.00 +13527.00i  -16643.00 +11508.00i 
  +1867.00 -13527.00i  +28677.00     +0.00i   +5587.00 +20009.00i 
 -16643.00 -11508.00i   +5587.00 -20009.00i  +33600.00     +0.00i 

 EigsValue  of A[0] : 
 +64408.43     +0.00i 
 +11916.46     +0.00i 
  +3091.11     -0.00i 

 Press return to continue. 
 A[1] : 
 +24508.76  +2906.78i  -10534.98  +3329.95i  +17343.17 +16342.17i 
 -30867.39 +32326.89i   +8591.66 -16314.14i  -55451.62  +8423.38i 
 +27279.76 -13435.65i   -1868.04  +5513.88i  +46315.58 +13407.36i 

 EigsValue  of A[1] : 
 +64408.43     +0.00i 
 +11916.46     -0.00i 
  +3091.11     +0.00i 

 Press return to continue. 
 A[2] : 
 +60795.43 -13669.72i  -15764.62 +93761.16i  +72696.92 -34594.11i 
 -27092.85  +9334.11i   +9292.38 -57741.36i  -34511.09 +27713.20i 
  -4013.45 +51543.34i  -68375.30 -40505.73i   +9328.18 +71411.08i 

 EigsValue  of A[2] : 
 +64408.43     -0.00i 
 +11916.46     +0.00i 
  +3091.11     -0.00i 

 Press return to continue. 
 A[3] : 
  -9821.90+107437.42i  -42096.60 -72140.20i  -19330.10 +86328.73i 
-137094.92 -48534.24i +111238.92 -33699.38i -108420.45 -49133.11i 
 -45164.87 -86853.96i  +67874.74 +29482.86i  -22001.02 -73738.04i 

 EigsValue  of A[3] : 
 +64408.43     +0.00i 
 +11916.46     +0.00i 
  +3091.11     -0.00i 

 Press return to continue. 

 Press   return to continue
 Press X return to stop