Aller au contenu

Mathc complexes/a252

Un livre de Wikilivres.


Application


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


c04c.c
/* ------------------------------------ */
/*  Save as :   c04c.c                  */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define    RA R2
#define    CA C4
#define CFREE C2+C1  // C1 -> b
/* ------------------------------------ */
int main(void)
{
double a_Tb[RA*((CA+C1)*C2)]={
 -2,+3, +1,+0, +0,-1, 3,-5, +0,+0,
 -4,+2, -3,+5, -6,+4,-1,+0, +0,+0 
};

double **A_Tb = ca_A_mZ(a_Tb,i_Abr_Ac_bc_mZ(RA,CA,C1));
double **A_T  = c_Ab_A_mZ(A_Tb,i_mZ(RA,CA));
double **b    = c_Ab_b_mZ(A_Tb,i_mZ(RA,C1));

double **A_Tb_free = i_Abr_Ac_bc_mZ(csize_A_Z(A_Tb),csize_A_Z(A_Tb),CFREE);

double **B  = i_mZ(rsize_Z(A_Tb_free),csize_b_Z(A_Tb_free)); 

  clrscrn();
  printf("Find a basis for the orthogonal complement of A :\n\n");
  printf(" A_T :");
  p_mZ(A_T,S5,P1,S5,P1,C10);
  printf(" b :");
  p_mZ(b,S5,P1,S5,P1,C10);
  printf(" A_Tb :");
  p_mZ(A_Tb,S5,P1,S5,P1,C10);
  stop();

  clrscrn();
  printf(" A_Tb :  gj_PP_mZ(A_Tb) :");
  gj_PP_mZ(A_Tb);
  p_mZ(A_Tb,S7,P3,S7,P3,C10);
  
  put_zeroR_mZ(A_Tb,A_Tb_free);  
  put_freeV_mZ(A_Tb_free);
    
  clrscrn();          
  printf(" A_Tb_free :");  
  p_mZ(gj_mZ(A_Tb_free),S7,P3,S7,P3,C4);  
  
  printf(" B is a basis for the orthogonal complement of A :"); 
  P_mZ(c_Ab_b_mZ(A_Tb_free,B),S10,P12,S10,P12,C2);
  stop();	
  
  f_mZ(A_Tb);
  f_mZ(A_Tb_free);
  f_mZ(B);
  f_mZ(b);
  f_mZ(A_T);
  
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Trouver une projection sur un sous-espace vectoriel par une application linéaire :


  • B est une base pour le complément orthogonal de A. Trouver une matrice V qui projette un vecteur x sur R4.
          Proj(x) =  V * x
                V =  Id - (B * inv(BT*B) * BT)  .
                
  • Dans cet exemple nous calculons B. Nous l'utiliserons dans le prochain exemple.


Exemple de sortie écran :
 ------------------------------------ 
Find a basis for the orthogonal complement of A :

 A_T :
 -2.0 +3.0i  +1.0 +0.0i  +0.0 -1.0i  +3.0 -5.0i 
 -4.0 +2.0i  -3.0 +5.0i  -6.0 +4.0i  -1.0 +0.0i 

 b :
 +0.0 +0.0i 
 +0.0 +0.0i 

 A_Tb :
 -2.0 +3.0i  +1.0 +0.0i  +0.0 -1.0i  +3.0 -5.0i  +0.0 +0.0i 
 -4.0 +2.0i  -3.0 +5.0i  -6.0 +4.0i  -1.0 +0.0i  +0.0 +0.0i 

 Press return to continue. 


 ------------------------------------ 
 A_Tb :  gj_PP_mZ(A_Tb) :
 +1.000 +0.000i  +1.100 -0.700i  +1.600 -0.200i  +0.200 +0.100i  +0.000 -0.000i 
 +0.000 +0.000i  +1.000 -0.000i  +1.373 +0.232i  +1.264 +0.491i  +0.000 +0.000i 


 ------------------------------------ 
 A_Tb_free :
 +1.000 +0.000i  -0.000 -0.000i  -0.000 +0.000i  -0.000 +0.000i 
 +0.000 +0.000i  +1.000 +0.000i  +0.000 +0.000i  +0.000 +0.000i 
 +0.000 +0.000i  -0.000 -0.000i  +1.000 -0.000i  +0.000 +0.000i 
 +0.000 +0.000i  +0.000 +0.000i  +0.000 +0.000i  +1.000 +0.000i 

 +0.000 +0.000i  +0.073 -0.506i  +1.534 -0.444i 
 +0.000 -0.000i  -1.373 -0.232i  -1.264 -0.491i 
 +0.000 +0.000i  +1.000 +0.000i  -0.000 +0.000i 
 +0.000 +0.000i  -0.000 -0.000i  +1.000 -0.000i 

 B is a basis for the orthogonal complement of A :
+0.000000000000,+0.000000000000, +0.072961373391,-0.506437768240, 
+0.000000000000,-0.000000000000, -1.373390557940,-0.231759656652, 
+0.000000000000,+0.000000000000, +1.000000000000,+0.000000000000, 
+0.000000000000,+0.000000000000, -0.000000000000,-0.000000000000  

+1.534334763948,-0.444206008584, 
-1.263948497854,-0.491416309013, 
-0.000000000000,+0.000000000000, 
+1.000000000000,-0.000000000000  

 Press return to continue.