Mathc complexes/a94
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define RCA RC3
/* ------------------------------------ */
void fun(void)
{
double a[RCA*(RCA*C2)] ={ +81, +82, -14, -66, -71, +1,
+69, +85, +11, +72, +9, -93,
-54, -93, -30, +10, -78, -7 };
double **A = ca_A_mZ(a, i_mZ(RCA,RCA));
double **Inv = i_mZ(RCA,RCA);
clrscrn();
printf(" A\n");
p_mZ(A, S5,P0, S4,P0, C6);
stop();
clrscrn();
printf(" invgj_mZ(A,invA);");
pE_mZ(invgj_mZ(A,Inv), S1,P4, S1,P4, C3);
printf(" inv_mZ(A,Inv); :");
pE_mZ(inv_mZ(A,Inv), S1,P4, S1,P4, C3);
stop();
clrscrn();
printf(" Copy/Past into the octave window.\n\n");
p_Octave_mZ(A,"A",P0, P0);
printf(" inv(A)\n");
pE_mZ(Inv, S1,P4, S1,P4, C3);
stop();
f_mZ(Inv);
f_mZ(A);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Vérifier le résultat avec octave. Exemple de sortie écran :
A
+81 +82i -14 -66i -71 +1i
+69 +85i +11 +72i +9 -93i
-54 -93i -30 +10i -78 -7i
Press return to continue.
invgj_mZ(A,invA);
+1.0744e-03-3.6968e-03i +1.6528e-03-2.1990e-03i -3.2322e-03+1.4445e-03i
-3.7501e-03+3.8834e-03i -1.6217e-03-7.2304e-03i -5.6218e-03-1.9791e-03i
-4.2354e-03-3.1598e-04i -2.0086e-03+2.3050e-03i -6.1355e-03+3.4448e-03i
inv_mZ(A,Inv); :
+1.0744e-03-3.6968e-03i +1.6528e-03-2.1990e-03i -3.2322e-03+1.4445e-03i
-3.7501e-03+3.8834e-03i -1.6217e-03-7.2304e-03i -5.6218e-03-1.9791e-03i
-4.2354e-03-3.1598e-04i -2.0086e-03+2.3050e-03i -6.1355e-03+3.4448e-03i
Press return to continue.
Copy/Past into the octave window.
A=[
+81+82*i,-14-66*i,-71+1*i;
+69+85*i,+11+72*i,+9-93*i;
-54-93*i,-30+10*i,-78-7*i]
inv(A)
+1.0744e-03-3.6968e-03i +1.6528e-03-2.1990e-03i -3.2322e-03+1.4445e-03i
-3.7501e-03+3.8834e-03i -1.6217e-03-7.2304e-03i -5.6218e-03-1.9791e-03i
-4.2354e-03-3.1598e-04i -2.0086e-03+2.3050e-03i -6.1355e-03+3.4448e-03i
Press return to continue.