Aller au contenu

Mathc matrices/00d

Un livre de Wikilivres.


Matrice de Hankel

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

c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **Uh  = r_mR(            i_mR(R1, r),9);
double **Vh  = r_mR(            i_mR(r ,C1),9);	
double **B   = rHankel_mR(Uh,Vh,i_mR(r , r)  );

double **B_T   = transpose_mR(B,i_mR(r,r));

double **S = i_mR(r,C1);
double **U = i_mR(r,r);
double **V = i_mR(r,r);


  clrscrn();  
  printf(" Copy/Past into the octave windows \n\n\n");
  p_Octave_mR(B,"B",P2);
  printf(" [U, S, V] =svd (B,10)\n\n\n");
  stop();

  clrscrn(); 
  
  svd_U_Rn_mR(B_T,U);    
  svd_V_Rn_mR(B_T,V); 
  svds_mR(B,S);
  
  printf(" U :");
  p_mR(U,S5,P5,C10);   
    
  printf(" S :");
  p_mR(S,S5,P5,C10);
   
  printf(" V:");
  p_mR(V,S5,P5,C10);  

  f_mR(Uh);
  f_mR(Vh);     
  f_mR(B_T);
  f_mR(B);
  
  f_mR(S); 
  f_mR(U);
  f_mR(V); 
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));

do
{  
  fun(rp_I(R4)+R2);

} while(stop_w());

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


Matrice de Hankel.

Exemple de sortie écran :

 Copy/Past into the octave windows 


 B=[
-1.00,+4.00,-3.00,+1.00,+4.00;
+4.00,-3.00,+1.00,+4.00,+9.00;
-3.00,+1.00,+4.00,+9.00,-5.00;
+1.00,+4.00,+9.00,-5.00,+1.00;
+4.00,+9.00,-5.00,+1.00,+8.00]

 [U, S, V] =svd (B,10)


 Press return to continue. 


 U :
+0.32610 -0.11547 +0.04530 -0.27587 +0.89564 
+0.39462 -0.23157 +0.36122 +0.81045 +0.05783 
-0.37382 -0.49509 +0.73033 -0.28129 -0.05131 
-0.03171 +0.82852 +0.55171 -0.00017 +0.09041 
+0.77278 -0.03851 +0.17235 -0.43352 -0.42858 

 S :
+16.66135 
+11.68196 
+9.92732 
+9.52370 
+2.38301 

 V:
+0.32610 -0.11547 +0.04530 -0.27587 +0.89564 
+0.39462 -0.23157 +0.36122 +0.81045 +0.05783 
-0.37382 -0.49509 +0.73033 -0.28129 -0.05131 
-0.03171 +0.82852 +0.55171 -0.00017 +0.09041 
+0.77278 -0.03851 +0.17235 -0.43352 -0.42858 


 Press   return to continue
 Press X return to stop