Calculating EigenValues with CLAPACK



Hi,
This may be a lame question but, can you help me about calculating
eigenvalues with CLAPACK?
I have tried a simple C code to accomplish this for a 4x4 symmetric
upper-triangle matrix:

1 2 3 4
x 5 6 7
x x 8 9
x x x 10

Here is my code:

float ap[]={1,2,3,4,5,6,7,8,9,10};
float d[4];
float e[3];
float tau[3];
long info;
long n=4;
long ldz=n; // When <n CLAPACK gives parameter error, otherwise VC++
gives Access Violation
float work=(2*n)-2;
ssptrd_("U",&n,ap,d,e,tau,&info);
printf("%d\n",info); // This step outputs 0
ssteqr_("V",&n,d,e,ap,&ldz,&work,&info);
printf("%d\n",info);

.



Relevant Pages

  • Re: Calculating EigenValues with CLAPACK
    ... float d; ... the matrix ap must be stroed in column order, read the "readme" for clapack. ... in ssteqr you want the eigenvalues too hence you must supply the pointer ... transformation used for computing the tridiagonal form. ...
    (sci.math.num-analysis)
  • Re: Newby: More VC6 errors...
    ... I am trying to typecast an int and a float into a basic_string. ... The help files are less than helpful. ... How do I accomplish this? ...
    (microsoft.public.vc.language)
  • Re: "Shifting" floating point numbers
    ... powers of two? ... mantissa. ... But can I write C code to accomplish this ... the float variable. ...
    (comp.lang.c)
  • Re: Library or Source Code for Eigenvalue of Float matrix
    ... > I have a program written in C where I create a matrix as a 2d array ... > in float. ... This is somewhat off topic for comp.lang.c, but you can find eigenvalues ... Department of Economics ...
    (comp.unix.programmer)
  • Newby: More VC6 errors...
    ... I am trying to typecast an int and a float into a basic_string. ... The help files are less than helpful. ... How do I accomplish this? ... The trouble is I haven't touched C/C++ in 10 years. ...
    (microsoft.public.vc.language)