Mathc matrices/02m
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = rcentrosymmetric_mR( i_mR(r,r),9.);
double **B = rcentrosymmetric_mR( i_mR(r,r),9.);
double **J = J_mR( i_mR(r,r));
double **AB = mul_mR(A,B, i_mR(r,r));
double **AJ = mul_mR(A,J, i_mR(r,r));
double **JAB = mul_mR(J,AB, i_mR(r,r));
double **AJB = mul_mR(AJ,B, i_mR(r,r));
double **ABJ = mul_mR(AB,J, i_mR(r,r));
clrscrn();
printf(" A :");
p_mR(A, S5,P0,C7);
printf(" B :");
p_mR(B, S5,P0,C7);
printf(" J :");
p_mR(J, S5,P0,C7);
stop();
clrscrn();
printf(" JAB :");
p_mR(JAB, S5,P0,C7);
printf(" AJB :");
p_mR(AJB, S5,P0,C7);
printf(" ABJ :");
p_mR(ABJ, S5,P0,C7);
f_mR(A);
f_mR(B);
f_mR(J);
f_mR(AB);
f_mR(AJ);
f_mR(JAB);
f_mR(AJB);
f_mR(ABJ);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun( rp_I(RC2)*RC2 + RC1);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Le produit de la matrice AB est centrosymétrique, puisque JAB = AJB = ABJ
Exemple de sortie écran :
A :
-5 -8 -9
-1 +2 -1
-9 -8 -5
B :
+3 +8 +6
+6 +1 +6
+6 +8 +3
J :
+0 +0 +1
+0 +1 +0
+1 +0 +0
Press return to continue.
JAB :
-105 -120 -117
+3 -14 +3
-117 -120 -105
AJB :
-105 -120 -117
+3 -14 +3
-117 -120 -105
ABJ :
-105 -120 -117
+3 -14 +3
-117 -120 -105
Press return to continue
Press X return to stop