Linear Algebra and the C Language/a0m4
Install and compile this file in your working directory.
/* ------------------------------------ */
/* Save as : c03a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define RCA R4
/* ------------------------------------ */
int main(void)
{
double a[RCA*RCA]={
+9.387051138013, +1.478424899325, +0.973685336456, -0.700350180421,
+1.478424899325, +9.614194406175, +0.773429774749, -1.033063523876,
+0.973685336456, +0.773429774749, +10.505111304292, +1.482769644746,
-0.700350180421, -1.033063523876, +1.482769644746, +10.493643151520
};
double **A = ca_A_mR(a, i_mR(RCA,RCA));
double **EValue = eigs_mR(A, i_mR(RCA,R1));
clrscrn();
printf(" The eigenvectors associated with eigenvalues\n"
" with multiple multiplicity are not unique. \n"
" There exist several set of unit vectors that\n"
" correspond to the same eigenspace. \n\n\n"
" Copy/Paste into the octave windows\n\n");
p_Octave_mR(A,"a",P9);
printf(" [V, E] = eigs (a,%d) \n\n",RCA);
printf(" EValue:");
p_mR(EValue,S10,P3,C10);
stop();
f_mR(A);
f_mR(EValue);
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Screen output example:
The eigenvectors associated with eigenvalues
with multiple multiplicity are not unique.
There exist several set of unit vectors that
correspond to the same eigenspace.
Copy/Paste into the octave windows
a=[
+9.387051138,+1.478424899,+0.973685336,-0.700350180;
+1.478424899,+9.614194406,+0.773429775,-1.033063524;
+0.973685336,+0.773429775,+10.505111304,+1.482769645;
-0.700350180,-1.033063524,+1.482769645,+10.493643152]
[V, E] = eigs (a,4)
EValue:
+12.000
+12.000
+8.000
+8.000
Press return to continue.