Aller au contenu

Mathc complexes/01k

Un livre de Wikilivres.

Application

Installer et compiler ce fichier dans votre répertoire de travail.

c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A     = r_skew_hermitian_mZ(       i_mZ(r,r), 9);
double **invA  =              inv_mZ(A,     i_mZ(r,r));
double **AinvA =              mul_mZ(A,invA,i_mZ(r,r));

  clrscrn();
  printf(" A : Skew-Hermitian matrix");  
  p_mZ(A, S8,P3, S6,P3, C5); 
     
  printf(" inv(A) : Skew-Hermitian matrix ");
  p_mZ(invA, S8,P3, S6,P3, C5); 

  printf(" A * invA : ");
  p_mZ(AinvA, S8,P3, S6,P3, C5); 
   
  f_mZ(A);
  f_mZ(invA);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));

do
{
  fun(rp_I(R2)*R2);

} while(stop_w());

  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


L'inverse d'une matrice anti-hermitienne est une matrice anti-hermitienne.


Exemple de sortie écran :

 A : Skew-Hermitian matrix
  +0.000-10.000i   -1.000-14.000i   -4.000-6.000i   +8.000-10.000i 
  +1.000-14.000i   +0.000-2.000i   -8.000-4.000i   -8.000+4.000i 
  +4.000-6.000i   +8.000-4.000i   +0.000+10.000i  +13.000+1.000i 
  -8.000-10.000i   +8.000+4.000i  -13.000+1.000i   +0.000-4.000i 

 inv(A) : Skew-Hermitian matrix 
  +0.000-0.022i   +0.011+0.047i   +0.039+0.029i   -0.025+0.003i 
  -0.011+0.047i   -0.000+0.021i   -0.015-0.010i   +0.041-0.030i 
  -0.039+0.029i   +0.015-0.010i   +0.000-0.064i   -0.016+0.010i 
  +0.025+0.003i   -0.041-0.030i   +0.016+0.010i   -0.000+0.031i 

 A * invA : 
  +1.000-0.000i   +0.000+0.000i   +0.000+0.000i   -0.000-0.000i 
  +0.000-0.000i   +1.000+0.000i   +0.000+0.000i   +0.000-0.000i 
  -0.000+0.000i   +0.000+0.000i   +1.000+0.000i   +0.000-0.000i 
  -0.000-0.000i   -0.000+0.000i   +0.000+0.000i   +1.000-0.000i 


 Press   return to continue
 Press X return to stop