Mathc complexes/02q
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 RC4
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double a[RCA*(RCA*C2)] ={
+1.329842932,+0.000000000, -0.125654450,-0.209424084, -0.041884817,-0.376963351, -0.041884817,+0.125654450,
-0.125654450,+0.209424084, +1.910994764,+0.000000000, -0.125654450,-0.057591623, +0.031413613,+0.036649215,
-0.041884817,+0.376963351, -0.125654450,+0.057591623, +1.785340314,+0.000000000, +0.068062827,+0.031413613,
-0.041884817,-0.125654450, +0.031413613,-0.036649215, +0.068062827,-0.031413613, +1.973821990,+0.000000000
};
double v[RCA*(RCA*C2)] ={
// This is the copy of V2 of the last file
-0.176166065,-0.293610110, -0.054392830,-0.489535464, -0.061313934,+0.183941801, +0.258873923,-0.776621761,
+0.939552351,+0.000000000, +0.000000000,+0.000000000, +0.000000000,+0.000000000, -0.194155440,-0.226514681,
+0.000000000,+0.000000000, +0.870285269,+0.000000000, +0.000000000,+0.000000000, -0.420670121,-0.194155442,
+0.000000000,+0.000000000, +0.000000000,+0.000000000, +0.981022943,+0.000000000, +0.161796200,+0.000000000
};
double **A = ca_A_mZ(a, i_mZ(RCA,RCA));
double **V = ca_A_mZ(v, i_mZ(RCA,RCA));
double **invV = invgj_mZ(V, i_mZ(RCA,RCA));
double **T = i_mZ(RCA,RCA);
double **EigsValue = i_mZ(RCA,RCA);
clrscrn();
printf(" A :");
p_mZ(A, S8,P4, S6,P4, C4);
printf(" V :");
p_mZ(V, S8,P4, S6,P4, C4);
printf(" invV :");
p_mZ(invV, S8,P4, S6,P4, C4);
stop();
clrscrn();
printf(" EigsValue : invV * A * V");
mul_mZ(invV,A,T);
mul_mZ(T,V,EigsValue);
p_mZ(clean_eyes_mZ(EigsValue), S8,P2, S6,P2, C4);
printf(" A :");
p_mZ(A, S8,P4, S6,P4, C4);
printf(" A = V * EigsValue * invV");
mul_mZ(V,EigsValue,T);
mul_mZ(T,invV,A);
p_mZ(A, S8,P4, S6,P4, C4);
stop();
f_mZ(A);
f_mZ(V);
f_mZ(invV);
f_mZ(T);
f_mZ(EigsValue);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Sauver le dernier vecteurs propres, et vérifier les calculs
Exemple de sortie écran :
A :
+1.3298+0.0000i -0.1257-0.2094i -0.0419-0.3770i -0.0419+0.1257i
-0.1257+0.2094i +1.9110+0.0000i -0.1257-0.0576i +0.0314+0.0366i
-0.0419+0.3770i -0.1257+0.0576i +1.7853+0.0000i +0.0681+0.0314i
-0.0419-0.1257i +0.0314-0.0366i +0.0681-0.0314i +1.9738+0.0000i
V :
-0.1762-0.2936i -0.0544-0.4895i -0.0613+0.1839i +0.2589-0.7766i
+0.9396+0.0000i +0.0000+0.0000i +0.0000+0.0000i -0.1942-0.2265i
+0.0000+0.0000i +0.8703+0.0000i +0.0000+0.0000i -0.4207-0.1942i
+0.0000+0.0000i +0.0000+0.0000i +0.9810+0.0000i +0.1618+0.0000i
invV :
-0.1337+0.2229i +0.9696-0.0000i -0.1337-0.0613i +0.0334+0.0390i
-0.0481+0.4331i -0.1444+0.0662i +0.9024+0.0000i +0.0782+0.0361i
-0.0427-0.1281i +0.0320-0.0374i +0.0694-0.0320i +0.9927+0.0000i
+0.2589+0.7766i -0.1942+0.2265i -0.4207+0.1942i +0.1618-0.0000i
Press return to continue.
EigsValue : invV * A * V
+2.00 -0.00i +0.00 +0.00i +0.00 +0.00i +0.00 +0.00i
+0.00 +0.00i +2.00 +0.00i +0.00 +0.00i +0.00 +0.00i
+0.00 +0.00i +0.00 +0.00i +2.00 +0.00i +0.00 +0.00i
+0.00 +0.00i +0.00 +0.00i +0.00 +0.00i +1.00 -0.00i
A :
+1.3298+0.0000i -0.1257-0.2094i -0.0419-0.3770i -0.0419+0.1257i
-0.1257+0.2094i +1.9110+0.0000i -0.1257-0.0576i +0.0314+0.0366i
-0.0419+0.3770i -0.1257+0.0576i +1.7853+0.0000i +0.0681+0.0314i
-0.0419-0.1257i +0.0314-0.0366i +0.0681-0.0314i +1.9738+0.0000i
A = V * EigsValue * invV
+1.3298-0.0000i -0.1257-0.2094i -0.0419-0.3770i -0.0419+0.1257i
-0.1257+0.2094i +1.9110-0.0000i -0.1257-0.0576i +0.0314+0.0366i
-0.0419+0.3770i -0.1257+0.0576i +1.7853+0.0000i +0.0681+0.0314i
-0.0419-0.1257i +0.0314-0.0366i +0.0681-0.0314i +1.9738+0.0000i
Press return to continue.