Mathc matrices/c11a3
Apparence
Trace ... ... Determinant
Installer et compiler ces fichiers dans votre répertoire de travail.
c00b.c |
---|
/* ------------------------------------ */
/* Save as : c00b.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define RA R3
/* ------------------------------------ */
void fun(void)
{
double **A = rsymmetric_mR(i_mR(RA,RA),999.);
double **EigsVector= i_mR(RA,RA);
double **T_EigsVector= i_mR(RA,RA);
double **EigsValues= i_mR(RA,RA);
double **T_EigsVectorA= i_mR(RA,RA);
clrscrn();
printf(" A :");
p_mR(A,S10,P4,C6);
eigs_V_mR(A,EigsVector);
transpose_mR(EigsVector,T_EigsVector);
mul_mR(T_EigsVector,A,T_EigsVectorA);
mul_mR(T_EigsVectorA,EigsVector,EigsValues);
printf(" EigsValues = T_EigsVector * A * EigsVector");
p_mR(EigsValues,S10,P4,C6);
printf(" trace_R(A) \t\t= %10.1f\n", trace_R(A));
printf(" trace_R(EigsValues) \t= %10.1f\n",trace_R(EigsValues));
f_mR(A);
f_mR(EigsVector);
f_mR(T_EigsVector);
f_mR(EigsValues);
f_mR(T_EigsVectorA);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun();
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
/* ------------------------------------ */
A :
+698.0000 -951.0000 -800.0000
-951.0000 +995.0000 +868.0000
-800.0000 +868.0000 +11.0000
EigsValues = T_EigsVector * A * EigsVector
+2393.3218 -0.0000 -0.0000
-0.0000 -576.4242 +0.0000
-0.0000 -0.0000 -112.8977
trace_R(A) = 1704.0
trace_R(EigsValues) = 1704.0
Press return to continue
Press X to stop