Mathc complexes/a318
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int rc)
{
double **A = rdiag_mZ(i_mZ(rc,rc),9.);
double **EigsValue = i_mZ(rc,C1);
nb_Z s = {0,0};
int r = 0;
int c = 0;
clrscrn();
printf(" A :");
p_mZ(A,S5,P0,S4,P0,C6);
printf(" EigsValue :");
p_mZ(eigs_mZ(A,EigsValue),S5,P0,S4,P0,C6);
for (r=R1,c=C1; r<A[R_SIZE][C0]; r++,c+=C2)
s = add_Z(s, i_Z(A[r][c],A[r][c+C1]));
printf(" Sum of the eigenvalues of A = ");
p_Z(s, S5,P0, S4,P0); printf("\n");
printf(" Trace of the matrix A = ");
p_Z(trace_Z(A), S5,P0, S4,P0); printf("\n\n\n");
f_mZ(A);
f_mZ(EigsValue);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R3)+R1);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
A :
+6 +7i +0 +0i +0 +0i +0 +0i
+0 +0i -7 -3i +0 +0i +0 +0i
+0 +0i +0 +0i -1 +5i +0 +0i
+0 +0i +0 +0i +0 +0i +1 -5i
EigsValue :
+6 +7i
-7 -3i
-1 +5i
+1 -5i
Sum of the eigenvalues of A = -1 +4i
Trace of the matrix A = -1 +4i
Press return to continue
Press X return to stop