Mathc complexes/a347
Installer et compiler ces fichiers dans votre répertoire de travail.
![]() |
c00c.c |
---|
/* ------------------------------------ */
/* Save as : c00c.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 **D = i_mZ(r,r);
double **T = i_mZ(r,r);
double **AB = i_mZ(r,r);
double **BA = i_mZ(r,r);
rE_commute4_mZ(A,B,C,D,999,1E-2);
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);
printf(" D : ");
p_mZ(D,S5,P3,S5,P3,C6);
stop();
clrscrn();
printf(" AB : ");
p_mZ(mul_mZ(A,B,AB),S5,P5,S5,P5,C6);
printf(" BA : ");
p_mZ(mul_mZ(B,A,BA),S5,P5,S5,P5,C6);
stop();
clrscrn();
printf(" AC : ");
p_mZ(mul_mZ(A,C,AB),S5,P5,S5,P5,C6);
printf(" CA : ");
p_mZ(mul_mZ(C,A,BA),S5,P5,S5,P5,C6);
stop();
clrscrn();
printf(" BC : ");
p_mZ(mul_mZ(B,C,AB),S5,P5,S5,P5,C6);
printf(" CB : ");
p_mZ(mul_mZ(C,B,BA),S5,P5,S5,P5,C6);
stop();
clrscrn();
printf(" AD : ");
p_mZ(mul_mZ(A,D,AB),S5,P5,S5,P5,C6);
printf(" DA : ");
p_mZ(mul_mZ(D,A,BA),S5,P5,S5,P5,C6);
stop();
clrscrn();
printf(" BD : ");
p_mZ(mul_mZ(B,D,AB),S5,P5,S5,P5,C6);
printf(" DB : ");
p_mZ(mul_mZ(D,B,BA),S5,P5,S5,P5,C6);
stop();
clrscrn();
printf(" CD : ");
p_mZ(mul_mZ(C,D,AB),S5,P5,S5,P5,C6);
printf(" DC : ");
p_mZ(mul_mZ(D,C,BA),S5,P5,S5,P5,C6);
f_mZ(A);
f_mZ(B);
f_mZ(C);
f_mZ(D);
f_mZ(T);
f_mZ(AB);
f_mZ(BA);
}
/* ------------------------------------ */
void hello(void)
{
printf("\n ");
printf("\n Four 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.062+0.416i -0.283+0.094i +0.574+0.037i
-0.480+0.084i +0.058-0.141i +0.319+0.454i
+0.457-0.394i +0.359-0.009i -0.366-0.275i
B :
-0.285-0.293i +0.578+0.276i -0.409+0.391i
+1.173-0.361i +0.083+0.206i +0.430-0.603i
-0.056+0.079i +0.269-0.144i +0.730+0.086i
C :
+1.000-1.655i +1.099-0.398i -2.282-0.176i
+1.848-0.313i +0.987+0.555i -1.315-1.787i
-1.837+1.580i -1.463+0.045i +2.648+1.100i
D :
+0.541-0.896i +0.595-0.215i -1.235-0.095i
+1.000-0.169i +0.534+0.300i -0.712-0.967i
-0.994+0.855i -0.792+0.024i +1.433+0.596i
Press return to continue.
AB :
-0.22895+0.11962i +0.03746+0.13418i +0.16329+0.14131i
+0.12451-0.07068i -0.11533-0.00712i +0.29669+0.04158i
+0.21467-0.17505i +0.26639-0.04944i -0.12754-0.11250i
BA :
-0.22895+0.11962i +0.03746+0.13418i +0.16329+0.14131i
+0.12451-0.07068i -0.11533-0.00712i +0.29669+0.04158i
+0.21467-0.17505i +0.26639-0.04944i -0.12754-0.11250i
Press return to continue.
AC :
-0.85550+1.41595i -0.93984+0.34057i +1.95251+0.15018i
-1.58066+0.26746i -0.84447-0.47461i +1.12466+1.52850i
+1.57145-1.35153i +1.25186-0.03839i -2.26576-0.94134i
CA :
-0.85550+1.41595i -0.93984+0.34057i +1.95251+0.15018i
-1.58066+0.26746i -0.84447-0.47461i +1.12466+1.52850i
+1.57145-1.35153i +1.25186-0.03839i -2.26576-0.94134i
Press return to continue.
BC :
+0.51780-0.85701i +0.56884-0.20613i -1.18176-0.09090i
+0.95670-0.16188i +0.51112+0.28726i -0.68070-0.92513i
-0.95113+0.81802i -0.75769+0.02323i +1.37135+0.56975i
CB :
+0.51780-0.85701i +0.56884-0.20613i -1.18176-0.09090i
+0.95670-0.16188i +0.51112+0.28726i -0.68070-0.92513i
-0.95113+0.81802i -0.75769+0.02323i +1.37135+0.56975i
Press return to continue.
AD :
-0.46303+0.76636i -0.50867+0.18433i +1.05676+0.08128i
-0.85550+0.14476i -0.45705-0.25688i +0.60870+0.82727i
+0.85052-0.73149i +0.67755-0.02078i -1.22630-0.50948i
DA :
-0.46303+0.76636i -0.50867+0.18433i +1.05676+0.08128i
-0.85550+0.14476i -0.45705-0.25688i +0.60870+0.82727i
+0.85052-0.73149i +0.67755-0.02078i -1.22630-0.50948i
Press return to continue.
BD :
+0.28025-0.46384i +0.30787-0.11157i -0.63961-0.04920i
+0.51780-0.08761i +0.27663+0.15547i -0.36842-0.50071i
-0.51478+0.44274i -0.41009+0.01257i +0.74222+0.30837i
DB :
+0.28025-0.46384i +0.30787-0.11157i -0.63961-0.04920i
+0.51780-0.08761i +0.27663+0.15547i -0.36842-0.50071i
-0.51478+0.44274i -0.41009+0.01257i +0.74222+0.30837i
Press return to continue.
CD :
+2.50890-4.15251i +2.75623-0.99878i -5.72606-0.44043i
+4.63555-0.78436i +2.47654+1.39188i -3.29824-4.48256i
-4.60855+3.96359i -3.67128+0.11258i +6.64470+2.76063i
DC :
+2.50890-4.15251i +2.75623-0.99878i -5.72606-0.44043i
+4.63555-0.78436i +2.47654+1.39188i -3.29824-4.48256i
-4.60855+3.96359i -3.67128+0.11258i +6.64470+2.76063i
Press return to continue
Press X return to stop