Mathc matrices/c11b4

Un livre de Wikilivres.
Aller à la navigation Aller à la recherche


Sommaire


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


Crystal Clear mimetype source c.png c0b4.c
'
/* ------------------------------------ */
/*  Save as :  c0b4.c               */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(void)
{
double ab[R4*C4]={
+138,-131,+744,-389,
-131,-187,+674,-799,
+744,+674,+530,+152,
-389,-799,+152,-337
};

int r = RC4;

double **A         = ca_A_mR(ab,i_mR(r,r));
double **EigsVector=               i_mR(r,r);
double **T_EigsVector=             i_mR(r,r);
double **EigsValue =               i_mR(r,C1);

double **T1=             i_mR(r,r);
double **T2=             i_mR(r,r);

  clrscrn();
  printf(" Copy/Past into the octave windows \n\n");
  p_Octave_mR(A,"a",P0);
  printf(" [V, E] = eigs (a,10) \n\n");
  stop();

  clrscrn();   
  eigs_V_uv_mR(A,EigsVector); 
  printf(" EigsVector:");
  p_mR(EigsVector,S10,P4,C6);

  printf(" EigsValue : T_EigsVector * A * EigsVector");   
  transpose_mR(EigsVector,T_EigsVector);   
  mul_mR(T_EigsVector,A,T1);
  mul_mR(T1,EigsVector,T2);
  p_mR(T2,S10,P4,C6);  
   
  eigs_value_uv_mR(A,EigsValue);
  printf(" EigsValue :");
  p_mR(EigsValue,S10,P4,C1);   
  stop();
   
  f_mR(A);
  
  f_mR(EigsVector);
  f_mR(T_EigsVector);
  
  f_mR(EigsValue);  
     
  f_mR(T1);
  f_mR(T2);
}
/* ------------------------------------ */
int main(void)
{

  fun();

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


Déclaration des fichiers h.



Exemple de sortie écran :
/* ------------------------------------ */
 Copy/Past into the octave windows 

 a=[
+138,-131,+744,-389;
-131,-187,+674,-799;
+744,+674,+530,+152;
-389,-799,+152,-337]

 [V, E] = eigs (a,10) 

 Press return to continue. 


/* ------------------------------------ */
 EignVector:
   +0.3672    +0.4862    +0.3690    +0.7018 
   +0.6032    +0.4067    -0.6331    -0.2645 
   -0.3826    +0.7355    +0.3040    -0.4693 
   +0.5957    -0.2392    +0.6088    -0.4661 

 EigsValue : T_EignVector * A * EignVector
-1483.3940    -0.0000    +0.0000    +0.0000 
   -0.0000 +1345.1366    -0.0000    -0.0000 
   +0.0000    -0.0000  +333.9953    -0.0000 
   +0.0000    -0.0000    -0.0000   -51.7379 

 EigsValue :
-1483.3940 
+1345.1366 
 +333.9953 
  -51.7379 

 Press return to continue.