Mathc complexes/030
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)] ={
+36.313679157,+0.000000000, +19.585408427,-0.742196710, -15.875721237,+0.689662875, +8.211253265,+22.976851849,
+19.585408427,+0.742196710, +63.726719706,+0.000000000, +10.890345307,+2.396948766, -1.434784341,+15.056472852,
-15.875721237,-0.689662875, +10.890345307,-2.396948766, +16.126426155,-0.000000000, -3.467769379,-0.518070163,
+8.211253265,-22.976851849, -1.434784341,-15.056472852, -3.467769379,+0.518070163, +55.833174982,+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=[
+36.313679157+0.000000000*i,+19.585408427-0.742196710*i,-15.875721237+0.689662875*i,+8.211253265+22.976851849*i;
+19.585408427+0.742196710*i,+63.726719706+0.000000000*i,+10.890345307+2.396948766*i,-1.434784341+15.056472852*i;
-15.875721237-0.689662875*i,+10.890345307-2.396948766*i,+16.126426155-0.000000000*i,-3.467769379-0.518070163*i;
+8.211253265-22.976851849*i,-1.434784341-15.056472852*i,-3.467769379+0.518070163*i,+55.833174982+0.000000000*i]
format short e
[V, E] = eigs (a,4)
Press return to continue.
V :
+0.1123 +0.4732i +0.2751 +0.1940i -0.3012 -0.4676i -0.1337 -0.5682i
+0.0279 +0.6400i -0.1939 -0.6645i +0.1242 -0.1500i +0.0334 +0.2674i
-0.0221 -0.0131i -0.2698 -0.2872i +0.2822 +0.4536i -0.1337 -0.7354i
+0.5937 -0.0000i +0.5023 +0.0000i +0.6060 +0.0000i +0.1671 +0.0000i
EigsValue :
+92.0000 +0.0000i
+52.0000 -0.0000i
+28.0000 -0.0000i
+0.0000 -0.0000i
Press return to continue.