Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Help! Matrix dimensions error

bennone
Beginner
206 Views
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
0 Kudos
1 Reply
Gennady_F_Intel
Moderator
206 Views
Quoting - bennone
Problem solved!

set integers length to 32bit

Benjamin,
question - what was your original length of integer when you encountered the problem?
--Gennady
0 Kudos
Reply