Aller au contenu

Mathc matrices/05e

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 C4
/* ------------------------------------ */
int main(void)
{
double a[RCA*RCA]={
+0.729876318493, +0.169778846788, -0.191923913761, -0.362625471673, 
+0.169778846788, +0.893290152659, +0.120628523081, +0.227918315245, 
-0.191923913761, +0.120628523081, +0.863637321734, -0.257646791146, 
-0.362625471673, +0.227918315245, -0.257646791146, +0.513196207114                   
};

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.729876318493,+0.169778846788,-0.191923913761,-0.362625471673;
+0.169778846788,+0.893290152659,+0.120628523081,+0.227918315245;
-0.191923913761,+0.120628523081,+0.863637321734,-0.257646791146;
-0.362625471673,+0.227918315245,-0.257646791146,+0.513196207114]

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

 EigsValue :
   +1.0000 
   +1.0000 
   +1.0000 
   +0.0000 

 Press return to continue.