Aller au contenu

Mathc matrices/c082a

Un livre de Wikilivres.


Application


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,S5,P0,C6);
  printf(" Minor(R%d,C%d) %.4e \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",P0);
  printf(" det(Minor)\n");

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

  srand(time(&t));

do
{
  fun(rp_I(RC5)+RC1);

} while(stop_w());

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


Vérifier avec octave.



Exemple de sortie écran :
 A :
 -497  +305  -468  +992  +652 
 +818  -881  +332  +959  -974 
 +425  -881  -631   -38  -843 
 +689  +682   -46    -9  -335 
 -347  +962  +336  +673  -861 

 Minor(R1,C3) -1.6563e+12 


 Copy/Past into the octave window.

 Minor=[
+818,-881,+959,-974;
+425,-881,-38,-843;
+689,+682,-9,-335;
-347,+962,+673,-861]

 det(Minor)

 Press return to continue
 Press X      to stop