Aller au contenu

Mathc matrices/050

Un livre de Wikilivres.


Application

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

c00a.c
/* ------------------------------------ */
/*  Save as :  c00a.c                   */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define   RCA C3
/* ------------------------------------ */
int main(void)
{
double a[RCA*RCA]={
+0.554945054945, -0.049450549451, -0.494505494505, 
-0.049450549451, +0.994505494505, -0.054945054945, 
-0.494505494505, -0.054945054945, +0.450549450549   
};

double **A         = ca_A_mR(a,i_mR(RCA,RCA));
double **EigsValue =           i_mR(RCA,C1);

  clrscrn();
  printf(" Copy/Past into the octave windows \n\n");
  p_Octave_mR(A,"a",P12);
  printf(" [V, E] = eigs (a,%d) \n\n",RCA);
   
  eigs_mR(A,EigsValue);
  printf(" EigsValue :");
  p_mR(EigsValue,S10,P6,C1);
     
  stop();
   
  f_mR(A);
  f_mR(EigsValue);  
     
    return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Vérifier avec Octave. 


Exemple de sortie écran :

 Copy/Past into the octave windows 

 a=[
+0.554945054945,-0.049450549451,-0.494505494505;
-0.049450549451,+0.994505494505,-0.054945054945;
-0.494505494505,-0.054945054945,+0.450549450549]

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

 EigsValue :
 +1.000000 
 +1.000000 
 +0.000000 

 Press return to continue.