Mathc matrices/c15d


Sommaire


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


Crystal Clear mimetype source c.png gj_r_a.c
'
/* ------------------------------------ */
/*  Save as :   gj_r_a.c                 */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
int main(void)
{
double ab[R4*C5]={
    +964,     -689,     +474,     +948,     -159, 
    +640,     -693,     -937,     +656,     +718, 
    -981,     -337,     -287,     +420,     +812, 
    -807,     -123,     +404,     -177,     -105 
};

/*                       i_Abr_Ac_bc_mR(R_Ab,C_A,C_b));  */

double **Ab = ca_A_mR(ab,i_Abr_Ac_bc_mR(R4,C4,C1));
double **A  = c_Ab_A_mR(Ab,i_mR(R4,C4));
double **b  = c_Ab_b_mR(Ab,i_mR(R4,C1));

  clrscrn();
  printf(" A :");
  p_mR(A,S8,P0,C7);
  printf(" b :");
  p_mR(b,S8,P0,C7);
  printf(" Ab :");
  p_mR(Ab,S8,P0,C7);
  getchar();

  clrscrn();
  printf(" Copy/Past into the octave window.\n\n");
  p_Octave_mR(Ab,"Ab",P0);
  printf("\n rref(Ab,.00000000001)\n\n");
  printf("  gj_TP_mR(Ab) :");
  gj_TP_mR(Ab);
  p_mR(Ab,S10,P5,C7);
  stop();

  f_mR(Ab);
  f_mR(b);
  f_mR(A);
  
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Nous utilisons la fonction gj_TP_mR(Ab); pour inverser une matrice.


Exemple de sortie écran :
 A :
    +964     -689     +474     +948 
    +640     -693     -937     +656 
    -981     -337     -287     +420 
    -807     -123     +404     -177 

 b :
    -159 
    +718 
    +812 
    -105 

 Ab :
    +964     -689     +474     +948     -159 
    +640     -693     -937     +656     +718 
    -981     -337     -287     +420     +812 
    -807     -123     +404     -177     -105 


 Copy/Past into the octave window.

 Ab=[
+964,-689,+474,+948,-159;
+640,-693,-937,+656,+718;
-981,-337,-287,+420,+812;
-807,-123,+404,-177,-105]


 rref(Ab,.00000000001)

  gj_TP_mR(Ab) :
  +1.00000   +0.00000   +0.00000   +0.00000   -0.39164 
  -0.00000   +1.00000   -0.00000   -0.00000   +0.18464 
  +0.00000   +0.00000   +1.00000   +0.00000   -0.67774 
  +0.00000   +0.00000   +0.00000   +1.00000   +0.70359 

 Press return to continue.