Mathc matrices/h08a
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 r)
{
double **A = rskewsymmetric_mR( i_mR(r,r),9);
double **ID = eye_mR( i_mR(r,r));
double **IDplsA = add_mR(ID,A, i_mR(r,r));
double **invIDplsA = inv_mR(IDplsA, i_mR(r,r));
double **A_invIDplsA = mul_mR(IDplsA,invIDplsA, i_mR(r,r));
clrscrn();
printf(" A ");
p_mR(A, S7,P3, C6);
printf(" inv(ID+A) ");
p_mR(invIDplsA, S7,P3, C6);
printf(" (ID+A) * inv(ID+A) ");
p_mR(A_invIDplsA , S7,P3, C6);
f_mR(A);
f_mR(ID);
f_mR(IDplsA);
f_mR(invIDplsA);
f_mR(A_invIDplsA);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R2)*R2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Si A est une matrice anti-symétrique, alors ID + A est inversible
Exemple de sortie écran :
A
+0.000 +8.000 +2.000 -4.000
-8.000 +0.000 -3.000 +7.000
-2.000 +3.000 +0.000 +9.000
+4.000 -7.000 -9.000 +0.000
inv(ID+A)
+0.027 -0.118 +0.098 +0.056
+0.131 +0.020 +0.040 +0.027
-0.093 -0.071 +0.025 -0.105
-0.027 -0.025 +0.117 +0.015
(ID+A) * inv(ID+A)
+1.000 +0.000 -0.000 -0.000
-0.000 +1.000 +0.000 +0.000
-0.000 +0.000 +1.000 +0.000
+0.000 -0.000 +0.000 +1.000
Press return to continue
Press X return to stop