Aller au contenu

Mathc complexes/a231

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     R4
#define   CA     C5
#define   Cb     C1
/* ------------------------------------ */
#define   CB     C1          /* B : a basis for the column space of A */
/* ------------------------------------ */
void fun(void)
{
double ab[RA*((CA+Cb)*C2)] ={
 -3*1,-1*1,  +8*1,-3*1,  +2*1,+8*1,  +8*1,+6*1,  +7*1,+8*1,  0,0, 
 -3*2,-1*2,  +8*2,-3*2,  +2*2,+8*2,  +8*2,+6*2,  +7*2,+8*2,  0,0,  
 -3*7,-1*7,  +8*7,-3*7,  +2*7,+8*7,  +8*7,+6*7,  +7*7,+8*7,  0,0, 
 -3*3,-1*3,  +8*3,-3*3,  +2*3,+8*3,  +8*3,+6*3,  +7*3,+8*3,  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 **B   =                         i_mZ(RA,CB) ;

  clrscrn();
  printf("Basis for a Column Space by Row Reduction :\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(" The leading 1’s of Ab give the position \n"
         " of the columns  of A which form a basis \n"
         " for the column space of A \n\n"
         " A :");
  p_mZ(A, S7,P3, S7,P3, C5);
  printf(" gj_PP_mZ(Ab) :");
  p_mZ(gj_PP_mZ(Ab), S7,P3, S7,P3, C5);
  
  c_c_mZ(A,C1,B,C1);

  printf(" B :");
  p_mZ(B, S8,P4, S8,P4, C4);
  stop();    
  
  f_mZ(Ab);
  f_mZ(A);
  f_mZ(b);
  f_mZ(B);
}
/* ------------------------------------ */
int main(void)
{

  fun();

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


La position des pivots de Ab donne la position des colonnes de A qui forment une base pour l'espace colonnes de A.


Exemple de sortie écran :
Basis for a Column Space by Row Reduction :

 A :
 -3 -1i  +8 -3i  +2 +8i  +8 +6i  +7 +8i 
 -6 -2i +16 -6i  +4+16i +16+12i +14+16i 
-21 -7i +56-21i +14+56i +56+42i +49+56i 
 -9 -3i +24 -9i  +6+24i +24+18i +21+24i 

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

 Ab :
 -3 -1i  +8 -3i  +2 +8i  +8 +6i  +7 +8i  +0 +0i 
 -6 -2i +16 -6i  +4+16i +16+12i +14+16i  +0 +0i 
-21 -7i +56-21i +14+56i +56+42i +49+56i  +0 +0i 
 -9 -3i +24 -9i  +6+24i +24+18i +21+24i  +0 +0i 

 Press return to continue. 


 The leading 1s of Ab give the position 
 of the columns  of A which form a basis 
 for the column space of A 

 A :
 -3.000 -1.000i  +8.000 -3.000i  +2.000 +8.000i  +8.000 +6.000i  +7.000 +8.000i 
 -6.000 -2.000i +16.000 -6.000i  +4.000+16.000i +16.000+12.000i +14.000+16.000i 
-21.000 -7.000i +56.000-21.000i +14.000+56.000i +56.000+42.000i +49.000+56.000i 
 -9.000 -3.000i +24.000 -9.000i  +6.000+24.000i +24.000+18.000i +21.000+24.000i 

 gj_PP_mZ(Ab) :
 +1.000 -0.000i  -2.100 +1.700i  -1.400 -2.200i  -3.000 -1.000i  -2.900 -1.700i 
 +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 
 +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 

 B :
 -3.0000 -1.0000i 
 -6.0000 -2.0000i 
-21.0000 -7.0000i 
 -9.0000 -3.0000i 

 Press return to continue.