Aller au contenu

Mathc matrices/05l

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    RC6
/* ------------------------------------ */
#define    EV    R1  
/* ------------------------------------ */
int main(void)
{
double a[RCA*RCA]={
+0.567743563267, +0.304424089190, -0.059677700710, -0.203424101776, +0.267148131435, -0.190855616323, 
+0.304424089190, +0.785604057676, +0.042029055301, +0.143264950247, -0.188143702858, +0.134413376479, 
-0.059677700710, +0.042029055301, +0.991760844584, -0.028084908937, +0.036882704058, -0.026349692872, 
-0.203424101776, +0.143264950247, -0.028084908937, +0.904266630484, +0.125722520384, -0.089818517482, 
+0.267148131435, -0.188143702858, +0.036882704058, +0.125722520384, +0.834894016457, +0.117954799378, 
-0.190855616323, +0.134413376479, -0.026349692872, -0.089818517482, +0.117954799378, +0.915730887532 
};

double evalue[RCA*C1]={
+1,  
+1,
+1,
+1,
+1,
+0  
};

double **A        = ca_A_mR(a,      i_mR(RCA,RCA));
double **EValue   = ca_A_mR(evalue, i_mR(RCA,C1));

double **Ide      =  eye_mR(   i_mR(RCA,RCA));
double **sIde     =            i_mR(RCA,RCA);
double **AmnssIde =            i_mR(RCA,RCA);

double **Ab       =            i_Abr_Ac_bc_mR(RCA,RCA,C1);
double **b        =            i_mR(RCA,C1);
double **Ab_free  =            i_Abr_Ac_bc_mR(RCA,RCA,RCA);
double **b_free   =            i_mR(RCA,RCA);

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

  clrscrn();
  printf(" A :");
  p_mR(A,S10,P5,C10);
  
         smul_mR(EValue[EV][C1],Ide,sIde);          
        MmnsD_mR(A,sIde,AmnssIde);
        
     c_A_b_Ab_mR(AmnssIde,b,Ab); 
        gj_PP_mR(Ab,NO);  
// Ab : You can find the equation of the plan when the eigenvalues equal 1 (EV=R1)
    put_zeroR_mR(Ab,Ab_free);
    put_freeV_mR(Ab_free); 
        gj_PP_mR(Ab_free,YES);      
       c_Ab_b_mR(Ab_free,b_free);

          c_c_mR(b_free,C2,V,EV);  
          c_c_mR(b_free,C3,V,EV+C1);
          c_c_mR(b_free,C4,V,EV+C2);
          c_c_mR(b_free,C5,V,EV+C3);
          c_c_mR(b_free,C6,V,EV+C4);
                                                            
    Normalize_mR(V);
           
          printf(" V%d : Copy V%d into the last file",EV,EV);
          P_mR(V,S10,P12,C10); 
           
  stop();
             
  f_mR(A);
  f_mR(EValue);
  
  f_mR(Ide);
  f_mR(sIde);
  f_mR(AmnssIde);
  
  f_mR(Ab);
  f_mR(b);
  f_mR(Ab_free);    
  f_mR(b_free);
  
  f_mR(V); 
  
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Projection de l'hyperespace sur un hyperplan 
* Calculer un vecteur propre : 
* #define    EV    R1  pour calculer V1, V2, V3, V4 et V5
* #define    EV    R6  pour calculer V6


Exemple de sortie écran :

A :
  +0.56774   +0.30442   -0.05968   -0.20342   +0.26715   -0.19086 
  +0.30442   +0.78560   +0.04203   +0.14326   -0.18814   +0.13441 
  -0.05968   +0.04203   +0.99176   -0.02808   +0.03688   -0.02635 
  -0.20342   +0.14326   -0.02808   +0.90427   +0.12572   -0.08982 
  +0.26715   -0.18814   +0.03688   +0.12572   +0.83489   +0.11795 
  -0.19086   +0.13441   -0.02635   -0.08982   +0.11795   +0.91573 

 V1 : Copy V1 into the last file
+0.575801565025, -0.136763612579, -0.425812987594, +0.525729633538, -0.403913441448,       -nan, 
+0.817589479944, +0.000000000000, +0.000000000000, +0.000000000000, +0.000000000000,       -nan, 
+0.000000000000, +0.990603712023, +0.000000000000, +0.000000000000, +0.000000000000,       -nan, 
+0.000000000000, +0.000000000000, +0.904811195552, +0.000000000000, +0.000000000000,       -nan, 
+0.000000000000, +0.000000000000, +0.000000000000, +0.850651722164, +0.000000000000,       -nan, 
+0.000000000000, +0.000000000000, +0.000000000000, +0.000000000000, +0.914797208029,       -nan  

 Press return to continue.