Aller au contenu

Mathc complexes/c082a

Un livre de Wikilivres.


Application


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


minor_z.c
/* ------------------------------------ */
/*  Save as :   minor_z.c               */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A     = r_mZ(i_mZ(r,r),9.);
double **Minor = i_mZ(r-C1,r-C1);

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

  clrscrn();
  printf(" A :");
  p_mZ(A, S5,P0, S4,P0, C6);
  printf(" Minor(R%d,C%d) \n\n",
          minor_r,
          minor_c);

  minor_c = minor_c*C2-C1;
  /* col*C2 : a number has two columns */
  /* -C1 : The real part of the number */

  p_Z(minor_Z(A,minor_r, minor_c), S1,P0, S0,P0);printf("\n\n");

  minor_mZ(A, Minor, minor_r, minor_c);
  printf(" Copy/Past into the octave window.\n\n");
  p_Octave_mZ(Minor,"Minor",P0 ,C0);
  printf(" det(Minor)\n");

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

  srand(time(&t));
do
{
  r=rp_I(RC4)+RC2;

  fun(r);

} while(stop_w());

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


Vérifier avec octave.



Exemple de sortie écran :
 A :
   +6   +6i    -5   -7i    +4   -1i    -7   +6i 
   -5   +2i    +8   +4i    +4   +8i    -5   +6i 
   +6   -5i    -5   +8i    -3   -5i    +6   -5i 
   +4   -9i    -9   -7i    +8   -7i    -7   +2i 

 Minor(R3,C3) 

-687-1915i 

 Copy/Past into the octave window.

 Minor=[
+6+6*i,-5-7*i,-7+6*i;
-5+2*i,+8+4*i,-5+6*i;
+4-9*i,-9-7*i,-7+2*i]

 det(Minor)

 Press return to continue
 Press X      to stop