Mathc complexes/a319
Valeurs propres, Valeurs singulières
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 = rlower_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 :
+5 +2i +0 +0i +0 +0i +0 +0i
-5 +9i -4 +7i +0 +0i +0 +0i
+1 +9i +2 -7i -7 +8i +0 +0i
+5 -1i +8 -1i +9 +1i -8 +1i
EigsValue :
-7 +8i
-7 +5i
-5 +3i
+5 +2i
Sum of the eigenvalues of A = -14 +18i
Trace of the matrix A = -14 +18i
Press return to continue
Press X return to stop