Mathc complexes/a28
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 = i_mZ(r,r);
double **b = r_mZ( i_mZ(r,C1),99);
double **Ab = i_Abr_Ac_bc_mZ(r,r,C1);
do
{
r_mZ(A,999);
printf(".");
}while(!det_Z(A).r);
c_A_b_Ab_mZ(A,b,Ab);
clrscrn();
printf(" A :");
p_mZ(A, S5,P0, S4,P0, C6);
printf(" b :");
p_mZ(b, S5,P0, S4,P0, C6);
stop();
clrscrn();
printf(" Copy/Past into the octave window.\n\n");
p_Octave_mZ(Ab,"Ab",P0, P0);
printf(" rref(Ab,.00000000001)\n\n");
printf(" gj_mZ(Ab) :");
p_mZ(gj_mZ(Ab), S1,P4, S1,P4, C3);
f_mZ(Ab);
f_mZ(b);
f_mZ(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R2)+R2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
.
Exemple de sortie écran :
------------------------------------
A :
-194-129i -57+609i -77-659i -446+691i
+797-623i -217 +92i +482+547i +533-597i
-616+647i +63+226i +197+114i +972-249i
+402-363i -22-497i -970-448i +777+386i
b :
+771-502i
+8-690i
+331+564i
-327+510i
Press return to continue.
------------------------------------
Copy/Past into the octave window.
Ab=[
-194-129*i,-57+609*i,-77-659*i,-446+691*i,+771-502*i;
+797-623*i,-217+92*i,+482+547*i,+533-597*i,+8-690*i;
-616+647*i,+63+226*i,+197+114*i,+972-249*i,+331+564*i;
+402-363*i,-22-497*i,-970-448*i,+777+386*i,-327+510*i]
rref(Ab,.00000000001)
gj_mZ(Ab) :
+1.0000+0.0000i -0.0000-0.0000i -0.0000-0.0000i
+0.0000-0.0000i +1.0000+0.0000i -0.0000-0.0000i
+0.0000+0.0000i +0.0000+0.0000i +1.0000-0.0000i
+0.0000+0.0000i +0.0000+0.0000i -0.0000+0.0000i
+0.0000+0.0000i +0.3847-0.7576i
+0.0000-0.0000i -1.3931-1.3793i
+0.0000+0.0000i -0.5462+0.1895i
+1.0000+0.0000i -0.0844+0.2614i
Press return to continue
Press X to stop