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_mZ(i_mZ(r,r),999.);
double **b  = i_mZ(r,r);
double **Ab = i_Abr_Ac_bc_mZ(   r,  r,  r);
/*            i_Abr_Ac_bc_mZ(R_Ab,C_A,C_b));  */
double **invA = i_mZ(r,r);

  clrscrn();
  printf(" A :");
  p_mZ(A, S6,P0, S5,P0, C4);

  printf("   b : ID :");
  eye_mZ(b);
  p_mZ(b, S6,P0, S5,P0, C4);
  stop();
  
  clrscrn();  
  printf(" Ab :");
  c_A_b_Ab_mZ(A,b,Ab);
  p_mZ(Ab, S6,P0, S5,P0, C4);
  printf("  gj_TP_mZ(Ab) :");  
  gj_mZ(Ab);
  p_mZ(Ab, S8,P4, S8,P4, C4);
  stop();
  
  clrscrn(); 
  printf(" Copy/Past into the octave window.\n");
  p_Octave_mZ(A,"A",P0,P0);
  printf("format short e\n");
  printf(" inv(A)\n\n");

  printf(" invA :                      c_Inv_A_mZ(Ab,invA);");  
  c_Inv_A_mZ(Ab,invA);
//  c_Ab_b_mZ(Ab,invA);
  pE_mZ(invA, S10,P4, S10,P4, C3);
  
  f_mZ(invA);
  f_mZ(Ab);
  f_mZ(b);
  f_mZ(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
do
{
  fun(R4);


} while(stop_w());

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


Copier la matrice inverse du système Ab dans la matrice invA :


Exemple de sortie écran :

 ----------------------------------
 A :
  +697 -663i   +385 -746i   -213 +968i   -885 +608i 
  -229 -266i    +22  +94i    +29 -785i   -934 -227i 
  +384 -871i   +637 +784i   -816 -798i   +475 -300i 
  +244 +745i   -650 -171i   -880  -23i    -58 +164i 

   b : ID :
    +1   +0i     +0   +0i     +0   +0i     +0   +0i 
    +0   +0i     +1   +0i     +0   +0i     +0   +0i 
    +0   +0i     +0   +0i     +1   +0i     +0   +0i 
    +0   +0i     +0   +0i     +0   +0i     +1   +0i 

 Press return to continue. 


 ----------------------------------
 Ab :
  +697 -663i   +385 -746i   -213 +968i   -885 +608i 
  -229 -266i    +22  +94i    +29 -785i   -934 -227i 
  +384 -871i   +637 +784i   -816 -798i   +475 -300i 
  +244 +745i   -650 -171i   -880  -23i    -58 +164i 

    +1   +0i     +0   +0i     +0   +0i     +0   +0i 
    +0   +0i     +1   +0i     +0   +0i     +0   +0i 
    +0   +0i     +0   +0i     +1   +0i     +0   +0i 
    +0   +0i     +0   +0i     +0   +0i     +1   +0i 

  gj_TP_mZ(Ab) :
 +1.0000 +0.0000i  +0.0000 +0.0000i  -0.0000 +0.0000i  +0.0000 +0.0000i 
 -0.0000 -0.0000i  +1.0000 -0.0000i  -0.0000 +0.0000i  -0.0000 +0.0000i 
 +0.0000 +0.0000i  -0.0000 -0.0000i  +1.0000 -0.0000i  +0.0000 +0.0000i 
 +0.0000 -0.0000i  -0.0000 +0.0000i  +0.0000 +0.0000i  +1.0000 +0.0000i 

 +0.0005 +0.0002i  -0.0003 +0.0004i  +0.0002 +0.0004i  +0.0002 +0.0002i 
 +0.0001 +0.0005i  -0.0005 -0.0004i  -0.0000 +0.0001i  -0.0009 +0.0004i 
 -0.0000 +0.0001i  -0.0001 +0.0001i  -0.0003 +0.0003i  -0.0006 +0.0001i 
 -0.0001 -0.0001i  -0.0007 +0.0002i  +0.0003 +0.0000i  +0.0001 +0.0003i 

 Press return to continue. 


 ----------------------------------
 Copy/Past into the octave window.
 A=[
+697-663*i,+385-746*i,-213+968*i,-885+608*i;
-229-266*i,+22+94*i,+29-785*i,-934-227*i;
+384-871*i,+637+784*i,-816-798*i,+475-300*i;
+244+745*i,-650-171*i,-880-23*i,-58+164*i]

format short e
 inv(A)

 invA :                      c_Inv_A_mZ(Ab,invA);
+4.7003e-04+2.1135e-04i -2.9930e-04+3.5515e-04i +1.9455e-04+4.3014e-04i 
+1.1285e-04+5.0449e-04i -5.2150e-04-4.0555e-04i -3.6558e-06+9.2722e-05i 
-7.9562e-07+5.4058e-05i -5.6900e-05+9.7203e-05i -3.0870e-04+2.7735e-04i 
-9.1274e-05-1.3791e-04i -7.4673e-04+1.6845e-04i +2.9780e-04+3.6630e-05i 

+1.7466e-04+1.6472e-04i 
-8.6345e-04+3.9377e-04i 
-5.7102e-04+7.7681e-05i 
+6.4338e-05+2.9895e-04i 


 Press return to continue
 Press X      to stop