Mathc matrices/01s
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int rc)
{
double **A = rupper_mR(i_mR(rc,rc),9);
double **invA = i_mR(rc,rc);
double **AinvA = i_mR(rc,rc);
clrscrn();
printf(" A : ");
p_mR(A,S4,P0,C6);
printf(" invA : ");
p_mR(inv_mR(A,invA),S4,P5,C6);
printf(" A * invA : ");
p_mR(mul_mR(A,invA,AinvA),S4,P5,C6);
f_mR(A);
f_mR(invA);
f_mR(AinvA);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
fun(rp_I(RC4)+RC1);
while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
A :
+7 +5 -3 -6 -2
+0 +5 -3 -5 +6
+0 +0 +2 -4 +6
+0 +0 +0 -9 +3
+0 +0 +0 +0 -7
invA :
+0.14286 -0.14286 +0.00000 -0.01587 -0.17007
-0.00000 +0.20000 +0.30000 -0.24444 +0.32381
-0.00000 -0.00000 +0.50000 -0.22222 +0.33333
+0.00000 +0.00000 +0.00000 -0.11111 -0.04762
+0.00000 +0.00000 +0.00000 -0.00000 -0.14286
A * invA :
+1.00000 -0.00000 +0.00000 +0.00000 +0.00000
+0.00000 +1.00000 +0.00000 +0.00000 +0.00000
+0.00000 +0.00000 +1.00000 +0.00000 +0.00000
+0.00000 +0.00000 +0.00000 +1.00000 +0.00000
+0.00000 +0.00000 +0.00000 +0.00000 +1.00000
Press return to continue
Press X return to stop