Mathc matrices/01u
Apparence
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 = rsymmetric_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;
}
/* ------------------------------------ */
/* ------------------------------------ */
Si l'inverse d'une matrice symétrique existe, il est symétrique.
Exemple de sortie écran :
A :
+2 +2 +2 -3 +3
+2 -8 +6 -8 +2
+2 +6 -2 +2 +3
-3 -8 +2 -6 -6
+3 +2 +3 -6 +2
invA :
-1.30435 +0.21739 +0.08696 -0.30435 +0.69565
+0.21739 -0.18207 -0.22283 -0.03261 +0.09239
+0.08696 -0.22283 -0.98913 -0.41304 +0.33696
-0.30435 -0.03261 -0.41304 -0.30435 +0.19565
+0.69565 +0.09239 +0.33696 +0.19565 -0.55435
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