Mathc complexes/02v
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define RCA RC6
/* ------------------------------------ */
void fun(void)
{
double a[RCA*(RCA*C2)] ={
+2.547682339,+0.000000000, -0.152948221,-0.240121509, -0.155610012,-0.195690152, -0.298057299,-0.136017286, +0.269130276,-0.188132110, -0.030470880,+0.242003023,
-0.152948221,+0.240121509, +2.509208904,-0.000000000, -0.155129068,+0.324099386, +0.216564361,-0.033484580, -0.042828351,-0.496677449, +0.294488953,+0.063493335,
-0.155610012,+0.195690152, -0.155129068,-0.324099386, +2.260239854,-0.000000000, -0.143493743,+0.368327431, +0.532444321,-0.134971208, +0.126713301,-0.110092820,
-0.298057299,+0.136017286, +0.216564361,+0.033484580, -0.143493743,-0.368327431, +2.122680989,+0.000000000, +0.151516032,+0.128430424, -0.310946484,-0.029309153,
+0.269130276,+0.188132110, -0.042828351,+0.496677449, +0.532444321,+0.134971208, +0.151516032,-0.128430424, +2.282218238,-0.000000000, +0.206791187,+0.000458645,
-0.030470880,-0.242003023, +0.294488953,-0.063493335, +0.126713301,+0.110092820, -0.310946484,+0.029309153, +0.206791187,-0.000458645, +2.277969677,+0.000000000
};
double v[RCA*(RCA*C2)] ={
// This is the copy of V2 of the last file
-0.602212108,-0.197619446, +0.307741070,-0.385245122, -0.469280304,+0.016495099, -0.035632010,+0.501260535, -0.353889608,-0.071809365, +0.161955266,-0.242932899,
+0.571949714,-0.319588195, -0.234041354,-0.097520343, +0.659450230,-0.042946794, -0.082379706,+0.334090099, -0.331083544,+0.036132621, -0.364399349,-0.202444082,
-0.151354225,-0.120711483, +0.504304725,+0.168627883, -0.000973596,-0.461193853, +0.038538669,-0.094800033, -0.105801002,+0.359575937, +0.080977632,-0.485865798,
+0.362690886,-0.000000000, +0.000000000,-0.000000000, -0.000000000,-0.000000000, +0.622785543,+0.345062820, +0.002742500,+0.493616159, +0.404888165,-0.080977633,
+0.000000000,+0.000000000, +0.640185472,+0.000000000, +0.000000000,+0.000000000, +0.334160392,+0.000000000, +0.000000000,-0.000000000, -0.323910532,+0.404888165,
+0.000000000,+0.000000000, -0.000000000,+0.000000000, +0.360671813,+0.000000000, +0.000000000,+0.000000000, +0.611989004,+0.000000000, +0.242932899,-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);
stop();
clrscrn();
printf(" V :");
p_mZ(V, S8,P4, S6,P4, C4);
stop();
clrscrn();
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);
stop();
clrscrn();
printf(" A :");
p_mZ(A, S8,P4, S6,P4, C4);
stop();
clrscrn();
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;
}
/* ------------------------------------ */
/* ------------------------------------ */
Vérifier les calculs
Exemple de sortie écran :
A :
+2.5477+0.0000i -0.1529-0.2401i -0.1556-0.1957i -0.2981-0.1360i
-0.1529+0.2401i +2.5092-0.0000i -0.1551+0.3241i +0.2166-0.0335i
-0.1556+0.1957i -0.1551-0.3241i +2.2602-0.0000i -0.1435+0.3683i
-0.2981+0.1360i +0.2166+0.0335i -0.1435-0.3683i +2.1227+0.0000i
+0.2691+0.1881i -0.0428+0.4967i +0.5324+0.1350i +0.1515-0.1284i
-0.0305-0.2420i +0.2945-0.0635i +0.1267+0.1101i -0.3109+0.0293i
+0.2691-0.1881i -0.0305+0.2420i
-0.0428-0.4967i +0.2945+0.0635i
+0.5324-0.1350i +0.1267-0.1101i
+0.1515+0.1284i -0.3109-0.0293i
+2.2822-0.0000i +0.2068+0.0005i
+0.2068-0.0005i +2.2780+0.0000i
Press return to continue.
V :
-0.6022-0.1976i +0.3077-0.3852i -0.4693+0.0165i -0.0356+0.5013i
+0.5719-0.3196i -0.2340-0.0975i +0.6595-0.0429i -0.0824+0.3341i
-0.1514-0.1207i +0.5043+0.1686i -0.0010-0.4612i +0.0385-0.0948i
+0.3627-0.0000i +0.0000-0.0000i -0.0000-0.0000i +0.6228+0.3451i
+0.0000+0.0000i +0.6402+0.0000i +0.0000+0.0000i +0.3342+0.0000i
+0.0000+0.0000i -0.0000+0.0000i +0.3607+0.0000i +0.0000+0.0000i
-0.3539-0.0718i +0.1620-0.2429i
-0.3311+0.0361i -0.3644-0.2024i
-0.1058+0.3596i +0.0810-0.4859i
+0.0027+0.4936i +0.4049-0.0810i
+0.0000-0.0000i -0.3239+0.4049i
+0.6120+0.0000i +0.2429-0.0000i
Press return to continue.
invV :
-0.5868+0.6101i +0.2355+0.3997i -0.1968-0.4912i +0.8083+0.0000i
+0.1848+0.2734i -0.0106+0.4429i +0.4834+0.0162i -0.0194+0.0145i
+0.0246-0.5073i +0.5711-0.0397i +0.4059+0.6325i -0.5894+0.1358i
+0.0973-0.4845i -0.0877-0.2108i -0.2590+0.3418i +0.5277-0.4398i
-0.0788+0.2026i -0.1919-0.0570i -0.2713-0.5656i +0.1866-0.1122i
+0.1620+0.2429i -0.3644+0.2024i +0.0810+0.4859i +0.4049+0.0810i
-0.0342-0.0256i -0.5861-0.1350i
+0.8608-0.0000i +0.2001+0.1544i
+0.3552-0.2740i +0.9343+0.0000i
+0.5389+0.0000i -0.1479-0.5901i
-0.0807+0.3222i +0.9869+0.0000i
-0.3239-0.4049i +0.2429-0.0000i
Press return to continue.
EigsValue : invV * A * V
+3.00 +0.00i +0.00 +0.00i +0.00 +0.00i +0.00 +0.00i
+0.00 +0.00i +3.00 +0.00i +0.00 +0.00i +0.00 +0.00i
+0.00 +0.00i +0.00 +0.00i +3.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
+0.00 +0.00i +0.00 +0.00i +0.00 +0.00i +0.00 +0.00i
+0.00 +0.00i +0.00 +0.00i
+0.00 +0.00i +0.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 +1.00 -0.00i
Press return to continue.
A :
+2.5477+0.0000i -0.1529-0.2401i -0.1556-0.1957i -0.2981-0.1360i
-0.1529+0.2401i +2.5092-0.0000i -0.1551+0.3241i +0.2166-0.0335i
-0.1556+0.1957i -0.1551-0.3241i +2.2602-0.0000i -0.1435+0.3683i
-0.2981+0.1360i +0.2166+0.0335i -0.1435-0.3683i +2.1227+0.0000i
+0.2691+0.1881i -0.0428+0.4967i +0.5324+0.1350i +0.1515-0.1284i
-0.0305-0.2420i +0.2945-0.0635i +0.1267+0.1101i -0.3109+0.0293i
+0.2691-0.1881i -0.0305+0.2420i
-0.0428-0.4967i +0.2945+0.0635i
+0.5324-0.1350i +0.1267-0.1101i
+0.1515+0.1284i -0.3109-0.0293i
+2.2822-0.0000i +0.2068+0.0005i
+0.2068-0.0005i +2.2780+0.0000i
Press return to continue.
A = V * EigsValue * invV
+2.5477-0.0000i -0.1529-0.2401i -0.1556-0.1957i -0.2981-0.1360i
-0.1529+0.2401i +2.5092+0.0000i -0.1551+0.3241i +0.2166-0.0335i
-0.1556+0.1957i -0.1551-0.3241i +2.2602+0.0000i -0.1435+0.3683i
-0.2981+0.1360i +0.2166+0.0335i -0.1435-0.3683i +2.1227+0.0000i
+0.2691+0.1881i -0.0428+0.4967i +0.5324+0.1350i +0.1515-0.1284i
-0.0305-0.2420i +0.2945-0.0635i +0.1267+0.1101i -0.3109+0.0293i
+0.2691-0.1881i -0.0305+0.2420i
-0.0428-0.4967i +0.2945+0.0635i
+0.5324-0.1350i +0.1267-0.1101i
+0.1515+0.1284i -0.3109-0.0293i
+2.2822-0.0000i +0.2068+0.0005i
+0.2068-0.0005i +2.2780+0.0000i
Press return to continue.