Aller au contenu

Mathc complexes/a38

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(int r)
{
double ab[RA*((CA+Cb)*C2)] ={
	                    1,2,  3,4,  5,6,  5,2, 1,2,
                        1,2,  3,4,  5,6,  1,3, 3,4,
                        1,2,  3,4,  1,1,  4,2, 5,6};
                          

double **Ab = ca_A_mZ(ab,i_Abr_Ac_bc_mZ(RA,CA,Cb));
double **Ab_Free =       i_Abr_Ac_bc_mZ(RAFree,C4,CbFree) ;
double **b_Free  =       i_mZ(RAFree,CbFree);

  clrscrn();
  printf(" Ab :");
  p_mZ(Ab, S8,P2, S8,P2, C4);    
 
  printf(" gj_PP_mZ(Ab) :");
  p_mZ(gj_PP_mZ(Ab), S8,P4, S8,P4, C4); 
  stop(); 
  
  clrscrn();     
  put_zeroR_mZ(Ab,Ab_Free); 
  put_freeV_mZ(Ab_Free);
  printf(" put_zero_row_mZ(Ab,Ab_Free);\n"
         " put_freeV_mZ(Ab_Free);\n\n"
         " Ab_Free :");
  p_mZ(Ab_Free, S8,P4, S8,P4, C4);
  stop(); 
  
  clrscrn();  
  printf(" Copy/Past into the octave window.\n\n");
  p_Octave_mZ(Ab_Free,"Ab_Free",P10, P10);
  printf(" rref(Ab_Free,.00000000001)\n\n");
  stop(); 
  
  clrscrn(); 
  printf(" gj_mZ(Ab) :");
  p_mZ(gj_mZ(Ab_Free), S8,P4, S8,P4, C4);  
  stop(); 
  
  clrscrn(); 
  printf(" new_b : Free variables");  
  p_mZ(c_Ab_b_mZ(Ab_Free,b_Free), S8,P4, S8,P4, C4);  
  stop();
  
  f_mZ(Ab);
  f_mZ(Ab_Free);
  f_mZ(b_Free);
}
/* ------------------------------------ */
int main(void)
{

  fun(R5);

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



Exemple de sortie écran :
 ------------------------------------ 
 Ab :
   +1.00   +2.00i    +3.00   +4.00i    +5.00   +6.00i    +5.00   +2.00i 
   +1.00   +2.00i    +3.00   +4.00i    +5.00   +6.00i    +1.00   +3.00i 
   +1.00   +2.00i    +3.00   +4.00i    +1.00   +1.00i    +4.00   +2.00i 

   +1.00   +2.00i 
   +3.00   +4.00i 
   +5.00   +6.00i 

 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 

 +1.0000 +0.0000i 
 -0.8780 +0.0976i 
 -0.3529 -0.5882i 

 Press return to continue. 


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

 Ab_free :
 +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 

 +1.0000 +0.0000i  +0.0000 +0.0000i 
 +0.0000 +0.0000i  +1.0000 +0.0000i 
 -0.8780 +0.0976i  +0.0000 +0.0000i 
 -0.3529 -0.5882i  +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 

 +5.1113 -0.5039i  -2.2000 +0.4000i 
 +0.0000 +0.0000i  +1.0000 +0.0000i 
 -0.7719 +0.1119i  +0.0000 +0.0000i 
 -0.3529 -0.5882i  -0.0000 -0.0000i 

 Press return to continue. 


 ------------------------------------ 
 new_b : free variables
 +5.1113 -0.5039i  -2.2000 +0.4000i 
 +0.0000 +0.0000i  +1.0000 +0.0000i 
 -0.7719 +0.1119i  +0.0000 +0.0000i 
 -0.3529 -0.5882i  -0.0000 -0.0000i 

 Press return to continue.