Aller au contenu

Mathc complexes/04k

Un livre de Wikilivres.


Applications

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

c00a.c
/* ------------------------------------ */
/*  Save as:  c00a.c                    */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define    A_FACTOR_E  +1.E-1        /*    A:-350        -8267i       */
#define INVA_FACTOR_E  +1.E+2        /* invA:+5.7980e-05 +2.9547e-05i */  
/* ------------------------------------ */
#define ARRAY     A3
/* ------------------------------------ */
void fun(int r)
{
double **A         = rcsymmetric_mZ(      i_mZ(r,r),99);
double **InvA      =         inv_mZ(A,    i_mZ(r,r));

double **AEVect    =      eigs_V_mZ(A,    i_mZ(r,r),   A_FACTOR_E); 
double **InvAEVect =      eigs_V_mZ(InvA, i_mZ(r,r),INVA_FACTOR_E); 

  clrscrn();   
  printf(" A:");
  p_mZ(A, S7,P0,S6,P0,C7);

  printf(" InvA:");
  pE_mZ(InvA, S12,P4,S12,P4,C7);
  stop();
  
  clrscrn();   
  printf(" The matrix A and the matrix InvA\n"
         " have the same eigenvectors. They \n"
         " are in reverse order.       \n\n\n"

         " The eigenvectors of A being     \n"
         " an orthonormal matrix, we       \n"
         " will simply take its ctranspose  \n"
         " as inverse in the next files. \n\n"
         " EigenVector of A:");
  p_mZ(AEVect, S12,P4,S12,P4,C7);

  printf(" EigenVector of InvA:");
  p_mZ(InvAEVect, S12,P4,S12,P4,C7);
   
  f_mZ(A);
  f_mZ(InvA); 
  f_mZ(AEVect);
  f_mZ(InvAEVect);  
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));

do
{
 fun(R3);

} while(stop_w());

  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
La matrice A est son inverse on les même vecteurs propres mais rangé en ordre inverse
Exemple de sortie écran :
 A:
 +32012    +0i   +1318 -6466i  -14187 -6179i 
  +1318 +6466i  +36820    +0i  -26522 -9399i 
 -14187 +6179i  -26522 +9399i  +36899    +0i 

 InvA:
 +6.6902e-05 +9.5652e-21i  +4.5522e-05 +3.1762e-05i  +5.0352e-05 +4.5629e-05i 
 +4.5522e-05 -3.1762e-05i  +1.1115e-04 +2.2471e-20i  +1.0271e-04 +2.3723e-05i 
 +5.0352e-05 -4.5629e-05i  +1.0271e-04 -2.3723e-05i  +1.3397e-04 +2.7085e-20i 

 Press return to continue. 


 The matrix A and the matrix InvA
 have the same eigenvectors. They 
 are in reverse order.       


 The eigenvectors of A being     
 an orthonormal matrix, we       
 will simply take its ctranspose  
 as inverse in the next files. 

 EigenVector of A:
     -0.3312 -0.0250i      +0.1618 -0.8382i      +0.2875 +0.2798i 
     -0.5761 -0.2679i      -0.0264 +0.4767i      +0.5934 +0.1276i 
     +0.6971 +0.0000i      +0.2082 +0.0000i      +0.6861 +0.0000i 

 EigenVector of InvA:
     +0.2875 +0.2798i      +0.1618 -0.8382i      -0.3312 -0.0250i 
     +0.5934 +0.1276i      -0.0264 +0.4767i      -0.5761 -0.2679i 
     +0.6861 +0.0000i      +0.2082 +0.0000i      +0.6971 +0.0000i 


 Press   return to continue
 Press X return to stop