< Mathc matrices


Sommaire


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


minor_r.c
'
/* ------------------------------------ */
/*  Save as :   minor_r.c                 */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A     = r_mR(i_mR(r,r),999.);
double **Minor = i_mR(r-C1,r-C1);

int minor_r = rp_I(r);
int minor_c = rp_I(r);

  clrscrn();
  printf(" A :");
  p_mR(A,5,0,6);
  printf(" Minor(%d,%d) %.3f \n\n\n",
          minor_r,
          minor_c,
          minor_R(A,minor_r, minor_c));

  printf(" Copy/Past into the octave window.\n\n");
  p_octave_mR(minor_mR(A, Minor, minor_r, minor_c),"Minor",1,0);
  printf(" det(Minor)\n");

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

  srand(time(&t));

do
{
  fun(rp_I(5)+R1);

} while(stop_w());

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


Vérifier avec octave.



Exemple de sortie écran :
 A :
 +428  -921  +510  -573  -829   +30 
 -247   +84  -107  +544  -455   +40 
 +314  +250  -469   -17  -721   +70 
 +740  -511  +312  +338  -617    +8 
 +170  +484  +332  -613  +668  -677 
 -525   +96  -317   +36  +668  +864 

 Minor(5,3) -444126763009043.938 


 Copy/Past into the octave window.

 Minor=[
+428,-921,-573,-829,+30;
-247,+84,+544,-455,+40;
+314,+250,-17,-721,+70;
+740,-511,+338,-617,+8;
-525,+96,+36,+668,+864]

 det(Minor)

 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.