Mathc complexes/022
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-5
#define RCA RC2
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double a[RCA*(RCA*C2)] ={
+26191,+1471, -3444,+9191,
-3444,-9191, +27183,+1470};
double **A = ca_A_mZ(a, i_mZ(RCA,RCA));
double **V = eigs_V_mZ(A, i_mZ(RCA,RCA),FACTOR_E);
double **invV = inv_mZ(V, i_mZ(RCA,RCA));
double **EValue = eigs_mZ(A, i_mZ(RCA, RCA));
double **T = i_mZ(RCA,RCA);
clrscrn();
printf(" A :");
p_mZ(A, S8,P0, S6,P0, C3);
printf(" V :");
p_mZ(V, S9,P5, S8,P5, C4);
printf(" EValue = invV * A * V");
mul_mZ(invV,A,T);
mul_mZ(T,V,EValue);
pE_mZ(clean_eyes_mZ(EValue), S12,P4, S11,P4, C3);
printf(" A = V * EValue * invV");
mul_mZ(V,EValue,T);
mul_mZ(T,invV,A);
p_mZ(A, S8,P0, S6,P0, C3);
stop();
f_mZ(A);
f_mZ(V);
f_mZ(invV);
f_mZ(T);
f_mZ(EValue);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de référence : Il permet de vérifier les calculs.
Exemple de sortie écran :
A :
+26191 +1471i -3444 +9191i
-3444 -9191i +27183 +1470i
V :
-0.24181+0.64521i +0.25427-0.67866i
+0.72473+0.00000i +0.68903+0.00000i
EValue = invV * A * V
+3.6515e+04+1.4705e+03i +0.0000e+00+0.0000e+00i
+0.0000e+00+0.0000e+00i +1.6859e+04+1.4705e+03i
A = V * EValue * invV
+26191 +1471i -3444 +9191i
-3444 -9191i +27183 +1470i
Press return to continue.