Mathc complexes/h08a
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00e.c |
|---|
/* ------------------------------------ */
/* Save as: c00e.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define FACTOR_E +1.E-1
#define ARRAY A3
/* ------------------------------------ */
#define RC RC3
/* ------------------------------------ */
void fun(void)
{
double **A = rcsymmetric_mZ( i_mZ(RC,RC),99);
double **AEVect = eigs_V_mZ(A, i_mZ(RC,RC),FACTOR_E);
double **InvAEVect = ctranspose_mZ(AEVect, i_mZ(RC,RC));
double **T = i_mZ(RC,RC);
double **b [ARRAY];
double **r [ARRAY];
double **br[ARRAY];
int i;
for(i=A0; i<ARRAY; i++)
{
b[i] = c_c_mZ( AEVect,i+C1, i_mZ(RC,C1),C1);
r[i] = c_r_mZ(InvAEVect,i+R1, i_mZ(R1,RC),R1);
br[i] = mul_mZ(b[i],r[i], i_mZ(RC,RC));
}
clrscrn();
printf(" A:");
p_mZ(A, S7,P0,S6,P0,C7);
printf(" eigenvectors of A");
p_mZ(AEVect, S5,P4,S5,P4,C7);
printf(" Conjugate transpose of Eigenvector of A");
p_mZ(InvAEVect, S5,P4,S5,P4,C7);
stop();
clrscrn();
mul_mZ(br[0], br[1], T);
printf(" This simply materializes that our projectors\n"
" bnrn are orthogonal to each other. \n\n\n\n"
" b1r1 * b2r2");
p_mZ(T, S5,P4,S5,P4,C7);
mul_mZ(br[0], br[2], T);
printf(" b1r1 * b3r3");
p_mZ(T, S5,P4,S5,P4,C7);
mul_mZ(br[1], br[2], T);
printf(" b2r2 * b3r3");
p_mZ(T, S5,P4,S5,P4,C7);
f_mZ(A);
f_mZ(AEVect);
f_mZ(InvAEVect);
f_mZ(T);
for(i=A0; i<ARRAY; i++)
{
f_mZ( b[i]);
f_mZ( r[i]);
f_mZ(br[i]);
}
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun();
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Nous voyons une des propriétés de la décomposition spectral: * b1r1 * b2r2 = 0 * b1r1 * b3r3 = 0 * b2r2 * b3r3 = 0 Cela matérialise simplement que nos projecteurs sont orthogonaux entre eux.
Exemple de sortie écran :
A:
+26686 +0i +8681-17379i +17607 -4803i
+8681+17379i +31489 +0i +1418+10340i
+17607 +4803i +1418-10340i +20273 +0i
eigenvectors of A
+0.6320-0.0614i +0.1190-0.3215i -0.5851+0.3701i
+0.2660+0.5612i -0.5506-0.4252i +0.3607+0.0168i
+0.4595+0.0000i +0.6313-0.0000i +0.6247+0.0000i
Conjugate transpose of Eigenvector of A
+0.6320+0.0614i +0.2660-0.5612i +0.4595-0.0000i
+0.1190+0.3215i -0.5506+0.4252i +0.6313+0.0000i
-0.5851-0.3701i +0.3607-0.0168i +0.6247-0.0000i
Press return to continue.
This simply materializes that our projectors
bnrn are orthogonal to each other.
b1r1 * b2r2
+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
b1r1 * b3r3
+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
b2r2 * b3r3
+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
Press return to continue
Press X return to stop