Aller au contenu

Mathc matrices/00f

Un livre de Wikilivres.


Matrices de Toeplitz

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 **U   = r_mR(            i_mR(R1, r),9);
double **V   = r_mR(            i_mR(r ,C1),9);	
double **A   = rToeplitz_mR(U,V,i_mR(r , r)  );

double **Inv =                  i_mR(r,r);
double **ID  =                  i_mR(r,r);
 
  clrscrn();
  printf(" Copy/Past into the octave window.\n\n");
  p_Octave_mR(A,"A",P0);
  printf(" inv(A)\n");
  p_mR(inv_mR(A,Inv),S5,P6,C7);;
  stop();
  
  clrscrn();
  printf(" inv(A)*A\n");  
  p_mR(mul_mR(Inv,A,ID),S5,P6,C7);
  printf(" A*inv(A)\n");  
  p_mR(mul_mR(A,Inv,ID),S5,P6,C7);

  f_mR(U);
  f_mR(V);   
  f_mR(A);
  
  f_mR(ID);
  f_mR(Inv);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
do
{
  fun(rp_I(RC5)+C2);

} while(stop_w());


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


Matrice de Toeplitz.

Exemple de sortie écran :

 Copy/Past into the octave window.

 A=[
+1,+5,-7,+8;
-2,+1,+5,-7;
+6,-2,+1,+5;
-8,+6,-2,+1]

 inv(A)

+0.142857 +0.142857 +0.000000 -0.142857 
+0.172973 +0.232432 +0.048649 +0.000000 
-0.094208 +0.078764 +0.232432 +0.142857 
-0.083398 -0.094208 +0.172973 +0.142857 

 Press return to continue. 


 inv(A)*A

+1.000000 -0.000000 -0.000000 -0.000000 
+0.000000 +1.000000 -0.000000 +0.000000 
-0.000000 +0.000000 +1.000000 -0.000000 
+0.000000 -0.000000 +0.000000 +1.000000 

 A*inv(A)

+1.000000 -0.000000 +0.000000 -0.000000 
+0.000000 +1.000000 -0.000000 +0.000000 
+0.000000 +0.000000 +1.000000 -0.000000 
-0.000000 -0.000000 +0.000000 +1.000000 


 Press   return to continue
 Press X return to stop