Band matrix storage issue

Band matrix storage issue

I get wrong result while computing eigenvalues of a symmetric matrix in band storage using LAPACK routine "dsbev".
Here is code example. Consider matrix A=E. A is in band storage AB with one additional zero super-diagonal.

#include "include/mkl.h"
#define N 4

int main() {
double AB[2][N]={0,0,0,0,1,1,1,1};
int n=N;
int ldab=2;
int kd=1;
int lwork=3*N;
int ldz=1;
int info;
double work[3*N];
double w[N];
double z[1];
dsbev ("N", "U", &n, &kd, *AB, &ldab, w, z, &ldz, work, &info);

printf( "Eigenvalues: %g %g %g %g
", w[0], w[1], w[2], w[3]);
return 0;
}

The solution of MKL is:
-0.801938 0 0.554958 2.24698
But as we all know correct result is 1 1 1 1
What's wrong here?

Thank you.

Message Edited by galuha@gmail.com on 12-13-2004 06:50 PM

3 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

Sorry for stupid question, just woke up with fresh head and fixed it

Glad we could help :-) --Bruce

Faça login para deixar um comentário.