Application


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


c00a.c
/* ------------------------------------ */
/*  Save as :  c00a.c                   */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
#define   RA R4
#define   CA C4

#define   RX R4
#define   CX C1
/* ------------------------------------ */
/* ------------------------------------ */
int main(void)
{
double a[RA*CA]={
    +3, -4, -2, -1,
    +5, -3, -0, -2,      
    +6, -0, -3, -2,
    +3, -3, -1, -3   
};

double x_B[RX*CX]={
   +1,
   +2, 
   +3, 
   +4 
};

double b[RA*CA]={
    +1, +2, +6, +6,   
    +3, +2, +1, +6,
    +5, +5, +3, +6,
    +5, +5, +2, +4, 
};

double **A   = ca_A_mR(a, i_mR(RA,CA));
double **B   = ca_A_mR(b, i_mR(RA,CA));
double **D     =          i_mR(RA,CA) ;

double **X_B = ca_A_mR(x_B,  i_mR(RX,CX));
double **X_S = mul_mR(B,X_B, i_mR(RX,CX));
double **T   =               i_mR(RA,CX) ;

double **invB  =  inv_mR(B, i_mR(RA,CA));
double **invBA =            i_mR(RA,CA) ;

double **DX_B  =            i_mR(RA,CX) ;

/* D = invB*A*B        */
  mul_mR(invB,A,invBA);       
  mul_mR(invBA,B,D);
/* [T(x)]_B = D*x_B    */ 
  mul_mR(D,X_B,DX_B);   
  
  clrscrn();
  printf(" In the Standard basis the linear application is :\n\n");
  printf(" T(x_S) = A x_S");
  p_mR(mul_mR(A,X_S,T),S8,P2,C7);
  printf("with\n\n"
         "x_S");
  p_mR(X_S,S8,P2,C7);  
  printf("A");
  p_mR(A,S8,P2,C7);  

  stop();
  
  clrscrn();
  printf(" In the B basis the linear application is :\n\n"
         " [T(x_B)]_B = D*x_B           with  D = (invB A B)");
  p_mR(DX_B,S8,P2,C7);
  printf("with\n\n"
         "x_B");
  p_mR(X_B,S8,P2,C7);  
  printf("D = (invB A B)");
  p_mR(D,S8,P2,C7);     
 
  stop();
    
  clrscrn(); 
  printf(" [T(x_B)]_B = D*x_B           with  D = (invB A B)");
  p_mR(DX_B,S8,P2,C7); 
        
  printf(" Remark : x_S = B x_B\n\n"
         "   [D*x_B]\n"
         " B [D*x_B] = B [(InvB A B) x_B] = (A B)*x_B = A (B x_B) = A x_S \n\n"
         " B*[D*x_B] = A x_S");
  p_mR(mul_mR(B,DX_B,T),S8,P2,C7);  
  
  printf(" T(x_S) = A x_S");
  p_mR(mul_mR(A,X_S,T),S8,P2,C7);
  stop();
  
  f_mR(A);
  f_mR(B);
  f_mR(D);  
  
  f_mR(X_B);
  f_mR(X_S);
  f_mR(T);  
  
  f_mR(invB);  
  f_mR(invBA);  

  f_mR(DX_B);
    
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
 Vérifions si les résultats sont compatibles
Exemple de sortie écran :
 In the Standard basis the linear application is :

 T(x_S) = A x_S
 -128.00 
  +59.00 
  +64.00 
 -120.00 

with

x_S
  +47.00 
  +34.00 
  +48.00 
  +37.00 

A
   +3.00    -4.00    -2.00    -1.00 
   +5.00    -3.00    +0.00    -2.00 
   +6.00    +0.00    -3.00    -2.00 
   +3.00    -3.00    -1.00    -3.00 

 Press return to continue. 


 In the B basis the linear application is :

 [T(x_B)]_B = D*x_B           with  D = (invB A B)
-1863.00 
+1765.40 
 -782.60 
 +483.30 

with

x_B
   +1.00 
   +2.00 
   +3.00 
   +4.00 

D = (invB A B)
 -115.00   -89.00  -118.00  -304.00 
 +107.00   +82.20  +112.40  +289.20 
  -48.00   -37.80   -50.60  -126.80 
  +27.50   +22.40   +33.80   +77.40 

 Press return to continue. 


 [T(x_B)]_B = D*x_B           with  D = (invB A B)
-1863.00 
+1765.40 
 -782.60 
 +483.30 

 Remark : x_S = B x_B

   [D*x_B]
 B [D*x_B] = B [(InvB A B) x_B] = (A B)*x_B = A (B x_B) = A x_S 

 B*[D*x_B] = A x_S
 -128.00 
  +59.00 
  +64.00 
 -120.00 

 T(x_S) = A x_S
 -128.00 
  +59.00 
  +64.00 
 -120.00 

 Press return to continue.