Mathc matrices/Conclusion
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00d.c |
|---|
/* ------------------------------------ */
/* Save as : c00d.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define ARRAY A2
#define RCA R5
#define POW 3
/* ------------------------------------ */
void fun(void)
{
double **A[ARRAY];
double **A_n[ARRAY];
double **P = r_mR( i_mR(RCA,RCA),99);
double **InvP = inv_mR(P, i_mR(RCA,RCA) );
double **T = i_mR(RCA,RCA);
double **InvP_A0n_P = i_mR(RCA,RCA);
int i;
for(i=A0; i<ARRAY; i++)
{
A[i] = i_mR(RCA,RCA);
A_n[i] = i_mR(RCA,RCA);
}
rsymmetric_mR(A[R0],99);
mul_mR(InvP,A[A0],T);
mul_mR(T,P,A[A0+A1]);
clrscrn();
printf(" The two similar matrices :\n\n"
" A[%d] = InvP A[%d] P \n\n",A1,A0);
for(i=A0; i<ARRAY; i++)
{
printf(" A[%d] : ",i);
p_mR(A[i], S12,P2,C6);
}
stop();
clrscrn();
for(i=A0; i<ARRAY; i++)
{
pow_mR(POW,A[i],A_n[i]);
}
mul_mR(InvP,A_n[A0],T);
mul_mR(T,P,InvP_A0n_P);
printf(" A[%d] = InvP A[%d] P \n\n"
" A[%d]**%d = InvP A[%d]**%d P \n\n",
A1,A0, A1,POW, A0,POW);
printf(" A[%d]**%d : ",A1,POW);
p_mR(A_n[1], S12,P2,C6);
printf(" InvP A[%d]**%d P : ",A0,POW);
p_mR(InvP_A0n_P, S12,P2,C6);
for(i=A0; i<ARRAY; i++)
{
f_mR(A[i]);
f_mR(A_n[i]);
}
f_mR(P);
f_mR(InvP);
f_mR(T);
f_mR(InvP_A0n_P);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do{
fun();
}while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
The two similar matrices :
A[1] = InvP A[0] P
A[0] :
+56.00 -80.00 +61.00 -97.00 -11.00
-80.00 -17.00 +95.00 +57.00 -90.00
+61.00 +95.00 -76.00 -63.00 +86.00
-97.00 +57.00 -63.00 +10.00 -44.00
-11.00 -90.00 +86.00 -44.00 +38.00
A[1] :
+220.23 -198.43 +21.57 +184.12 -4.64
-58.03 +75.87 -3.53 +4.42 +39.50
-75.65 +33.67 +21.76 -136.44 +20.16
-131.76 +14.48 -81.09 -169.39 +60.50
+323.82 -98.88 +69.43 +246.53 -137.47
Press return to continue.
A[1] = InvP A[0] P
A[1]**3 = InvP A[0]**3 P
A[1]**3 :
+11582192.73 -11220260.40 +570630.82 +7118419.21 -2702761.27
-2390235.16 +2152187.66 -196885.84 -1251816.58 +780885.55
-5120020.76 +1666396.70 -1252873.23 -4796516.04 +2681526.06
-8105377.10 +379769.16 -3167165.76 -8242311.00 +5275899.84
+16521648.24 -6952159.42 +3795024.71 +13376526.98 -8123255.16
InvP A[0]**3 P :
+11582192.73 -11220260.40 +570630.82 +7118419.21 -2702761.27
-2390235.16 +2152187.66 -196885.84 -1251816.58 +780885.55
-5120020.76 +1666396.70 -1252873.23 -4796516.04 +2681526.06
-8105377.10 +379769.16 -3167165.76 -8242311.00 +5275899.84
+16521648.24 -6952159.42 +3795024.71 +13376526.98 -8123255.16
Press return to continue
Press X return to stop