Mathc complexes/c091a
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = r_mZ( i_mZ(r,r),99.);
double **Inv = i_mZ(r,r);
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);
f_mZ(Inv);
f_mZ(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R3)+R1);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Vérifier le résultat avec octave. Exemple de sortie écran :
------------------------------------
A
-39 -71i +28 -45i -67 +10i
+90 -17i +64 -25i -71 +52i
+58 -95i -77 -53i +82 -15i
Press return to continue.
------------------------------------
invgj_mZ(A,invA);
-3.9897e-03-3.5139e-04i +6.6885e-03+3.1050e-03i +4.5529e-03-5.2070e-04i
+1.7498e-03+1.2785e-02i -7.3726e-03-8.5534e-03i -9.8613e-03+5.6986e-03i
-4.8329e-03+7.8790e-03i -8.1257e-03-8.7309e-03i -4.0740e-03+3.8751e-03i
inv_mZ(A,Inv); :
-3.9897e-03-3.5139e-04i +6.6885e-03+3.1050e-03i +4.5529e-03-5.2070e-04i
+1.7498e-03+1.2785e-02i -7.3726e-03-8.5534e-03i -9.8613e-03+5.6986e-03i
-4.8329e-03+7.8790e-03i -8.1257e-03-8.7309e-03i -4.0740e-03+3.8751e-03i
Press return to continue.
------------------------------------
Copy/Past into the octave window.
A=[
-39-71*i,+28-45*i,-67+10*i;
+90-17*i,+64-25*i,-71+52*i;
+58-95*i,-77-53*i,+82-15*i]
inv(A)
-3.9897e-03-3.5139e-04i +6.6885e-03+3.1050e-03i +4.5529e-03-5.2070e-04i
+1.7498e-03+1.2785e-02i -7.3726e-03-8.5534e-03i -9.8613e-03+5.6986e-03i
-4.8329e-03+7.8790e-03i -8.1257e-03-8.7309e-03i -4.0740e-03+3.8751e-03i
Press return to continue
Press X to stop