Mathc complexes/a173
Installer et compiler ce fichier dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define TAB R4
#define RCA R3
/* ------------------------------------ */
void fun(void)
{
double **A[TAB];
double **P[TAB];
double **InvP[TAB];
double **T = i_mZ(RCA,RCA);
int c;
for(c=C0; c<TAB; c++)
{
A[c] = i_mZ(RCA,RCA);
P[c] = r_mZ(i_mZ(RCA,RCA),99);
InvP[c] = inv_mZ(P[c],i_mZ(RCA,RCA));
}
rcsymmetric_mZ(A[0],99);
for(c=C0; c<(TAB-C1); c++)
{
mul_mZ(InvP[c],A[c],T);
mul_mZ(T,P[c],A[c+C1]);
}
clrscrn();
for(c=C0; c<TAB; c++)
{
printf(" A[%d] : \t\t\t trace = ",c);
p_Z(trace_Z(A[c]), S4,P2, S5,P2);
p_mZ(A[c],S10,P2,S10,P2,C6);
}
for(c=C0; c<TAB; c++)
{
f_mZ(A[c]);
f_mZ(P[c]);
f_mZ(InvP[c]);
}
f_mZ(T);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do{
fun();
}while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Je crée une suite de quatre Matrices semblables.
Exemple de sortie écran :
-------------------------------------------
A[0] : trace = +57994.00+0.00i
+27792.00 +0.00i +14500.00 +8039.00i +5829.00 -14071.00i
+14500.00 -8039.00i +16373.00 +0.00i -1679.00 -14601.00i
+5829.00 +14071.00i -1679.00 +14601.00i +13829.00 +0.00i
A[1] : trace = +57994.00-0.00i
+6862.26 -502.49i +521.25 -6664.52i -2170.30 +4890.93i
+6403.62 -1510.00i +29945.57 -9630.23i -21500.89 +9798.72i
-4771.84 -41.84i -25833.28 -18464.47i +21186.18 +10132.73i
A[2] : trace = +57994.00-0.00i
+31030.22 +2855.18i -9408.28 +7511.29i +6449.29 -606.61i
-18342.41 -29458.93i +16716.79 +11867.93i -14750.10 -6004.83i
+30408.35 -20172.71i -12708.87 +13781.23i +10246.99 -14723.11i
A[3] : trace = +57994.00-0.00i
+28015.54 -11626.43i -436.78 -3061.76i +26359.22 -20539.27i
+27346.44 -18421.05i +797.77 -4534.00i +33611.17 -20597.62i
+16270.25 +15283.62i +2964.96 -2206.61i +29180.69 +16160.42i
Press return to continue
Press X return to stop