Mathc complexes/03a
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)] ={
+23.037247782,-0.000000000, -9.054210143,-4.760094043, +7.055780246,-8.116625940, +5.837328527,+3.181102856, -5.497293954,+1.987290486, -3.853659006,-3.688738932,
-9.054210143,+4.760094043, +21.661298903,+0.000000000, -0.063767253,+2.540467712, -0.356099425,+12.951777333, -0.578233130,+5.883310886, +7.278478707,-7.059870759,
+7.055780246,+8.116625940, -0.063767253,-2.540467712, +41.444943135,-0.000000000, -11.011924524,-22.763984410, +4.447732552,-27.866895323, +1.844442206,-1.924521124,
+5.837328527,-3.181102856, -0.356099425,-12.951777333, -11.011924524,+22.763984410, +42.110215120,+0.000000000, +20.713304065,+9.756936697, -11.927657780,-5.975712843,
-5.497293954,-1.987290486, -0.578233130,-5.883310886, +4.447732552,+27.866895323, +20.713304065,-9.756936697, +42.740823156,+0.000000000, +0.112009750,+7.491403896,
-3.853659006,+3.688738932, +7.278478707,+7.059870759, +1.844442206,+1.924521124, -11.927657780,+5.975712843, +0.112009750,-7.491403896, +34.005471906,-0.000000000
};
double v[RCA*(RCA*C2)] ={
+0.047224828,-0.030542, -0.375326461,-0.217601, +0.554860337,+0.295346, -0.060148746,-0.367807, -0.060082512,+0.128466, -0.465232675,-0.195098,
-0.035751335,-0.135037, +0.388649771,-0.197457, -0.294671241,-0.107614, -0.421758697,+0.022151, +0.162959614,+0.543755, -0.375187641,-0.225113,
+0.278754230,+0.485735, -0.006447645,-0.312285, -0.017204389,+0.123019, -0.452083004,-0.299958, -0.020141664,+0.122848, +0.405202652,+0.315158,
-0.561091150,+0.051858, -0.240997882,-0.219314, +0.206868904,-0.177991, +0.174041327,+0.131936, +0.032313086,+0.518081, +0.420210158,-0.090045,
-0.459824934,+0.336731, +0.180876933,+0.062042, +0.215071924,+0.118130, -0.473183679,+0.294261, -0.193560936,-0.383543, -0.045022517,-0.285143,
+0.146090904,+0.000000, +0.617603852,+0.000000, +0.596970042,+0.000000, +0.173740600,-0.000000, +0.433752671,+0.000000, +0.150075056,-0.000000
};
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, S10,P4, S8,P4, C4);
stop();
clrscrn();
printf(" V :");
p_mZ(V, S10,P4, S8,P4, C4);
stop();
clrscrn();
printf(" invV :");
p_mZ(invV, S10,P4, S8,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), S10,P4, S8,P4, C4);
stop();
clrscrn();
printf(" A :");
p_mZ(A, S10,P4, S8,P4, C4);
stop();
clrscrn();
printf(" A = V * EigsValue * invV");
mul_mZ(V,EigsValue,T);
mul_mZ(T,invV,A);
p_mZ(A, S10,P4, S8,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érifions les calculs précédents.
Exemple de sortie écran :
A :
+23.0372 -0.0000i -9.0542 -4.7601i +7.0558 -8.1166i +5.8373 +3.1811i
-9.0542 +4.7601i +21.6613 +0.0000i -0.0638 +2.5405i -0.3561+12.9518i
+7.0558 +8.1166i -0.0638 -2.5405i +41.4449 -0.0000i -11.0119-22.7640i
+5.8373 -3.1811i -0.3561-12.9518i -11.0119+22.7640i +42.1102 +0.0000i
-5.4973 -1.9873i -0.5782 -5.8833i +4.4477+27.8669i +20.7133 -9.7569i
-3.8537 +3.6887i +7.2785 +7.0599i +1.8444 +1.9245i -11.9277 +5.9757i
-5.4973 +1.9873i -3.8537 -3.6887i
-0.5782 +5.8833i +7.2785 -7.0599i
+4.4477-27.8669i +1.8444 -1.9245i
+20.7133 +9.7569i -11.9277 -5.9757i
+42.7408 +0.0000i +0.1120 +7.4914i
+0.1120 -7.4914i +34.0055 -0.0000i
Press return to continue.
V :
+0.0472 -0.0305i -0.3753 -0.2176i +0.5549 +0.2953i -0.0601 -0.3678i
-0.0358 -0.1350i +0.3886 -0.1975i -0.2947 -0.1076i -0.4218 +0.0222i
+0.2788 +0.4857i -0.0064 -0.3123i -0.0172 +0.1230i -0.4521 -0.3000i
-0.5611 +0.0519i -0.2410 -0.2193i +0.2069 -0.1780i +0.1740 +0.1319i
-0.4598 +0.3367i +0.1809 +0.0620i +0.2151 +0.1181i -0.4732 +0.2943i
+0.1461 +0.0000i +0.6176 +0.0000i +0.5970 +0.0000i +0.1737 -0.0000i
-0.0601 +0.1285i -0.4652 -0.1951i
+0.1630 +0.5438i -0.3752 -0.2251i
-0.0201 +0.1228i +0.4052 +0.3152i
+0.0323 +0.5181i +0.4202 -0.0900i
-0.1936 -0.3835i -0.0450 -0.2851i
+0.4338 +0.0000i +0.1501 -0.0000i
Press return to continue.
invV :
+0.0472 +0.0305i -0.0358 +0.1350i +0.2788 -0.4857i -0.5611 -0.0519i
-0.3753 +0.2176i +0.3886 +0.1975i -0.0064 +0.3123i -0.2410 +0.2193i
+0.5549 -0.2953i -0.2947 +0.1076i -0.0172 -0.1230i +0.2069 +0.1780i
-0.0601 +0.3678i -0.4218 -0.0222i -0.4521 +0.3000i +0.1740 -0.1319i
-0.0601 -0.1285i +0.1630 -0.5438i -0.0201 -0.1228i +0.0323 -0.5181i
-0.4652 +0.1951i -0.3752 +0.2251i +0.4052 -0.3152i +0.4202 +0.0900i
-0.4598 -0.3367i +0.1461 -0.0000i
+0.1809 -0.0620i +0.6176 -0.0000i
+0.2151 -0.1181i +0.5970 +0.0000i
-0.4732 -0.2943i +0.1737 -0.0000i
-0.1936 +0.3835i +0.4338 +0.0000i
-0.0450 +0.2851i +0.1501 -0.0000i
Press return to continue.
EigsValue : invV * A * V
+96.0000 +0.0000i +0.0000 +0.0000i +0.0000 +0.0000i +0.0000 +0.0000i
+0.0000 +0.0000i +53.0000 -0.0000i +0.0000 +0.0000i +0.0000 +0.0000i
+0.0000 +0.0000i +0.0000 +0.0000i +25.0000 +0.0000i +0.0000 +0.0000i
+0.0000 +0.0000i +0.0000 +0.0000i +0.0000 +0.0000i +19.0000 -0.0000i
+0.0000 +0.0000i +0.0000 +0.0000i +0.0000 +0.0000i +0.0000 +0.0000i
+0.0000 +0.0000i +0.0000 +0.0000i +0.0000 +0.0000i +0.0000 +0.0000i
+0.0000 +0.0000i +0.0000 +0.0000i
+0.0000 +0.0000i +0.0000 +0.0000i
+0.0000 +0.0000i +0.0000 +0.0000i
+0.0000 +0.0000i +0.0000 +0.0000i
+12.0000 -0.0000i +0.0000 +0.0000i
+0.0000 +0.0000i +0.0000 -0.0000i
Press return to continue.
A :
+23.0372 -0.0000i -9.0542 -4.7601i +7.0558 -8.1166i +5.8373 +3.1811i
-9.0542 +4.7601i +21.6613 +0.0000i -0.0638 +2.5405i -0.3561+12.9518i
+7.0558 +8.1166i -0.0638 -2.5405i +41.4449 -0.0000i -11.0119-22.7640i
+5.8373 -3.1811i -0.3561-12.9518i -11.0119+22.7640i +42.1102 +0.0000i
-5.4973 -1.9873i -0.5782 -5.8833i +4.4477+27.8669i +20.7133 -9.7569i
-3.8537 +3.6887i +7.2785 +7.0599i +1.8444 +1.9245i -11.9277 +5.9757i
-5.4973 +1.9873i -3.8537 -3.6887i
-0.5782 +5.8833i +7.2785 -7.0599i
+4.4477-27.8669i +1.8444 -1.9245i
+20.7133 +9.7569i -11.9277 -5.9757i
+42.7408 +0.0000i +0.1120 +7.4914i
+0.1120 -7.4914i +34.0055 -0.0000i
Press return to continue.
A = V * EigsValue * invV
+23.0373 +0.0000i -9.0542 -4.7601i +7.0558 -8.1166i +5.8373 +3.1811i
-9.0542 +4.7601i +21.6613 -0.0000i -0.0638 +2.5405i -0.3561+12.9518i
+7.0558 +8.1166i -0.0638 -2.5404i +41.4450 -0.0000i -11.0119-22.7640i
+5.8373 -3.1811i -0.3561-12.9518i -11.0119+22.7640i +42.1102 +0.0000i
-5.4973 -1.9873i -0.5782 -5.8833i +4.4478+27.8669i +20.7133 -9.7569i
-3.8537 +3.6887i +7.2785 +7.0599i +1.8444 +1.9245i -11.9277 +5.9757i
-5.4973 +1.9873i -3.8537 -3.6887i
-0.5782 +5.8833i +7.2785 -7.0599i
+4.4477-27.8669i +1.8444 -1.9245i
+20.7133 +9.7570i -11.9277 -5.9757i
+42.7408 -0.0000i +0.1120 +7.4914i
+0.1120 -7.4914i +34.0055 -0.0000i
Press return to continue.