Mathc matrices/c081a
Installer et compiler ces fichiers dans votre répertoire de travail.
![]() |
inv_r.c |
---|
/* ------------------------------------ */
/* Save as : inv_r.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = r_mR(i_mR(r,r),9999.);
double **Inv = i_mR(r,r);
clrscrn();
printf(" Copy/Past into the octave window.\n\n");
p_octave_mR(A,"A",1,0);
printf(" inv(A)\n");
pE_mR(inv_mR(A,Inv),12,4,6);
f_mR(Inv);
f_mR(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(5)+C1);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Vérifier avec octave. Exemple de sortie écran :
Copy/Past into the octave window.
A=[
-3145,-9951,+2528,+5408,+1048,-717;
+6152,+7386,-4989,+836,+7318,+3104;
-3657,+5028,+1874,-1611,-1661,+3458;
-1945,-8605,+9920,-6917,+776,-4185;
+9318,-7189,-1797,-7155,-4967,-1711;
+8728,-9693,+1662,+2838,+5102,+4292]
inv(A)
-2.9396e-04 -1.8608e-04 -1.8975e-04 -2.9985e-05 -1.0604e-04 +1.6683e-04
-2.2152e-04 -1.1919e-04 -1.0708e-04 -1.6118e-05 -1.1186e-04 +7.5154e-05
-3.5501e-04 -2.6668e-04 -1.6587e-04 +1.8122e-05 -1.9797e-04 +2.0595e-04
-2.3889e-04 -2.2807e-04 -2.0665e-04 -7.1434e-05 -1.7030e-04 +1.5399e-04
+1.8011e-04 +2.0880e-04 +6.4168e-05 +6.9602e-05 +4.4244e-05 -8.7115e-05
+1.7883e-04 +1.1509e-04 +2.6864e-04 -1.7944e-05 +9.9698e-05 -1.4557e-05
Press return to continue
Press X to stop