Mathc matrices/a88
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define TAB R4
#define RCA R3
/* ------------------------------------ */
void fun(void)
{
double **A[TAB];
double **P[TAB];
double **InvP[TAB];
double **T = i_mR(RCA,RCA);
int c;
for(c=C0; c<TAB; c++)
{
A[c] = i_mR(RCA,RCA);
P[c] = r_mR(i_mR(RCA,RCA),99);
InvP[c] = inv_mR(P[c],i_mR(RCA,RCA));
}
rsymmetric_mR(A[0],99);
for(c=C0; c<(TAB-C1); c++)
{
mul_mR(InvP[c],A[c],T);
mul_mR(T,P[c],A[c+C1]);
}
clrscrn();
for(c=C0; c<TAB; c++)
{
printf(" A[%d] : \t\t\t det = %+.4f ",c,det_R(A[c]));
p_mR(A[c],S9,P2,C6);
}
for(c=C0; c<TAB; c++)
{
f_mR(A[c]);
f_mR(P[c]);
f_mR(InvP[c]);
}
f_mR(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] : det = -47975.0000
+53.00 -3.00 -17.00
-3.00 +24.00 -47.00
-17.00 -47.00 +64.00
A[1] : det = -47975.0000
+16.23 -25.21 -22.07
-209.38 -99.20 -118.16
+275.75 +195.33 +223.98
A[2] : det = -47975.0000
-1283.66 +1415.04 -356.11
-840.02 +936.67 -227.70
+1596.96 -1677.57 +487.99
A[3] : det = -47975.0000
+84.67 -325.25 -156.78
-109.81 +1458.30 +669.59
+251.72 -3046.14 -1401.97
Press return to continue
Press X return to stop