Aller au contenu

Mathc complexes/01t

Un livre de Wikilivres.

Application

Installer et compiler ce fichier dans votre répertoire de travail.

c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = rdefinite_positive_mZ( i_mZ(r,r), 99);

  clrscrn();
  printf(" Copy/Past into the octave windows \n\n");
  p_Octave_mZ(A,"a",P9,P9);
  printf(" [U] = chol (a,\"upper\")\n\n"
         " inva = chol2inv(U)\n\n"
         " a*inva\n\n"
         " inva*a\n\n");

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

  srand(time(&t));

do
{
 fun(R4);

} while(stop_w());

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


Factorisation de Cholesky : inva = chol2inv(U)


Exemple de sortie écran :

 Copy/Past into the octave windows 

 a=[
+68.711083845+0.000000000*i,-12.610426050-11.715641216*i,+2.006481201-7.724316319*i,-16.404698969-4.080269629*i;
-12.610426050+11.715641216*i,+66.617724581-0.000000000*i,-5.985206921-5.952607506*i,-17.103261005+8.036718968*i;
+2.006481201+7.724316319*i,-5.985206921+5.952607506*i,+77.796439478+0.000000000*i,+0.909580923+9.591366801*i;
-16.404698969+4.080269629*i,-17.103261005-8.036718968*i,+0.909580923-9.591366801*i,+56.874752096+0.000000000*i]

 [U] = chol (a,"upper")

 inva = chol2inv(U)

 a*inva

 inva*a


 Press   return to continue
 Press X return to stop