Mathc complexes/01g
Apparence
Sommaire ◀ Utilise la commande "Retour en Arrière" de ton navigateur.
Installer et compiler ce fichier dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = r_mZ( i_mZ(r,r), 9);
double **AT = ctranspose_mZ(A, i_mZ(r,r));
double **AplsAT = add_mZ(A,AT, i_mZ(r,r));
double **AmnsAT = sub_mZ(A,AT, i_mZ(r,r));
clrscrn();
printf(" A ");
p_mZ(A, S6,P0, S4,P0, C5);
printf(" Hermitian matrix : A + AT ");
p_mZ(AplsAT, S6,P0, S4,P0, C5);
printf(" Skew-Hermitian matrix : A - AT ");
p_mZ(AmnsAT, S6,P0, S4,P0, C5);
f_mZ(A);
f_mZ(AT);
f_mZ(AplsAT);
f_mZ(AmnsAT);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R4)+R1);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Soit une matrice carré A : (A+AT) est hermitienne, (A-AT) est anti-hermitienne
Exemple de sortie écran :
A
+7 +2i -9 -1i -8 +5i -7 -2i
-6 +2i -2 +9i -7 -3i -6 +7i
+1 -4i -1 +6i +2 -5i +3 +2i
+5 -4i -8 -4i +6 -2i -9 +2i
Hermitian matrix : A + AT
+14 +0i -15 -3i -7 +9i -2 +2i
-15 +3i -4 +0i -8 -9i -14 +11i
-7 -9i -8 +9i +4 +0i +9 +4i
-2 -2i -14 -11i +9 -4i -18 +0i
Skew-Hermitian matrix : A - AT
+0 +4i -3 +1i -9 +1i -12 -6i
+3 +1i +0 +18i -6 +3i +2 +3i
+9 +1i +6 +3i +0 -10i -3 +0i
+12 -6i -2 +3i +3 +0i +0 +4i
Press return to continue
Press X return to stop