Mathc complexes/034
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-3
#define RCA RC5
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double a[RCA*(RCA*C2)] ={
+33.519963947,-0.000000000, -13.693912818,+6.712740170, +6.614415988,-2.591607122, -14.832764827,-15.560900752, +5.931313432,+7.201798592,
-13.693912818,-6.712740170, +39.585869431,+0.000000000, -12.477192990,+16.370664567, +8.957620096,-4.146641673, -20.695195874,-8.986119738,
+6.614415988,+2.591607122, -12.477192990,-16.370664567, +40.575180719,+0.000000000, -10.968623618,-19.349596696, -6.548231731,+8.901841379,
-14.832764827,+15.560900752, +8.957620096,+4.146641673, -10.968623618,+19.349596696, +41.873262178,-0.000000000, +4.207151243,-10.065003488,
+5.931313432,-7.201798592, -20.695195874,+8.986119738, -6.548231731,-8.901841379, +4.207151243,+10.065003488, +28.445723725,-0.000000000
};
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",P9,P9);
printf(" format short e\n"
" [V, E] = eigs (a,%d)\n\n", RCA);
stop();
clrscrn();
eigs_V_mZ(A,V,FACTOR_E);
printf(" V :");
p_mZ(V, S10,P4, S8,P4, C4);
eigs_mZ(A,EigsValue);
printf(" EigsValue :");
p_mZ(EigsValue, S10,P4, S8,P4, C4);
stop();
f_mZ(A);
f_mZ(V);
f_mZ(EigsValue);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de référence : Il permet de vérifier les calculs.
Exemple de sortie écran :
Copy/Past into the octave windows
a=[
+33.519963947-0.000000000*i,-13.693912818+6.712740170*i,+6.614415988-2.591607122*i,-14.832764827-15.560900752*i,+5.931313432+7.201798592*i;
-13.693912818-6.712740170*i,+39.585869431+0.000000000*i,-12.477192990+16.370664567*i,+8.957620096-4.146641673*i,-20.695195874-8.986119738*i;
+6.614415988+2.591607122*i,-12.477192990-16.370664567*i,+40.575180719+0.000000000*i,-10.968623618-19.349596696*i,-6.548231731+8.901841379*i;
-14.832764827+15.560900752*i,+8.957620096+4.146641673*i,-10.968623618+19.349596696*i,+41.873262178-0.000000000*i,+4.207151243-10.065003488*i;
+5.931313432-7.201798592*i,-20.695195874+8.986119738*i,-6.548231731-8.901841379*i,+4.207151243+10.065003488*i,+28.445723725-0.000000000*i]
format short e
[V, E] = eigs (a,5)
Press return to continue.
V :
+0.1183 +0.3361i +0.0936 -0.4681i +0.1250 +0.5549i -0.1900 +0.2031i
-0.3125 -0.3799i -0.5142 -0.0607i -0.0939 +0.1641i +0.2669 +0.3566i
-0.1796 +0.4924i -0.0856 -0.0625i +0.2288 -0.6364i -0.2370 +0.3206i
-0.2863 -0.4012i +0.5468 +0.0332i +0.0392 -0.1606i +0.0241 +0.5123i
+0.3367 +0.0000i +0.4390 +0.0000i +0.3950 -0.0000i +0.5498 +0.0000i
-0.0533 -0.4913i
+0.4558 -0.2190i
+0.2841 -0.1302i
-0.3552 -0.2013i
+0.4854 +0.0000i
EigsValue :
+92.0000 +0.0000i
+52.0000 -0.0000i
+28.0000 +0.0000i
+12.0000 +0.0000i
+0.0000 -0.0000i
Press return to continue.