Aller au contenu

Mathc complexes/a241

Un livre de Wikilivres.


Application


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


c04a.c
/* ------------------------------------ */
/*  Save as :   c04a.c                  */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
#define   RCQ RC4
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double **u      =   r_mZ(i_mZ(RCQ,C1) ,9.);

double **Q      = r_Q_mZ(i_mZ(RCQ,RCQ), 9);
double **Qu     =        i_mZ(RCQ,C1);

  clrscrn();
    
  printf(" Q :             an orthogonal matrix ");
  p_mZ(Q,S3,P5,S3,P5,C6);
  
  printf(" u :");
  p_mZ(u,S3,P5,S3,P5,C6);


  printf(" ||Q*u||     = ||u|| \n\n ");
  printf("   %.3f   = %.3f           \n\n ",
  
  norm_Z(mul_mZ(Q,u,Qu)),  norm_Z(u));
   
  f_mZ(u); 
  f_mZ(Qu);
  f_mZ(Q);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));

do
{
  fun();

} while(stop_w());

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


Exemple de sortie écran :
 ------------------------------------ 
 Q :             an orthogonal matrix 
+0.15451-0.46352i +0.34487-0.67644i -0.30467+0.24194i -0.13193+0.12651i 
+0.30902+0.41202i +0.16313+0.05615i +0.24580+0.68424i +0.12457+0.40107i 
+0.46352-0.15451i -0.43120+0.16485i -0.53987+0.08064i +0.50013-0.00814i 
+0.20601+0.46352i -0.14467-0.39961i -0.02026+0.14717i -0.09821-0.72827i 

 u :
+7.00000-2.00000i 
-5.00000+5.00000i 
+4.00000+3.00000i 
-7.00000+3.00000i 

 ||Q*u||     = ||u|| 

    13.638   = 13.638           

 
 Press   return to continue
 Press X return to stop