Mathc complexes/Conclusion
Apparence
Installer et compiler ce fichier dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define TAB C2
#define RCA R3
#define POW 2
/* ------------------------------------ */
void fun(void)
{
double **A[TAB];
double **A_n[TAB];
double **P = r_mZ( i_mZ(RCA,RCA),99);
double **InvP = inv_mZ(P,i_mZ(RCA,RCA) );
double **T = i_mZ(RCA,RCA);
double **P_1A_nP = i_mZ(RCA,RCA);
int c;
for(c=C0; c<TAB; c++)
{
A[c] = i_mZ(RCA,RCA);
A_n[c] = i_mZ(RCA,RCA);
}
rcsymmetric_mZ(A[R0],9);
mul_mZ(InvP,A[C0],T);
mul_mZ(T,P,A[C0+C1]);
clrscrn();
printf(" The two similar matrices :\n\n"
" A[%d] = P**(-1) A[%d] P \n\n",C1,C0);
for(c=C0; c<TAB; c++)
{
printf(" A[%d] : ",c);
p_mZ(A[c],S9,P2,S8,P2,C6);
}
stop();
clrscrn();
printf(" The two similar matrices at the power %d : \n\n",POW);
for(c=C0; c<TAB; c++)
{
printf(" A[%d]**%d : ",c,POW
);
p_mZ(pow_mZ(POW,A[c],A_n[c]),S11,P2,S11,P2,C6);
}
stop();
clrscrn();
mul_mZ(InvP,A_n[C0],T);
mul_mZ(T,P,P_1A_nP);
printf(" A[%d]**%d = P**(-1) A[%d]**%d P \n\n",C1,POW,C0,POW);
printf(" A[%d]**%d : ",C1,POW);
p_mZ(A_n[1],S11,P2,S11,P2,C6);
printf(" P**(-1) A[%d]**%d P : ",C0,POW);
p_mZ(P_1A_nP,S11,P2,S11,P2,C6);
for(c=C0; c<TAB; c++)
{
f_mZ(A[c]);
f_mZ(A_n[c]);
}
f_mZ(P);
f_mZ(InvP);
f_mZ(T);
f_mZ(P_1A_nP);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do{
fun();
}while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Je crée une suite de deux Matrices semblables.
Exemple de sortie écran :
-------------------------------------------
The two similar matrices :
A[1] = P**(-1) A[0] P
A[0] :
+179.00 +0.00i -36.00 -58.00i +9.00 +16.00i
-36.00 +58.00i +253.00 +0.00i -63.00 -1.00i
+9.00 -16.00i -63.00 +1.00i +163.00 +0.00i
A[1] :
+190.18 -40.84i -39.48 +102.41i +121.09 -90.71i
+6.44 +4.28i +138.58 -20.05i +4.29 +44.42i
+65.17 +40.06i -115.37 +6.75i +266.23 +60.89i
Press return to continue.
-------------------------------------------
The two similar matrices at the power 2 :
A[0]**2 :
+37038.00 +0.00i -16135.00 -26055.00i +5288.00 +9162.00i
-16135.00 +26055.00i +72639.00 +0.00i -27460.00 -470.00i
+5288.00 -9162.00i -27460.00 +470.00i +30876.00 +0.00i
A[1]**2 :
+45334.87 -16104.16i -20100.86 +47357.34i +52366.33 -40287.38i
+879.23 +4080.04i +17315.57 -10160.94i +1091.79 +18090.15i
+28168.67 +19141.55i -53656.45 +3114.31i +77902.56 +26265.10i
Press return to continue.
-------------------------------------------
A[1]**2 = P**(-1) A[0]**2 P
A[1]**2 :
+45334.87 -16104.16i -20100.86 +47357.34i +52366.33 -40287.38i
+879.23 +4080.04i +17315.57 -10160.94i +1091.79 +18090.15i
+28168.67 +19141.55i -53656.45 +3114.31i +77902.56 +26265.10i
P**(-1) A[0]**2 P :
+45334.87 -16104.16i -20100.86 +47357.34i +52366.33 -40287.38i
+879.23 +4080.04i +17315.57 -10160.94i +1091.79 +18090.15i
+28168.67 +19141.55i -53656.45 +3114.31i +77902.56 +26265.10i
Press return to continue
Press X return to stop