Mathc complexes/a136
Installer et compiler ces fichiers dans votre répertoire de travail.
c00b.c |
---|
/* ------------------------------------ */
/* Save as : c00b.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void AplsB(int r)
{
double **A = i_mZ(r,r);
double **B = i_mZ(r,r);
double **C = i_mZ(r,r);
double **T = i_mZ(r,r);
r_commute3_mZ(A,B,C,9);
clrscrn();
printf(" A : ");
p_mZ(A,S5,P3,S5,P3,C6);
printf(" B : ");
p_mZ(B,S5,P3,S5,P3,C6);
printf(" C : ");
p_mZ(C,S5,P3,S5,P3,C6);
stop();
clrscrn();
printf(" AB : ");
p_mZ(mul_mZ(A,B,T),S5,P5,S5,P5,C6);
printf(" BA : ");
p_mZ(mul_mZ(B,A,T),S5,P5,S5,P5,C6);
stop();
clrscrn();
printf(" AC : ");
p_mZ(mul_mZ(A,C,T),S5,P5,S5,P5,C6);
printf(" CA : ");
p_mZ(mul_mZ(C,A,T),S5,P5,S5,P5,C6);
stop();
clrscrn();
printf(" BC : ");
p_mZ(mul_mZ(B,C,T),S5,P5,S5,P5,C6);
printf(" CB : ");
p_mZ(mul_mZ(C,B,T),S5,P5,S5,P5,C6);
f_mZ(A);
f_mZ(B);
f_mZ(C);
f_mZ(T);
}
/* ------------------------------------ */
void hello(void)
{
printf("\n ");
printf("\n Three Commutative matrices ");
printf("\n **************** \n");
printf("\n ");
printf("\n ");
printf("\n \n");
stop();
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
hello();
do
{
AplsB(RC3);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
A :
+0.178-0.675i -1.273-0.193i +0.319+1.973i
+0.513+0.066i +1.594-0.237i -0.671-0.794i
+0.242-0.846i -0.253-1.059i -0.481+0.911i
B :
+0.528+0.309i +0.690-0.266i -0.440-0.767i
+0.005-0.066i -0.416-0.314i -0.006+0.756i
-0.023+0.181i -0.247+0.309i +0.780+0.005i
C :
-0.084+0.010i -0.017+0.124i +0.096-0.076i
-0.090+0.011i -0.005+0.148i +0.117-0.122i
-0.034+0.083i +0.128+0.076i -0.057-0.158i
Press return to continue.
AB :
-0.08091-0.20486i -0.27706-0.42148i -0.20430+0.73893i
+0.40176-0.01638i +0.04626-0.50463i -0.52452+0.16101i
+0.16369-0.46808i -0.44868-0.50178i -0.33259+0.70949i
BA :
-0.08091-0.20486i -0.27706-0.42148i -0.20430+0.73893i
+0.40176-0.01638i +0.04626-0.50463i -0.52452+0.16101i
+0.16369-0.46808i -0.44868-0.50178i -0.33259+0.70949i
Press return to continue.
AC :
-0.06672+0.02179i +0.00588+0.12301i +0.08664-0.10872i
-0.09572+0.00961i -0.01504+0.14693i +0.12489-0.10375i
-0.03686+0.09532i +0.12785+0.09218i -0.02885-0.16873i
CA :
-0.06672+0.02179i +0.00588+0.12301i +0.08664-0.10872i
-0.09572+0.00961i -0.01504+0.14693i +0.12489-0.10375i
-0.03686+0.09532i +0.12785+0.09218i -0.02885-0.16873i
Press return to continue.
BC :
-0.02796+0.00010i -0.00940+0.03182i +0.02635-0.01255i
-0.02162+0.00319i -0.00166+0.03796i +0.02820-0.03510i
-0.00794+0.01864i +0.03262+0.01594i -0.02334-0.03806i
CB :
-0.02796+0.00010i -0.00940+0.03182i +0.02635-0.01255i
-0.02162+0.00319i -0.00166+0.03796i +0.02820-0.03510i
-0.00794+0.01864i +0.03262+0.01594i -0.02334-0.03806i
Press return to continue
Press X return to stop