Aller au contenu

Mathc complexes/a221

Un livre de Wikilivres.


Application


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


c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "w_a.h"  
/* ------------------------------------ */
/* ------------------------------------ */
#define   RA     R3
#define   CA     C4
#define   Cb     C1
/* ------------------------------------ */
#define   RAFree R4
#define   CbFree C2
/* ------------------------------------ */
void fun(void)
{
double ab[RA*((CA+Cb)*C2)] ={
	                    1,2,  3,4,  5,6,  5,2, 0,0,
                        1,2,  3,4,  5,6,  1,3, 0,0,
                        1,2,  3,4,  1,1,  4,2, 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), S8,P4, S8,P4, C4); 
    
  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, S8,P4, S8,P4, C4);
  stop(); 
 
  clrscrn(); 
  printf(" gj_mZ(Ab) :");
  p_mZ(gj_mZ(Ab_New), S8,P4, S8,P4, C4);  

  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, S8,P4, S8,P4, C4); 
  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 :
 +1 +2i  +3 +4i  +5 +6i  +5 +2i 
 +1 +2i  +3 +4i  +5 +6i  +1 +3i 
 +1 +2i  +3 +4i  +1 +1i  +4 +2i 

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

 Ab :
 +1 +2i  +3 +4i  +5 +6i  +5 +2i  +0 +0i 
 +1 +2i  +3 +4i  +5 +6i  +1 +3i  +0 +0i 
 +1 +2i  +3 +4i  +1 +1i  +4 +2i  +0 +0i 

 Press return to continue. 


 ------------------------------------ 
 gj_PP_mZ(Ab) :
 +1.0000 +0.0000i  +2.2000 -0.4000i  +3.4000 -0.8000i  +1.8000 -1.6000i 
 -0.0000 +0.0000i  +0.0000 -0.0000i  +1.0000 +0.0000i  +0.0976 -0.1220i 
 +0.0000 -0.0000i  +0.0000 +0.0000i  -0.0000 +0.0000i  +1.0000 +0.0000i 

 +0.0000 +0.0000i 
 -0.0000 +0.0000i 
 +0.0000 -0.0000i 

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

 Ab_New :
 +1.0000 +0.0000i  +2.2000 -0.4000i  +3.4000 -0.8000i  +1.8000 -1.6000i 
 +0.0000 +0.0000i  +1.0000 +0.0000i  +0.0000 +0.0000i  +0.0000 +0.0000i 
 -0.0000 +0.0000i  +0.0000 -0.0000i  +1.0000 +0.0000i  +0.0976 -0.1220i 
 +0.0000 -0.0000i  +0.0000 +0.0000i  -0.0000 +0.0000i  +1.0000 +0.0000i 

 +0.0000 +0.0000i  +0.0000 +0.0000i 
 +0.0000 +0.0000i  +1.0000 +0.0000i 
 -0.0000 +0.0000i  +0.0000 +0.0000i 
 +0.0000 -0.0000i  +0.0000 +0.0000i 

 Press return to continue. 


 ------------------------------------ 
 gj_mZ(Ab) :
 +1.0000 +0.0000i  -0.0000 +0.0000i  +0.0000 +0.0000i  -0.0000 +0.0000i 
 +0.0000 +0.0000i  +1.0000 +0.0000i  +0.0000 +0.0000i  +0.0000 +0.0000i 
 +0.0000 +0.0000i  +0.0000 +0.0000i  +1.0000 +0.0000i  +0.0000 +0.0000i 
 +0.0000 +0.0000i  +0.0000 +0.0000i  +0.0000 -0.0000i  +1.0000 +0.0000i 

 -0.0000 +0.0000i  -2.2000 +0.4000i 
 +0.0000 +0.0000i  +1.0000 +0.0000i 
 +0.0000 +0.0000i  +0.0000 +0.0000i 
 +0.0000 +0.0000i  -0.0000 -0.0000i 

 new_b : Free variables
 -0.0000 +0.0000i  -2.2000 +0.4000i 
 +0.0000 +0.0000i  +1.0000 +0.0000i 
 +0.0000 +0.0000i  +0.0000 +0.0000i 
 +0.0000 +0.0000i  -0.0000 -0.0000i 

 Press return to continue. 


 ------------------------------------ 
 A :
 +1.0000 +2.0000i  +3.0000 +4.0000i  +5.0000 +6.0000i  +5.0000 +2.0000i 
 +1.0000 +2.0000i  +3.0000 +4.0000i  +5.0000 +6.0000i  +1.0000 +3.0000i 
 +1.0000 +2.0000i  +3.0000 +4.0000i  +1.0000 +1.0000i  +4.0000 +2.0000i 

 b_Free :
 -0.0000 +0.0000i  -2.2000 +0.4000i 
 +0.0000 +0.0000i  +1.0000 +0.0000i 
 +0.0000 +0.0000i  +0.0000 +0.0000i 
 +0.0000 +0.0000i  -0.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 

 Press return to continue.