Mathc complexes/039
Apparence
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-4
#define RCA RC6
#define EVALUE RC1
/* ------------------------------------ */
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 **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, S13,P9, S13,P9, C2);
zmul_mZ(i_Z(EValue[EVALUE][C1],EValue[EVALUE][C2]),Ide,zIde);
sub_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,EVALUE);
Normalize_mZ(V);
stop();
clrscrn();
printf(" V%d :",EVALUE);
P_mZ(V, S6,P9, S8,P9, C4);
printf("\n");
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 un vecteur propre.
Exemple de sortie écran :
A :
+23.037247782 -0.000000000i -9.054210143 -4.760094043i
-9.054210143 +4.760094043i +21.661298903 +0.000000000i
+7.055780246 +8.116625940i -0.063767253 -2.540467712i
+5.837328527 -3.181102856i -0.356099425-12.951777333i
-5.497293954 -1.987290486i -0.578233130 -5.883310886i
-3.853659006 +3.688738932i +7.278478707 +7.059870759i
+7.055780246 -8.116625940i +5.837328527 +3.181102856i
-0.063767253 +2.540467712i -0.356099425+12.951777333i
+41.444943135 -0.000000000i -11.011924524-22.763984410i
-11.011924524+22.763984410i +42.110215120 +0.000000000i
+4.447732552+27.866895323i +20.713304065 -9.756936697i
+1.844442206 +1.924521124i -11.927657780 +5.975712843i
-5.497293954 +1.987290486i -3.853659006 -3.688738932i
-0.578233130 +5.883310886i +7.278478707 -7.059870759i
+4.447732552-27.866895323i +1.844442206 -1.924521124i
+20.713304065 +9.756936697i -11.927657780 -5.975712843i
+42.740823156 +0.000000000i +0.112009750 +7.491403896i
+0.112009750 -7.491403896i +34.005471906 -0.000000000i
Press return to continue.
V1 :
+0.047224828,-0.030542, -nan, -nan, -nan, -nan, -nan, -nan,
-0.035751335,-0.135037, -nan, -nan, -nan, -nan, -nan, -nan,
+0.278754230,+0.485735, -nan, -nan, -nan, -nan, -nan, -nan,
-0.561091150,+0.051858, -nan, -nan, -nan, -nan, -nan, -nan,
-0.459824934,+0.336731, -nan, -nan, -nan, -nan, -nan, -nan,
+0.146090904,+0.000000, -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
Press return to continue.