Aller au contenu

Mathc complexes/a227

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
/* ------------------------------------ */
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 **B  =               i_mZ(RA-R1,CA);

  clrscrn();
  printf("Basis for a Row 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 nonzero rows vectors  of Ab without b\n"
         " form a basis for the row space of  A \n\n"
         " Ab :");
  printf(" gj_PP_mZ(Ab) :");
  p_mZ(gj_PP_mZ(Ab), S8,P4, S8,P4, C4);
     
  c_Ab_A_mZ(Ab,A);
  
  c_r_mZ(A,R1,B,R1);
  c_r_mZ(A,R2,B,R2);  
  c_r_mZ(A,R3,B,R3);
  
  printf(" B :  Is a basis for a Row Space of A by Row Reduction");
  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 lignes de A qui forment une base pour l'espace lignes de A.


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

 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. 


 ------------------------------------ 
  The nonzero rows vectors  of Ab without b
 form a basis for the row space of  A 

 Ab : gj_PP_mZ(Ab) :
 +1.0000 +0.0000i  -0.4444 +0.2222i  +0.3889 -0.2778i  -0.1667 +0.3889i 
 +0.0000 -0.0000i  +1.0000 +0.0000i  +1.1585 +1.1893i  +1.2775 -0.6818i 
 +0.0000 +0.0000i  +0.0000 +0.0000i  +1.0000 +0.0000i  -0.0452 -0.9546i 
 +0.0000 +0.0000i  +0.0000 +0.0000i  +0.0000 +0.0000i  +0.0000 +0.0000i 

 -0.3333 -0.4444i  +0.0000 +0.0000i 
 -1.1373 -1.8411i  +0.0000 -0.0000i 
 -1.2744 +1.0135i  +0.0000 +0.0000i 
 +0.0000 +0.0000i  +0.0000 +0.0000i 

 B :  Is a basis for a Row Space of A by Row Reduction
 +1.0000 +0.0000i  -0.4444 +0.2222i  +0.3889 -0.2778i  -0.1667 +0.3889i 
 +0.0000 -0.0000i  +1.0000 +0.0000i  +1.1585 +1.1893i  +1.2775 -0.6818i 
 +0.0000 +0.0000i  +0.0000 +0.0000i  +1.0000 +0.0000i  -0.0452 -0.9546i 

 -0.3333 -0.4444i 
 -1.1373 -1.8411i 
 -1.2744 +1.0135i 

 Press return to continue.