< Mathc matrices


Sommaire


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


gj2_rsing.c
'
/* ------------------------------------ */
/*  Save as :   gj2_rsing.c                 */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
/*                             i_AbR0_mR(R_Ab,C_A,C_b));  */
double **Ab = r_singular_Ab_mR(i_AbR0_mR(   r,  r, C1),999);
double **A  = c_Ab_A_mR(Ab,i_mR(r,r));
double **b  = c_Ab_b_mR(Ab,i_mR(r,C1));

  clrscrn();
  printf(" A :");
  p_mR(A,8,0,7);
  printf(" b :");
  p_mR(b,8,0,7); /* I do not change the value of b */
  printf(" Ab :");
  p_mR(Ab,8,0,7);
  getchar();

  clrscrn();
  printf(" Copy/Past into the octave window.\n\n");
  p_octave_mR(Ab,"Ab",1,0);
  printf("\n rref(Ab,.00000000001)\n\n");
  printf(" gj_mR(Ab) :");
  p_mR(gj_mR(Ab),10,5,7);

  f_mR(Ab);
  f_mR(b);
  f_mR(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
do
{
  fun(rp_I(5)+1);


} while(stop_w());

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


La matrice A de deux lignes avec lignes identiques.



Exemple de sortie écran :
 ------------------------------------
 A :
    +412     -221 
    +412     -221 

 b :
    +478 
    +478 

 Ab :
    +412     -221     +478 
    +412     -221     +478 


 ------------------------------------
 Copy/Past into the octave window.

 Ab=[
+412,-221,+478;
+412,-221,+478]


 rref(Ab,.00000000001)

 gj_mR(Ab) : The system has only an equation !!


+412.00000 -221.00000 +478.00000 
  +0.00000   +0.00000   +0.00000 


 Press return to continue
 Press X      to stop
Cet article est issu de Wikibooks. Le texte est sous licence Creative Commons - Attribution - Partage dans les Mêmes. Des conditions supplémentaires peuvent s'appliquer aux fichiers multimédias.