Mathc matrices/c17c

Un livre de Wikilivres.
Aller à la navigation Aller à la recherche


Sommaire


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


Crystal Clear mimetype source c.png gj_r3.c
/* ------------------------------------ */
/*  Save as :   gj_r3.c                 */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */   
/* ------------------------------------ */
void fun(int r, int c)
{
double **A  = i_mR(r,c);
double **b  = i_mR(r,C1);
double **Ab = i_Abr_Ac_bc_mR(r,c,C1);
           
double **new_Ab = i_Abr_Ac_bc_mR(csize_A_R(Ab), 
                                 csize_A_R(Ab),
                                 csize_R(A)-rsize_R(A) + C1);           

  r_mR(A,999.);
  r_mR(b,999.);
  
  clrscrn();
  printf(" A :");
  p_mR(A,S8,P0,C7);
  
  printf(" b :");
  p_mR(b,S8,P0,C7);
  
  printf(" Ab :");
  c_A_b_Ab_mR(A,b,Ab);
  p_mR(Ab,S8,P0,C7);
  stop();

  clrscrn();
  GJ_TP_mR(Ab);
  printf(" Ab :");
  p_mR(Ab,S10,P5,C7);
  stop();  
  
  clrscrn();
  GJ_TPfreeV_mR(Ab,new_Ab); 
  printf(" new_Ab :"); 
  p_mR(new_Ab,S10,P5,C7);
  
  f_mR(new_Ab);  
  f_mR(Ab);
  f_mR(b);
  f_mR(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
do
{
  fun(rp_I(R3)+R1, rp_I(R3)+R4);


} while(stop_w());

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


Nous utilisons la fonction GJ_TP_mR(Ab); pour résoudre ce système.


Exemple de sortie écran :
 ------------------------------------ 

 A :
    +568     +728     +934      +82     -435     -143 
     +38     -427     +686     -823     -239     -895 

 b :
     -23 
    +292 

 Ab :
    +568     +728     +934      +82     -435     -143      -23 
     +38     -427     +686     -823     -239     -895     +292 

 Press return to continue. 



 Ab :
  +1.00000   +0.00000   +3.32430   -2.08782   -1.33137   -2.63738   +0.75039 
  +0.00000   +1.00000   -1.31072   +1.74160   +0.44124   +1.86131   -0.61706 

 Press return to continue. 



 new_Ab :
  +1.00000   +0.00000   +0.00000   +0.00000   +0.00000   +0.00000   +0.75039 
  +0.00000   +1.00000   +0.00000   +0.00000   +0.00000   +0.00000   -0.61706 
  +0.00000   +0.00000   +1.00000   +0.00000   +0.00000   +0.00000   +0.00000 
  +0.00000   +0.00000   +0.00000   +1.00000   +0.00000   +0.00000   +0.00000 
  +0.00000   +0.00000   +0.00000   +0.00000   +1.00000   +0.00000   +0.00000 
  +0.00000   +0.00000   +0.00000   +0.00000   +0.00000   +1.00000   +0.00000 

  -3.32430   +2.08782   +1.33137   +2.63738 
  +1.31072   -1.74160   -0.44124   -1.86131 
  +1.00000   +0.00000   +0.00000   +0.00000 
  +0.00000   +1.00000   +0.00000   +0.00000 
  +0.00000   +0.00000   +1.00000   +0.00000 
  +0.00000   +0.00000   +0.00000   +1.00000 


 Press return to continue
 Press X      to stop