Mathc complexes/031
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-2
#define RCA RC4
#define EVALUE RC1
/* ------------------------------------ */
void fun(void)
{
double a[RCA*(RCA*C2)] ={
+36.313679157,+0.000000000, +19.585408427,-0.742196710, -15.875721237,+0.689662875, +8.211253265,+22.976851849,
+19.585408427,+0.742196710, +63.726719706,+0.000000000, +10.890345307,+2.396948766, -1.434784341,+15.056472852,
-15.875721237,-0.689662875, +10.890345307,-2.396948766, +16.126426155,-0.000000000, -3.467769379,-0.518070163,
+8.211253265,-22.976851849, -1.434784341,-15.056472852, -3.467769379,+0.518070163, +55.833174982,+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);
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 :
+0.651225366+0.000000000i -0.158846132+0.418635744i -0.237811929-0.039640695i
-0.158846132-0.418635744i +1.100413236+0.000000000i +0.151406646-0.788515806i
-0.237811929+0.039640695i +0.151406646+0.788515806i +1.248361398+0.000000000i
V1 :
A :
+36.313679157 +0.000000000i +19.585408427 -0.742196710i
+19.585408427 +0.742196710i +63.726719706 +0.000000000i
-15.875721237 -0.689662875i +10.890345307 -2.396948766i
+8.211253265-22.976851849i -1.434784341-15.056472852i
-15.875721237 +0.689662875i +8.211253265+22.976851849i
+10.890345307 +2.396948766i -1.434784341+15.056472852i
+16.126426155 -0.000000000i -3.467769379 -0.518070163i
-3.467769379 +0.518070163i +55.833174982 +0.000000000i
V1 :
+0.112347739,+0.473151, -nan, -nan, -nan, -nan, -nan, -nan,
+0.027862928,+0.639967, -nan, -nan, -nan, -nan, -nan, -nan,
-0.022126148,-0.013101, -nan, -nan, -nan, -nan, -nan, -nan,
+0.593726724,-0.000000, -nan, -nan, -nan, -nan, -nan, -nan
Press return to continue.