Aller au contenu

Mathc matrices/a158

Un livre de Wikilivres.



Fonctions matricielles ex : cos(A)


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


c02a.c
/* ------------------------------------ */
/*  Save as :   c02a.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define RCA      RC3
/* ------------------------------------ */
/* ------------------------------------ */
int main(void)
{
double a[RCA*RCA]={+1.7568,+0.3975,-0.1827,
                   +0.3975,+1.0008,-0.8822,
                   -0.1827,-0.8822,+1.3684};
                  	
double **A          = ca_A_mR(a,i_mR(RCA,RCA));
double **EValue     =           i_mR(RCA,RCA); 

double **Log_EValue =           i_mR(RCA,RCA);
double **LogA       =           i_mR(RCA,RCA);  

double **V          =           i_mR(RCA,RCA);
double **V_T        =           i_mR(RCA,RCA);

double **T          =           i_mR(RCA,RCA);

   clrscrn();     
   printf(" Copy/Past into the octave window.       \n\n");
   p_Octave_mR(A,"A", P4);
   printf(" logm (A)\n\n\n");
    
      eigs_V_mR(A,V);
   transpose_mR(V,V_T);
    
/* EValue = V_T * A * V        */   
   mul_mR(V_T,A,T);
   mul_mR(T,V,EValue);  

   printf(" LogA :");
   f_eigs_mR(log,EValue, Log_EValue);   
      mul_mR(V,Log_EValue,T);
      mul_mR(T,V_T,LogA); 
        p_mR(LogA, S9,P6, C6);
   
   stop();
       
   f_mR(A);
   f_mR(EValue);   
       
   f_mR(Log_EValue);
   f_mR(LogA); 
      
   f_mR(V);
   f_mR(V_T);

   f_mR(T);

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


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

 A=[
+1.7568,+0.3975,-0.1827;
+0.3975,+1.0008,-0.8822;
-0.1827,-0.8822,+1.3684]

 logm (A)


 LogA :
+0.522273 +0.327138 -0.005340 
+0.327138 -0.543481 -0.990866 
-0.005340 -0.990866 -0.065258 

 Press return to continue.