Mathc matrices/c11b5

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 c0b5.c
'
/* ------------------------------------ */
/*  Save as :  c0b5.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 **EignVector=               i_mR(r,r);
double **T_EignVector=             i_mR(r,r);
double **EigsValue =               i_mR(r,C1);

double **T1=             i_mR(r,r);
double **T2=             i_mR(r,r);

  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();   
  eign_Vector_uv_mR(A,EignVector); 
  printf(" EignVector:");
  p_mR(EignVector,S10,P4,C6);

  printf(" EigsValue : T_EignVector * A * EignVector");   
  transpose_mR(EignVector,T_EignVector);   
  mul_mR(T_EignVector,A,T1);
  mul_mR(T1,EignVector,T2);
  p_mR(T2,S10,P4,C6);  
   
  eign_value_uv_mR(A,EigsValue);
  printf(" EigsValue :");
  p_mR(EigsValue,S10,P4,C1);   
  stop();
   
  f_mR(A);
  
  f_mR(EignVector);
  f_mR(T_EignVector);
  
  f_mR(EigsValue);  
     
  f_mR(T1);
  f_mR(T2);
}
/* ------------------------------------ */
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.4138    +0.3678    +0.5465    +0.4602    +0.4279 
   -0.4741    -0.4105    -0.4091    -0.2001    +0.6320 
   +0.3554    -0.5590    +0.6597    -0.2507    +0.2512 
   +0.3512    -0.3819    -0.2473    +0.8106    +0.1119 
   +0.5953    +0.4877    -0.1939    -0.1680    +0.5847 

 EigsValue : T_EignVector * A * EignVector
-1929.2277    -0.0000    -0.0000    +0.0000    -0.0000 
   -0.0000 +1528.2377    -0.0000    +0.0000    -0.0000 
   -0.0000    -0.0000  +657.3656    +0.0000    -0.0000 
   +0.0000    +0.0000    +0.0000  -542.1013    +0.0000 
   -0.0000    -0.0000    -0.0000    -0.0000  -158.2743 

 EigsValue :
-1929.2277 
+1528.2377 
 +657.3656 
 -542.1013 
 -158.2743 

 Press return to continue.