Aller au contenu

Mathc complexes/01q

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(" [L] = chol (a ,\"lower\") \n"
         " L*L'\n"
         " 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 : [L] = chol (A, "lower") (octave) L * L' = A


Exemple de sortie écran :

 Copy/Past into the octave windows 

 a=[
+24.259129187+0.000000000*i,-4.011309146+1.027297956*i,+2.465072003-4.115599791*i,+0.137887904-9.223006548*i;
-4.011309146-1.027297956*i,+29.027236701+0.000000000*i,+3.162741390-3.923921401*i,+1.421996713-4.664902961*i;
+2.465072003+4.115599791*i,+3.162741390+3.923921401*i,+20.738348906+0.000000000*i,-4.902379686+2.340059428*i;
+0.137887904+9.223006548*i,+1.421996713+4.664902961*i,-4.902379686-2.340059428*i,+20.975285206+0.000000000*i]

 [L] = chol (a ,"lower") 
 L*L'
 a


 Press   return to continue
 Press X return to stop