< Mathc complexes
Installer et compiler ces fichiers dans votre répertoire de travail.
![]() |
gj_z.c ' |
---|
/* ------------------------------------ */
/* Save as : gj_z.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = i_mZ(r,r);
double **b = i_mZ(r, C1);
double **Ab = i_AbR0_mZ(r,r,C1);
/* i_AbR0_mZ(R_Ab,C_A,C_b));*/
do
{
r_mZ(A,999);
printf(".");
}while(!det_Z(A).r);
clrscrn();
printf(" A :");
p_mZ(A,5,0,5,0,5);
printf(" b :");
p_mZ(r_mZ(b,999.),5,0,5,0,5);
stop();
clrscrn();
printf(" Copy/Past into the octave window.\n\n");
p_octave_mZ(c_A_b_Ab_mZ(A,b,Ab),"Ab",1,0, 0);
printf(" rref(Ab,.00000000001)\n\n");
printf(" gj_mZ(Ab) :");
p_mZ(gj_mZ(Ab),1,5,1,5,3);
f_mZ(Ab);
f_mZ(b);
f_mZ(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(4)+1);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
------------------------------------
A :
+230 -561i +366 -613i +136 -875i
-985 -849i +424 +590i +428 +366i
-303 -423i -645 -371i -607 +76i
b :
-827 +234i
-655 -289i
-857 -343i
Press return to continue.
------------------------------------
Copy/Past into the octave window.
Ab=[
+230-561*i,+366-613*i,+136-875*i,-827+234*i;
-985-849*i,+424+590*i,+428+366*i,-655-289*i;
-303-423*i,-645-371*i,-607+76*i,-857-343*i]
rref(Ab,.00000000001)
gj_mZ(Ab) :
+1.00000-0.00000i +0.00000+0.00000i +0.00000-0.00000i
-0.00000-0.00000i +1.00000+0.00000i -0.00000+0.00000i
+0.00000+0.00000i +0.00000+0.00000i +1.00000-0.00000i
+0.77010-0.76232i
+3.16041-1.79068i
-3.94230-0.11352i
Press return to continue
Press X to stop
Cet article est issu de Wikibooks. Le texte est sous licence Creative Commons - Attribution - Partage dans les Mêmes. Des conditions supplémentaires peuvent s'appliquer aux fichiers multimédias.