Mathc complexes/01d
Apparence
Installer et compiler ce fichier dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int rc)
{
double **A = r_hermitian_mZ(i_mZ(rc,rc),9);
double **B = r_hermitian_mZ(i_mZ(rc,rc),9);
double **AB = i_mZ(rc,rc);
clrscrn();
printf(" A : ");
p_mZ(A, S8,P0, S6,P0, C5);
printf(" B : ");
p_mZ(B, S8,P0, S6,P0, C5);
printf(" AB : ");
p_mZ(mul_mZ(A,B,AB), S8,P0, S6,P0, C5);
f_mZ(A);
f_mZ(B);
f_mZ(AB);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
fun(rp_I(RC3)+RC1);
while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Le produit de deux matrices hermitiennes est hermitienne si et seulement si les matrices commutent.
Exemple de sortie écran :
A :
+237 +0i -169 +14i -144 +58i -115 +27i
-169 -14i +262 +0i +187 -121i +106 -58i
-144 -58i +187 +121i +346 +0i +252 -68i
-115 -27i +106 +58i +252 +68i +330 +0i
B :
+287 +0i +36 -9i -26 -82i -9 +102i
+36 +9i +217 +0i +70 +97i +25 -68i
-26 +82i +70 -97i +315 +0i -242 -88i
-9 -102i +25 +68i -242 +88i +305 +0i
AB :
+64586 -2846i -37306+11788i -39256-33231i -529+42887i
-40881 +6530i +58591-19834i +59943+24885i -14073-39792i
-53885 -7327i +70017 +7339i +54331+78557i +13243-75045i
-44809-19471i +51105+15405i +2090+74934i +56033-55877i
Press return to continue
Press X return to stop