- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
for university I need to compute eigenvectors of a symmetric matrix in c. I think it shoul work this way:
#include
#include
double myd[3];
double work[3];
char cV = 'V';
char cU = 'L';
int in = 3;
int im1 = -1;
int lda = 3;
int worki = -1;
double ww[3];
int li = -1;
int lw[3];
int ok;
double *test;
int main(){
test = (double*)calloc(lda*in,sizeof(double));
test[0] = 1;
test[1] = 2;
test[2] = 3;
test[3] = 2;
test[4] = 5;
test[5] = 7;
test[6] = 3;
test[7] = 7;
test[8] = 1;
fprintf(stderr,"matrix:\n%lf %lf %lf\n%lf %lf %lf\n%lf %lf %lf\n",test[0],test[3],test[6],test[1],test[4],test[7],test[2],test[5],test[8]);
dsyevd(&cV,&cU, &in,test, &lda, ww, work,&worki,lw,&li ,&ok);
fprintf(stderr,"Test: %lf, %lf, %i\n",work[0],ww[0],lw[0]);
return 0;
}
I compiled this without errors using icc or gcc.
If I try to execute this program, i'll recieve an error:
MKL ERROR: Parameter 3 was incorrect on entry to DSYEVD
I don't understand the problem, couse A is 3x3 Matrix, with order n and lda ist 3 too.
Please help!
Thanks.
Bennone
Problem solved!
set integers length to 32bit
for university I need to compute eigenvectors of a symmetric matrix in c. I think it shoul work this way:
#include
#include
double myd[3];
double work[3];
char cV = 'V';
char cU = 'L';
int in = 3;
int im1 = -1;
int lda = 3;
int worki = -1;
double ww[3];
int li = -1;
int lw[3];
int ok;
double *test;
int main(){
test = (double*)calloc(lda*in,sizeof(double));
test[0] = 1;
test[1] = 2;
test[2] = 3;
test[3] = 2;
test[4] = 5;
test[5] = 7;
test[6] = 3;
test[7] = 7;
test[8] = 1;
fprintf(stderr,"matrix:\n%lf %lf %lf\n%lf %lf %lf\n%lf %lf %lf\n",test[0],test[3],test[6],test[1],test[4],test[7],test[2],test[5],test[8]);
dsyevd(&cV,&cU, &in,test, &lda, ww, work,&worki,lw,&li ,&ok);
fprintf(stderr,"Test: %lf, %lf, %i\n",work[0],ww[0],lw[0]);
return 0;
}
I compiled this without errors using icc or gcc.
If I try to execute this program, i'll recieve an error:
MKL ERROR: Parameter 3 was incorrect on entry to DSYEVD
I don't understand the problem, couse A is 3x3 Matrix, with order n and lda ist 3 too.
Please help!
Thanks.
Bennone
Problem solved!
set integers length to 32bit
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - bennone
Problem solved!
set integers length to 32bit
set integers length to 32bit
Benjamin,
question - what was your original length of integer when you encountered the problem?
--Gennady
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page