Mathc complexes/002
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 RC4
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double a[RCA*(RCA*C2)] ={
+25072, +0, +21293,-4811, +5386,-6531, +11975,-5847,
+21293,+4811, +30848, +0, -1526,-1774, +13478,-6658,
+5386,+6531, -1526,+1774, +20007, +0, +7542,-1322,
+11975,+5847, +13478,+6658, +7542,+1322, +21250, +0 };
double **A = ca_A_mZ(a, i_mZ(RCA,RCA));
double **V = i_mZ(RCA,RCA);
double **EigsValue = i_mZ(RCA,C1);
clrscrn();
printf(" Copy/Past into the octave windows \n\n");
p_Octave_mZ(A,"a",P0,P0);
printf(" format short e\n"
" [V, E] = eigs (a,%d)\n\n", RCA);
stop();
clrscrn();
eigs_V_mZ(A,V,FACTOR_E);
printf(" V :");
pE_mZ(V, S12,P4, S12,P4, C3);
eigs_mZ(A,EigsValue);
printf(" EigsValue :");
p_mZ(EigsValue, S12,P4, S12,P4, C4);
stop();
f_mZ(A);
f_mZ(V);
f_mZ(EigsValue);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
Copy/Past into the octave windows
a=[
+25072+0*i,+21293-4811*i,+5386-6531*i,+11975-5847*i;
+21293+4811*i,+30848+0*i,-1526-1774*i,+13478-6658*i;
+5386+6531*i,-1526+1774*i,+20007+0*i,+7542-1322*i;
+11975+5847*i,+13478+6658*i,+7542+1322*i,+21250+0*i]
format short e
[V, E] = eigs (a,4)
Press return to continue.
V :
+4.8972e-01 -3.2491e-01i +1.2352e-02 -3.1358e-02i -2.3564e-01 +4.7870e-01i
+5.8126e-01 -2.5956e-01i -2.5508e-01 +3.5827e-01i -1.6780e-01 -2.1539e-01i
+1.8661e-01 +5.4231e-02i +6.9872e-01 -4.9734e-01i -2.2037e-01 -5.7021e-03i
+4.6001e-01 +1.5960e-17i +2.6435e-01 -2.3604e-17i +7.6953e-01 +0.0000e+00i
-1.3282e-01 -5.9258e-01i
-1.9928e-01 +5.3580e-01i
-2.8408e-01 +3.1206e-01i
+3.5543e-01 +3.7510e-18i
EigsValue :
+61819.1491 +0.0000i
+22896.2153 +0.0000i
+10720.5399 +0.0000i
+1741.0958 +0.0000i
Press return to continue.