Aller au contenu

Mathc complexes/a223

Un livre de Wikilivres.


Application


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


c00b.c
/* ------------------------------------ */
/*  Save as :   c00b.c                  */
/* ------------------------------------ */
#include "w_a.h"  
/* ------------------------------------ */
/* ------------------------------------ */
#define   RA     R4
#define   CA     C5
#define   Cb     C1
/* ------------------------------------ */
#define   RAFree R5
#define   CbFree C3
/* ------------------------------------ */
void fun(void)
{
double ab[RA*((CA+Cb)*C2)] ={
   +2,    -1,    -6,  +2,    -7,  -6,    -6,  +6,    +7,  +8,    0,0, 
   +9,    -9,    -2,  +6,    +1,  -6,    +2,  +5,    -7,  -1,    0,0, 
   +2*3,-1*3,  -6*3,+2*3,  -7*3,-6*3,  -6*3,+6*3,  +7*3,+8*3,    0,0,
   -1,    -3,    +3,  +7,    +8,  +7,    +6,  -7,    -9,  +7,    0,0  
};
                          

double **Ab = ca_A_mZ(ab,i_Abr_Ac_bc_mZ(RA,CA,Cb));
double **A  = c_Ab_A_mZ(Ab,i_mZ(RA,CA));
double **b  = c_Ab_b_mZ(Ab,i_mZ(RA,Cb));

double **Ab_New = i_Abr_Ac_bc_mZ(RAFree,CA,CbFree) ;
double **b_Free = i_mZ(RAFree,CbFree);
double **AbFree = i_mZ(RA,CbFree);

  clrscrn();
  printf("Find a basis for the orthogonal complement of A :\n\n");
  printf(" A :");
  p_mZ(A, S3,P0, S3,P0, C8);
  printf(" b :");
  p_mZ(b, S3,P0, S3,P0, C8);
  printf(" Ab :");
  p_mZ(Ab, S3,P0, S3,P0, C8);
  stop();

  clrscrn(); 
  printf(" gj_PP_mZ(Ab) :");
  p_mZ(gj_PP_mZ(Ab), S7,P3, S7,P3, C5);  
  stop();

  clrscrn();     
  put_zeroR_mZ(Ab,Ab_New); 
  put_freeV_mZ(Ab_New);
  printf(" put_zero_row_mZ(Ab,Ab_New);\n"
         " put_freeV_mZ(Ab_New);\n\n"
         " Ab_New :");
  p_mZ(Ab_New, S7,P3, S7,P3, C5); 
  stop(); 
 
  clrscrn(); 
  printf(" gj_mZ(Ab) :");
  p_mZ(gj_mZ(Ab_New), S7,P3, S7,P3, C5);  

  printf(" new_b : Free variables");  
  p_mZ(c_Ab_b_mZ(Ab_New,b_Free), S8,P4, S8,P4, C4);  
  stop();

  clrscrn();
  printf(" A :");
  p_mZ(A, S3,P0, S3,P0, C8);
  printf(" b_Free :"); 
  p_mZ(b_Free, S8,P4, S8,P4, C4); 
  printf(" A * b_Free :"); 
  p_mZ(mul_mZ(A,b_Free,AbFree), S8,P4, S8,P4, C4); 
  stop();
  
  f_mZ(Ab);
  f_mZ(A);
  f_mZ(b);
  f_mZ(Ab_New);
  f_mZ(b_Free);
  f_mZ(AbFree);  
}
/* ------------------------------------ */
int main(void)
{

  fun();

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


On commence par calculer les variables libres.

Les colonnes de b_free sont une base pour le complément orthogonal de A.

         A * b_free = 0

Cela prouve que les vecteurs lignes de A sont orthogonaux aux vecteurs colonnes de b_free.


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

 A :
 +2 -1i  -6 +2i  -7 -6i  -6 +6i  +7 +8i 
 +9 -9i  -2 +6i  +1 -6i  +2 +5i  -7 -1i 
 +6 -3i -18 +6i -21-18i -18+18i +21+24i 
 -1 -3i  +3 +7i  +8 +7i  +6 -7i  -9 +7i 

 b :
 +0 +0i 
 +0 +0i 
 +0 +0i 
 +0 +0i 

 Ab :
 +2 -1i  -6 +2i  -7 -6i  -6 +6i  +7 +8i  +0 +0i 
 +9 -9i  -2 +6i  +1 -6i  +2 +5i  -7 -1i  +0 +0i 
 +6 -3i -18 +6i -21-18i -18+18i +21+24i  +0 +0i 
 -1 -3i  +3 +7i  +8 +7i  +6 -7i  -9 +7i  +0 +0i 

 Press return to continue. 


 ------------------------------------ 
 gj_PP_mZ(Ab) :
 +1.000 +0.000i  -0.444 +0.222i  +0.389 -0.278i  -0.167 +0.389i  -0.333 -0.444i 
 +0.000 -0.000i  +1.000 +0.000i  +1.158 +1.189i  +1.277 -0.682i  -1.137 -1.841i 
 +0.000 +0.000i  +0.000 +0.000i  +1.000 +0.000i  -0.045 -0.955i  -1.274 +1.014i 
 +0.000 +0.000i  +0.000 +0.000i  +0.000 +0.000i  +0.000 +0.000i  +0.000 +0.000i 

 +0.000 +0.000i 
 +0.000 -0.000i 
 +0.000 +0.000i 
 +0.000 +0.000i 

 Press return to continue. 


 ------------------------------------ 
 put_zero_row_mZ(Ab,Ab_New);
 put_freeV_mZ(Ab_New);

 Ab_New :
 +1.000 +0.000i  -0.444 +0.222i  +0.389 -0.278i  -0.167 +0.389i  -0.333 -0.444i 
 +0.000 -0.000i  +1.000 +0.000i  +1.158 +1.189i  +1.277 -0.682i  -1.137 -1.841i 
 +0.000 +0.000i  +0.000 +0.000i  +1.000 +0.000i  -0.045 -0.955i  -1.274 +1.014i 
 +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  +0.000 +0.000i  +1.000 +0.000i 

 +0.000 +0.000i  +0.000 +0.000i  +0.000 +0.000i 
 +0.000 -0.000i  +0.000 +0.000i  +0.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  +1.000 +0.000i 

 Press return to continue. 


 ------------------------------------ 
 gj_mZ(Ab) :
 +1.000 +0.000i  +0.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  +0.000 +0.000i  +1.000 +0.000i  +0.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  +0.000 +0.000i  +1.000 +0.000i 

 +0.000 +0.000i  -0.309 -0.917i  -0.234 +2.202i 
 -0.000 +0.000i  -0.195 -0.478i  -1.544 +1.500i 
 +0.000 +0.000i  +0.045 +0.955i  +1.274 -1.014i 
 +0.000 +0.000i  +1.000 +0.000i  +0.000 +0.000i 
 +0.000 +0.000i  +0.000 +0.000i  +1.000 +0.000i 

 new_b : Free variables
 +0.0000 +0.0000i  -0.3088 -0.9167i  -0.2339 +2.2023i 
 -0.0000 +0.0000i  -0.1947 -0.4779i  -1.5444 +1.4996i 
 +0.0000 +0.0000i  +0.0452 +0.9546i  +1.2744 -1.0135i 
 +0.0000 +0.0000i  +1.0000 +0.0000i  +0.0000 +0.0000i 
 +0.0000 +0.0000i  +0.0000 +0.0000i  +1.0000 +0.0000i 

 Press return to continue. 


 ------------------------------------ 
 A :
 +2 -1i  -6 +2i  -7 -6i  -6 +6i  +7 +8i 
 +9 -9i  -2 +6i  +1 -6i  +2 +5i  -7 -1i 
 +6 -3i -18 +6i -21-18i -18+18i +21+24i 
 -1 -3i  +3 +7i  +8 +7i  +6 -7i  -9 +7i 

 b_Free :
 +0.0000 +0.0000i  -0.3088 -0.9167i  -0.2339 +2.2023i 
 -0.0000 +0.0000i  -0.1947 -0.4779i  -1.5444 +1.4996i 
 +0.0000 +0.0000i  +0.0452 +0.9546i  +1.2744 -1.0135i 
 +0.0000 +0.0000i  +1.0000 +0.0000i  +0.0000 +0.0000i 
 +0.0000 +0.0000i  +0.0000 +0.0000i  +1.0000 +0.0000i 

 A * b_Free :
 +0.0000 +0.0000i  +0.0000 +0.0000i  +0.0000 +0.0000i 
 +0.0000 +0.0000i  +0.0000 +0.0000i  -0.0000 +0.0000i 
 +0.0000 +0.0000i  +0.0000 +0.0000i  +0.0000 +0.0000i 
 +0.0000 +0.0000i  +0.0000 +0.0000i  -0.0000 -0.0000i 

 Press return to continue.