Mathc matrices/c11a5

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 c0a5.c
'
/* ------------------------------------ */
/*  Save as :  c0a5.c               */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(void)
{
double ab[R5*C5]={
-71,-749,+252,-233,+682,
-749,-151,+446,+704,+214,
+252,+446,+476,+84,-955,
-233,+704,+84,-333,-593,
+682,+214,-955,-593,-365
};

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

  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,S5,P6,C6);
   
  eigs_value_uv_mR(A,EigsValue);
  printf(" EigsValue :");
  p_mR(EigsValue,S13,P6,C1);   
  stop();
     
  f_mR(A);
  f_mR(EigsVector);
  f_mR(EigsValue);
}
/* ------------------------------------ */
int main(void)
{

  fun();

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


Déclaration des fichiers h.



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

 a=[
-71,-749,+252,-233,+682;
-749,-151,+446,+704,+214;
+252,+446,+476,+84,-955;
-233,+704,+84,-333,-593;
+682,+214,-955,-593,-365]

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

 Press return to continue. 


/* ------------------------------------ */
 EignVector:
-0.413755 +0.367788 +0.546493 +0.460165 +0.427940 
-0.474083 -0.410486 -0.409077 -0.200072 +0.631961 
+0.355379 -0.559031 +0.659732 -0.250726 +0.251159 
+0.351165 -0.381920 -0.247315 +0.810636 +0.111910 
+0.595350 +0.487704 -0.193884 -0.168001 +0.584712 

 EigsValue :
 -1929.227703 
 +1528.237677 
  +657.365585 
  -542.101300 
  -158.274261 

 Press return to continue.