Mathc complexes/02u
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 RC6
#define EV 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 **A = ca_A_mZ(a, i_mZ(RCA,RCA));
double **sA = smul_mZ(FACTOR_E, A, i_mZ(RCA,RCA));
double **EValue = eigs_mZ( sA, i_mZ(RCA,RCA));
double **V = i_mZ(RCA,RCA);
double **Ide = eye_mZ( i_mZ(RCA,RCA));
double **zIde = i_mZ(RCA,RCA);
double **sAmnszIde = i_mZ(RCA,RCA);
double **Ab = i_Abr_Ac_bc_mZ(RCA,RCA,C1);
double **b = i_mZ( RCA,C1);
double **Ab_free = i_Abr_Ac_bc_mZ(RCA,RCA,C2);
double **b_free = i_mZ( RCA,C2);
clrscrn();
printf("A :");
p_mZ(A, S9,P5, S8,P5, C4);
stop();
zmul_mZ(i_Z(EValue[EV][C1],EValue[EV][C2]),Ide,zIde);
MmnsD_mZ(sA,zIde,sAmnszIde);
c_A_b_Ab_mZ(sAmnszIde,b,Ab);
GJ_PP_FreeV_mZ(Ab,Ab_free,b_free);
c_c_mZ(b_free,C2,V,EV);
Normalize_mZ(V);
clrscrn();
printf(" zIde : EV%d * Ide",EV); p_mZ(zIde, S9,P5, S8,P5, C4);
stop();
clrscrn();
printf(" sAmnszIde : A - (EV%d*Ide)",EV); p_mZ(sAmnszIde, S9,P5, S8,P5, C4);
stop();
clrscrn();
printf(" A x = b \n"
" Ab : [A-(EV%d*Ide)] V%d = 0 ",EV,EV); p_mZ(Ab, S9,P5, S8,P5, C4);
stop();
clrscrn();
printf(" Ab_free : [A-(EV%d*Ide)] V%d = 0 ",EV,EV); p_mZ(Ab_free, S9,P5, S8,P5, C4);
stop();
clrscrn();
printf(" b_free :"); p_mZ(b_free, S9,P5, S8,P5, C4);
stop();
clrscrn();
printf(" V%d : Copy V%d into the last file",EV,EV); P_mZ(V, S9,P9, S8,P9, C3);
stop();
f_mZ(A);
f_mZ(V);
f_mZ(EValue);
f_mZ(Ide);
f_mZ(zIde);
f_mZ(sAmnszIde);
f_mZ(sA);
f_mZ(Ab);
f_mZ(b);
f_mZ(Ab_free);
f_mZ(b_free);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Calculer le dernier vecteur propre
Exemple de sortie écran :
A :
+2.54768+0.00000i -0.15295-0.24012i -0.15561-0.19569i -0.29806-0.13602i
-0.15295+0.24012i +2.50921-0.00000i -0.15513+0.32410i +0.21656-0.03348i
-0.15561+0.19569i -0.15513-0.32410i +2.26024-0.00000i -0.14349+0.36833i
-0.29806+0.13602i +0.21656+0.03348i -0.14349-0.36833i +2.12268+0.00000i
+0.26913+0.18813i -0.04283+0.49668i +0.53244+0.13497i +0.15152-0.12843i
-0.03047-0.24200i +0.29449-0.06349i +0.12671+0.11009i -0.31095+0.02931i
+0.26913-0.18813i -0.03047+0.24200i
-0.04283-0.49668i +0.29449+0.06349i
+0.53244-0.13497i +0.12671-0.11009i
+0.15152+0.12843i -0.31095-0.02931i
+2.28222-0.00000i +0.20679+0.00046i
+0.20679-0.00046i +2.27797+0.00000i
Press return to continue.
zIde : EV6 * Ide
+0.10000-0.00000i +0.00000+0.00000i +0.00000+0.00000i +0.00000+0.00000i
+0.00000+0.00000i +0.10000-0.00000i +0.00000+0.00000i +0.00000+0.00000i
+0.00000+0.00000i +0.00000+0.00000i +0.10000-0.00000i +0.00000+0.00000i
+0.00000+0.00000i +0.00000+0.00000i +0.00000+0.00000i +0.10000-0.00000i
+0.00000+0.00000i +0.00000+0.00000i +0.00000+0.00000i +0.00000+0.00000i
+0.00000+0.00000i +0.00000+0.00000i +0.00000+0.00000i +0.00000+0.00000i
+0.00000+0.00000i +0.00000+0.00000i
+0.00000+0.00000i +0.00000+0.00000i
+0.00000+0.00000i +0.00000+0.00000i
+0.00000+0.00000i +0.00000+0.00000i
+0.10000-0.00000i +0.00000+0.00000i
+0.00000+0.00000i +0.10000-0.00000i
Press return to continue.
sAmnszIde : A - (EV6*Ide)
+0.15477+0.00000i -0.01529-0.02401i -0.01556-0.01957i -0.02981-0.01360i
-0.01529+0.02401i +0.15092+0.00000i -0.01551+0.03241i +0.02166-0.00335i
-0.01556+0.01957i -0.01551-0.03241i +0.12602+0.00000i -0.01435+0.03683i
-0.02981+0.01360i +0.02166+0.00335i -0.01435-0.03683i +0.11227+0.00000i
+0.02691+0.01881i -0.00428+0.04967i +0.05324+0.01350i +0.01515-0.01284i
-0.00305-0.02420i +0.02945-0.00635i +0.01267+0.01101i -0.03109+0.00293i
+0.02691-0.01881i -0.00305+0.02420i
-0.00428-0.04967i +0.02945+0.00635i
+0.05324-0.01350i +0.01267-0.01101i
+0.01515+0.01284i -0.03109-0.00293i
+0.12822+0.00000i +0.02068+0.00005i
+0.02068-0.00005i +0.12780+0.00000i
Press return to continue.
A x = b
Ab : [A-(EV6*Ide)] V6 = 0
+1.00000+0.00000i -0.09882-0.15515i -0.10054-0.12644i -0.19258-0.08788i
+0.00000+0.00000i +1.00000+0.00000i -0.13788+0.22576i +0.11395-0.00047i
+0.00000+0.00000i +0.00000+0.00000i +1.00000+0.00000i -0.14994+0.38440i
+0.00000+0.00000i -0.00000+0.00000i +0.00000+0.00000i +1.00000-0.00000i
+0.00000+0.00000i -0.00000+0.00000i +0.00000+0.00000i +0.00000-0.00000i
+0.00000+0.00000i +0.00000-0.00000i -0.00000-0.00000i -0.00000+0.00000i
+0.17389-0.12156i -0.01969+0.15636i +0.00000+0.00000i
-0.03118-0.38235i +0.22585+0.06324i +0.00000+0.00000i
+0.58611-0.24597i +0.15995+0.00454i +0.00000+0.00000i
+0.46875+0.40597i -0.36505+0.09338i +0.00000+0.00000i
+1.00000+0.00000i +1.33333-1.66667i +0.00000+0.00000i
+0.00000+0.00000i -0.00000+0.00000i +0.00000+0.00000i
Press return to continue.
Ab_free : [A-(EV6*Ide)] V6 = 0
+1.00000+0.00000i +0.00000+0.00000i +0.00000+0.00000i +0.00000+0.00000i
+0.00000+0.00000i +1.00000+0.00000i +0.00000+0.00000i +0.00000+0.00000i
+0.00000+0.00000i +0.00000+0.00000i +1.00000+0.00000i +0.00000+0.00000i
+0.00000+0.00000i +0.00000+0.00000i +0.00000+0.00000i +1.00000-0.00000i
-0.00000+0.00000i -0.00000+0.00000i -0.00000+0.00000i -0.00000+0.00000i
+0.00000+0.00000i +0.00000+0.00000i +0.00000+0.00000i +0.00000+0.00000i
+0.00000+0.00000i +0.00000+0.00000i +0.00000+0.00000i +0.66667-1.00000i
+0.00000+0.00000i +0.00000-0.00000i +0.00000+0.00000i -1.50000-0.83333i
+0.00000+0.00000i +0.00000+0.00000i +0.00000+0.00000i +0.33333-2.00000i
+0.00000+0.00000i +0.00000+0.00000i +0.00000+0.00000i +1.66667-0.33333i
+1.00000+0.00000i -0.00000-0.00000i -0.00000+0.00000i -1.33333+1.66667i
+0.00000+0.00000i +1.00000+0.00000i +0.00000+0.00000i +1.00000-0.00000i
Press return to continue.
b_free :
+0.00000+0.00000i +0.66667-1.00000i
+0.00000+0.00000i -1.50000-0.83333i
+0.00000+0.00000i +0.33333-2.00000i
+0.00000+0.00000i +1.66667-0.33333i
-0.00000+0.00000i -1.33333+1.66667i
+0.00000+0.00000i +1.00000-0.00000i
Press return to continue.
V6 : Copy V6 into the last file
-nan, -nan, -nan, -nan, -nan, -nan,
-nan, -nan, -nan, -nan, -nan, -nan,
-nan, -nan, -nan, -nan, -nan, -nan,
-nan, -nan, -nan, -nan, -nan, -nan,
-nan, -nan, -nan, -nan, -nan, -nan,
-nan, -nan, -nan, -nan, -nan, -nan
-nan, -nan, -nan, -nan, +0.161955266,-0.242932899,
-nan, -nan, -nan, -nan, -0.364399349,-0.202444082,
-nan, -nan, -nan, -nan, +0.080977632,-0.485865798,
-nan, -nan, -nan, -nan, +0.404888165,-0.080977633,
-nan, -nan, -nan, -nan, -0.323910532,+0.404888165,
-nan, -nan, -nan, -nan, +0.242932899,-0.000000000
Press return to continue.