Mathc matrices/05k
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define RCA C6
/* ------------------------------------ */
int main(void)
{
double a[RCA*RCA]={
+0.567743563267, +0.304424089190, -0.059677700710, -0.203424101776, +0.267148131435, -0.190855616323,
+0.304424089190, +0.785604057676, +0.042029055301, +0.143264950247, -0.188143702858, +0.134413376479,
-0.059677700710, +0.042029055301, +0.991760844584, -0.028084908937, +0.036882704058, -0.026349692872,
-0.203424101776, +0.143264950247, -0.028084908937, +0.904266630484, +0.125722520384, -0.089818517482,
+0.267148131435, -0.188143702858, +0.036882704058, +0.125722520384, +0.834894016457, +0.117954799378,
-0.190855616323, +0.134413376479, -0.026349692872, -0.089818517482, +0.117954799378, +0.915730887532
};
double **A = ca_A_mR(a,i_mR(RCA,RCA));
double **EigsValue = i_mR(RCA,C1);
clrscrn();
printf(" Copy/Past into the octave windows \n\n");
p_Octave_mR(A,"a",P12);
printf(" [V, E] = eigs (a,%d) \n\n",RCA);
eigs_mR(A,EigsValue);
printf(" EigsValue :");
p_mR(EigsValue,S10,P4,C1);
stop();
f_mR(A);
f_mR(EigsValue);
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Vérifier avec Octave.
Exemple de sortie écran :
Copy/Past into the octave windows
a=[
+0.567743563267,+0.304424089190,-0.059677700710,-0.203424101776,+0.267148131435,-0.190855616323;
+0.304424089190,+0.785604057676,+0.042029055301,+0.143264950247,-0.188143702858,+0.134413376479;
-0.059677700710,+0.042029055301,+0.991760844584,-0.028084908937,+0.036882704058,-0.026349692872;
-0.203424101776,+0.143264950247,-0.028084908937,+0.904266630484,+0.125722520384,-0.089818517482;
+0.267148131435,-0.188143702858,+0.036882704058,+0.125722520384,+0.834894016457,+0.117954799378;
-0.190855616323,+0.134413376479,-0.026349692872,-0.089818517482,+0.117954799378,+0.915730887532]
[V, E] = eigs (a,6)
EigsValue :
+1.0000
+1.0000
+1.0000
+1.0000
+1.0000
-0.0000
Press return to continue.