Aller au contenu

Mathc matrices/a152

Un livre de Wikilivres.


Adjoint


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


c00c.c
/* ------------------------------------ */
/*  Save as :   c00c.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A        =       r_mR(   i_mR(r,r),9.);
double **Aadjoint = adjoint_mR(A, i_mR(r,r)   );

  clrscrn();
  printf(" A :");
  p_mR(A,S3,P0,C6);
  
  printf(" adjoint(A) :");
  p_mR(Aadjoint,S6,P0,C6);

  printf(" det(adjoint(A)) = %+.0f\n",     det_R(Aadjoint)       );
  printf(" det(A)**(r-R1)  = %+.0f\n", pow(det_R(A),     (r-R1)));

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

  srand(time(&t));
do
{
  fun(rp_I(RC4)+C1);

} while(stop_w());

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


det(adjoint(A)) = det(A)**(r-R1)


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

 adjoint(A) :
   +84   +578   +638   +182 
  +378   -451   -181   +383 
  -240    -32   +544   +352 
   -72   +252   +948   -156 

 det(adjoint(A)) = +143219847168
 det(A)**(r-R1)  = +143219847168

 Press   return to continue
 Press X return to stop