Mathc initiation/0010
Apparence
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 **X = rsymmetric_mR( i_mR(r,r),9);
double **A = r_mR( i_mR(r,r), 9);
double **AT = transpose_mR(A, i_mR(r,r));
double **AX = mul_mR(A,X, i_mR(r,r));
double **AXAT = mul_mR(AX,AT, i_mR(r,r));
clrscrn();
printf(" X ");
p_mR(X, S5,P0, C6);
printf(" A ");
p_mR(A, S5,P0, C6);
printf(" Symmetric matrix : A X AT ");
p_mR(AXAT, S6,P0, C6);
f_mR(X);
f_mR(A);
f_mR(AT);
f_mR(AX);
f_mR(AXAT);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R4)+R1);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Toutes matrices congruentes à une matrice symétrique est symétrique.
Exemple de sortie écran :
X
+4 -4 -7 +2 -7
-4 +8 +4 +9 -6
-7 +4 -9 -9 -3
+2 +9 -9 -3 +5
-7 -6 -3 +5 -1
A
+7 -5 -7 +8 -3
-7 -4 +6 -6 -3
-5 +5 -1 -7 -5
-8 -3 +1 +3 +8
+3 -9 -9 +3 -8
Symmetric matrix : A X AT
+1260 -1421 -807 -784 +696
-1421 +1153 +670 +371 -896
-807 +670 -137 +113 -1225
-784 +371 +113 +1188 -693
+696 -896 -1225 -693 -58
Press return to continue
Press X return to stop