Aller au contenu

Mathc complexes/c05m

Un livre de Wikilivres.


Application


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

c01m.c
/* ------------------------------------ */
/*  Save as :   c01m.c                  */
/* ------------------------------------ */

/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **U                  = r_mZ(i_mZ(r,r),9.);
double **Orth               =      i_mZ(r,r);
double **conj_Normal_Orth_T =      i_mZ(r,r);

  clrscrn();
  printf(" U :");
  p_mZ(U, S8,P2, S1,P2, C6); 

  orth_mZ(U,Orth);

  printf(" Orth :");
  p_mZ(Orth, S8,P2, S1,P2, C6);  
  stop();


  clrscrn();
  printf(" Normal_Orth :");
  Normalize_mZ(Orth);
  p_mZ(Orth, S8,P2, S1,P2, C6); 
  
  printf(" conj_Normal_Orth_T :");
  ctranspose_mZ(Orth,conj_Normal_Orth_T);
  p_mZ(conj_Normal_Orth_T, S8,P4, S1,P4, C6); 
    
  printf(" conj_Normal_Orth_T * Normal_Orth  :");
  mul_mZ(conj_Normal_Orth_T,Orth, U);
  p_mZ(U, S8,P4, S1,P4, C6);  
    
  f_mZ(U);
  f_mZ(Orth);
  f_mZ(conj_Normal_Orth_T);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));

do
{
  fun(rp_I(R2)+R2);
} while(stop_w());

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


Nous voyons la mise en place de algorithme de gram schmidt : Normalizeuv_mZ(Orth);



Exemple de sortie écran :
 U :
   -7.00-7.00i    +4.00+6.00i    +6.00-5.00i    -9.00+8.00i 
   +4.00-3.00i    -7.00+4.00i    -7.00+8.00i    +6.00-9.00i 
   +8.00-5.00i    -5.00-7.00i    +8.00+4.00i    +6.00-5.00i 
   +4.00+6.00i    -5.00-5.00i    +2.00-5.00i    +6.00+6.00i 

 Orth :
   -7.00-7.00i    +2.01-0.76i    +0.26-3.78i    +0.93+5.41i 
   +4.00-3.00i    -3.48+3.49i    -3.92+6.84i    +2.08+3.20i 
   +8.00-5.00i    +1.70-7.40i    +0.53+1.09i    +2.67-0.19i 
   +4.00+6.00i    -4.55+0.11i    +7.36-2.77i    +1.74+2.73i 

 Press return to continue. 

 Normal_Orth :
   -0.43-0.43i    +0.19-0.07i    +0.02-0.32i    +0.12+0.68i 
   +0.25-0.18i    -0.34+0.34i    -0.33+0.58i    +0.26+0.41i 
   +0.49-0.31i    +0.16-0.71i    +0.04+0.09i    +0.34-0.02i 
   +0.25+0.37i    -0.44+0.01i    +0.62-0.23i    +0.22+0.35i 

 conj_Normal_Orth_T :
   -0.43+0.43i    +0.25+0.18i    +0.49+0.31i    +0.25-0.37i 
   +0.19+0.07i    -0.34-0.34i    +0.16+0.71i    -0.44-0.01i 
   +0.02+0.32i    -0.33-0.58i    +0.04-0.09i    +0.62+0.23i 
   +0.12-0.68i    +0.26-0.41i    +0.34+0.02i    +0.22-0.35i 

 conj_Normal_Orth_T * Normal_Orth  :
   +1.00+0.00i    +0.00-0.00i    -0.00+0.00i    -0.00+0.00i 
   +0.00+0.00i    +1.00+0.00i    +0.00-0.00i    +0.00-0.00i 
   -0.00+0.00i    +0.00+0.00i    +1.00+0.00i    +0.00+0.00i 
   -0.00+0.00i    +0.00+0.00i    +0.00+0.00i    +1.00+0.00i 


 Press return to continue
 Press X      to stop