Aller au contenu

Mathc matrices/051

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.390117647059, +0.169411764706, +0.457411764706, 
+0.169411764706, +0.952941176471, -0.127058823529, 
+0.457411764706, -0.127058823529, +0.656941176471 
};

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,P4,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.390117647059,+0.169411764706,+0.457411764706;
+0.169411764706,+0.952941176471,-0.127058823529;
+0.457411764706,-0.127058823529,+0.656941176471]

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

 EigsValue :
   +1.0000 
   +1.0000 
   +0.0000 

 Press return to continue.