Mathc matrices/01q
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 = rdiag_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 +0 +0 +0 +0
+0 +7 +0 +0 +0
+0 +0 -6 +0 +0
+0 +0 +0 -5 +0
+0 +0 +0 +0 -2
invA :
+0.14286 -0.00000 +0.00000 +0.00000 +0.00000
-0.00000 +0.14286 +0.00000 +0.00000 +0.00000
+0.00000 +0.00000 -0.16667 -0.00000 -0.00000
+0.00000 +0.00000 -0.00000 -0.20000 -0.00000
+0.00000 +0.00000 -0.00000 -0.00000 -0.50000
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