Mathc complexes/02d
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define FACTOR_E +1.E-2
#define RCA RC3
/* ------------------------------------ */
void fun(void)
{
double d[RCA*(RCA*C2)] ={
1,0, 0,0, 0,0,
0,0, 2,0, 0,0,
0,0, 0,0, 3,0};
double **D = ca_A_mZ(d, i_mZ(RCA,RCA));
//double **D = erase_i_mZ(rdiag_mZ( i_mZ(RCA,RCA),99));
double **A = rdefpos_diag_mZ(D, i_mZ(RCA,RCA),9);
double **EigsValue = i_mZ(RCA,C1);
clrscrn();
printf(" Copy/Past into the octave windows \n\n");
p_Octave_mZ(A,"a",P9,P9);
printf(" format short e\n"
" E = eigs (a,%d)\n\n", RCA);
eigs_mZ(A,EigsValue);
printf(" EigsValue :");
p_mZ(EigsValue, S10,P4, S10,P4, C4);
f_mZ(D);
f_mZ(A);
f_mZ(EigsValue);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun();
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Choisir les valeurs propres : Valeurs propres réelles. :
double **D = ca_A_mZ(d, i_mZ(RCA,RCA));
Permet de choisir les valeurs propres.
double **D = erase_i_mZ(rdiag_mZ( i_mZ(RCA,RCA),99));
Cet exemple donne des valeurs propres aléatoires.
Exemple de sortie écran :
Copy/Past into the octave windows
a=[
+1.995265712+0.000000000*i,+0.492300075-0.107580943*i,-0.424849151+0.368637148*i;
+0.492300075+0.107580943*i,+2.295208684+0.000000000*i,-0.307776691-0.499176682*i;
-0.424849151-0.368637148*i,-0.307776691+0.499176682*i,+1.709525604+0.000000000*i]
format short e
E = eigs (a,3)
EigsValue :
+3.0000 -0.0000i
+2.0000 +0.0000i
+1.0000 +0.0000i
Press return to continue
Press X return to stop