Mathc matrices/c11a6

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 c0a6.c
'
/* ------------------------------------ */
/*  Save as :  c0a6.c               */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(void)
{
double ab[R6*C6]={
+754,+750,-983,-721,-737,+394,
+750,+886,+930,+794,-809,-245,
-983,+930,+990,-747,-37,-647,
-721,+794,-747,+886,-301,+682,
-737,-809,-37,-301,-491,+816,
+394,-245,-647,+682,+816,-33
};

int r = RC6;
	
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=[
+754,+750,-983,-721,-737,+394;
+750,+886,+930,+794,-809,-245;
-983,+930,+990,-747,-37,-647;
-721,+794,-747,+886,-301,+682;
-737,-809,-37,-301,-491,+816;
+394,-245,-647,+682,+816,-33]

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

 Press return to continue. 


/* ------------------------------------ */
 EignVector:
-0.163144 +0.543015 +0.502518 -0.595327 -0.179276 +0.198597 
+0.450410 +0.625142 -0.260061 +0.157853 +0.503174 +0.246159 
+0.734274 -0.224151 +0.285391 +0.087444 -0.436039 +0.362455 
-0.197201 +0.354287 +0.442389 +0.759714 -0.198853 -0.152241 
-0.189115 -0.365626 +0.474909 +0.099127 +0.601636 +0.482931 
-0.395858 +0.069903 -0.420892 +0.161340 -0.350767 +0.715676 

 EigsValue :
 +2337.831875 
 +2099.754994 
 -1853.643692 
 +1635.548257 
 -1297.433671 
   +69.942236 

 Press return to continue.