Mathc complexes/035
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-3
#define RCA RC5
#define EVALUE RC1
/* ------------------------------------ */
void fun(void)
{
double a[RCA*(RCA*C2)] ={
+33.519963947,-0.000000000, -13.693912818,+6.712740170, +6.614415988,-2.591607122, -14.832764827,-15.560900752, +5.931313432,+7.201798592,
-13.693912818,-6.712740170, +39.585869431,+0.000000000, -12.477192990,+16.370664567, +8.957620096,-4.146641673, -20.695195874,-8.986119738,
+6.614415988,+2.591607122, -12.477192990,-16.370664567, +40.575180719,+0.000000000, -10.968623618,-19.349596696, -6.548231731,+8.901841379,
-14.832764827,+15.560900752, +8.957620096,+4.146641673, -10.968623618,+19.349596696, +41.873262178,-0.000000000, +4.207151243,-10.065003488,
+5.931313432,-7.201798592, -20.695195874,+8.986119738, -6.548231731,-8.901841379, +4.207151243,+10.065003488, +28.445723725,-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);
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,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 :
+33.519963947 -0.000000000i -13.693912818 +6.712740170i
-13.693912818 -6.712740170i +39.585869431 +0.000000000i
+6.614415988 +2.591607122i -12.477192990-16.370664567i
-14.832764827+15.560900752i +8.957620096 +4.146641673i
+5.931313432 -7.201798592i -20.695195874 +8.986119738i
+6.614415988 -2.591607122i -14.832764827-15.560900752i
-12.477192990+16.370664567i +8.957620096 -4.146641673i
+40.575180719 +0.000000000i -10.968623618-19.349596696i
-10.968623618+19.349596696i +41.873262178 -0.000000000i
-6.548231731 -8.901841379i +4.207151243+10.065003488i
+5.931313432 +7.201798592i
-20.695195874 -8.986119738i
-6.548231731 +8.901841379i
+4.207151243-10.065003488i
+28.445723725 -0.000000000i
Press return to continue.
V1 :
+0.118330494,+0.336141, -nan, -nan, -nan, -nan, -nan, -nan,
-0.312524604,-0.379916, -nan, -nan, -nan, -nan, -nan, -nan,
-0.179576129,+0.492444, -nan, -nan, -nan, -nan, -nan, -nan,
-0.286321908,-0.401151, -nan, -nan, -nan, -nan, -nan, -nan,
+0.336672172,+0.000000, -nan, -nan, -nan, -nan, -nan, -nan
-nan, -nan,
-nan, -nan,
-nan, -nan,
-nan, -nan,
-nan, -nan
Press return to continue.