Mathc complexes/a96
trace_mZ(); ... ... det_Z();
Installer et compiler ce fichier dans votre répertoire de travail.
c00b.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define FACTOR_E +1.E-2
#define RA R3
/* ------------------------------------ */
void fun(void)
{
double **A = r_hermitian_mZ( i_mZ(RA,RA),99);
double **V = eigs_V_mZ(A, i_mZ(RA,RA),FACTOR_E);
double **cV_T = ctranspose_mZ(V, i_mZ(RA,RA));
double **cV_TA = mul_mZ(cV_T,A, i_mZ(RA,RA));
double **EigsValue = mul_mZ(cV_TA,V, i_mZ(RA,RA));
clrscrn();
printf(" A :");
p_mZ(A, S8,P0, S6,P0, C3);
printf(" EigsValue = cV_T * A * V");
p_mZ(EigsValue, S10,P2, S6,P2, C3);
printf("\n trace_Z(A) \t\t= ");
p_Z(trace_Z(A), S5,P2, S4,P2);
printf("\n trace_Z(EigsValue) \t= ");
p_Z(trace_Z(EigsValue), S5,P2, S4,P2);
printf("\n");
f_mZ(A);
f_mZ(V);
f_mZ(cV_T);
f_mZ(cV_TA);
f_mZ(EigsValue);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun();
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
A :
+23068 +0i -6722 +9046i +1130 -2668i
-6722 -9046i +20275 +0i +4460-10331i
+1130 +2668i +4460+10331i +19559 +0i
EigsValue = cV_T * A * V
+36171.28 +0.00i +0.00 +0.00i -0.00 -0.00i
+0.00 -0.00i +22962.20 +0.00i -0.00 -0.00i
-0.00 +0.00i -0.00 +0.00i +3768.52 +0.00i
trace_Z(A) = +62902.00+0.00i
trace_Z(EigsValue) = +62902.00+0.00i
Press return to continue
Press X to stop