Aller au contenu

Mathc matrices/043

Un livre de Wikilivres.


Étude du code


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


c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define   RCA R4
/* ------------------------------------ */
int main(void)
{
double a[RCA*RCA]={
+5.701637292731, +0.991969965586, +0.254041088748, +1.125039107310, 
+0.991969965586, +6.402440296173, +0.359161539264, +1.590572531025, 
+0.254041088748, +0.359161539264, +5.091980394202, +0.407341745750, 
+1.125039107310, +1.590572531025, +0.407341745750, +6.803942016894    
};

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

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

  f_mR(A);
  
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Vérifier avec octave


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

 a=[
+5.701637293,+0.991969966,+0.254041089,+1.125039107;
+0.991969966,+6.402440296,+0.359161539,+1.590572531;
+0.254041089,+0.359161539,+5.091980394,+0.407341746;
+1.125039107,+1.590572531,+0.407341746,+6.803942017]

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

 Press return to continue.