Mathc complexes/02h
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define FACTOR_E +1.E-1
#define RCA RC3
#define EV RC2
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double a[RCA*(RCA*C2)] ={
+1.344121661,+0.000000000, -0.056736206,-0.111717684, -0.178397348,+0.422109573,
-0.056736206,+0.111717684, +1.045622928,+0.000000000, -0.107623318,-0.127510236,
-0.178397348,-0.422109573, -0.107623318,+0.127510236, +1.610255410,+0.000000000};
double **A = ca_A_mZ(a, i_mZ(RCA,RCA));
double **EigsValue = eigs_mZ(A, i_mZ(RCA,C1));
clrscrn();
printf(" Copy/Past into the octave windows \n\n");
p_Octave_mZ(A,"a",P9,P9);
printf(" format short e\n"
" E = eigs (a,%d)\n\n", RCA);
printf(" EigsValue :");
p_mZ(EigsValue, S10,P4, S10,P4, C4);
stop();
f_mZ(A);
f_mZ(EigsValue);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Vérifier les valeurs propres : ici deux valeurs propres identiques
Exemple de sortie écran :
Copy/Past into the octave windows
a=[
+1.344121661+0.000000000*i,-0.056736206-0.111717684*i,-0.178397348+0.422109573*i;
-0.056736206+0.111717684*i,+1.045622928+0.000000000*i,-0.107623318-0.127510236*i;
-0.178397348-0.422109573*i,-0.107623318+0.127510236*i,+1.610255410+0.000000000*i]
format short e
E = eigs (a,3)
EigsValue :
+2.0000 +0.0000i
+1.0000 +0.0000i
+1.0000 -0.0000i
Press return to continue.