Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
6588 Discussions

## Problem in using dgeev

Beginner
180 Views
Dear all,

I am trying to calculate only the eigenvalues of a general 33 matrix. I don't need the eigenvectors. Please find below my code.

[cpp]#define LAPACK_N 3 #define LAPACK_LDA LAPACK_N #define LAPACK_LDVL 1 #define LAPACK_LDVR 1 // Locals. int n = LAPACK_N; int lda = LAPACK_LDA, ldvl = LAPACK_LDVL, ldvr = LAPACK_LDVR; int info, lwork; double wkopt; double* work; double a[ LAPACK_LDA*LAPACK_N ] = { 10.01, 3.98, 3.30, 0.86, 1.53, 8.26, 4.60, 7.04, 3.89 }; // Local arrays. double wr[LAPACK_N], wi[LAPACK_N]; double vl[LAPACK_LDVL*LAPACK_N], vr[LAPACK_LDVR*LAPACK_N]; // Query and allocate the optimal workspace. lwork = -1; dgeev( "N", "N", &n, a, &lda, wr, wi, vl, &ldvl, vr, &ldvr, &wkopt, &lwork, &info ); lwork = (int) wkopt; work = (double*) malloc( lwork*sizeof(double) ); // Solve eigenproblem. dgeev( "N", "N", &n, a, &lda, wr, wi, vl, &ldvl, vr, &ldvr, work, &lwork, &info );[/cpp]

When the compiler reaches the first dgetev function on line 23, I get the following error:
Unhandled exception at 0x000000013f14a35f in mycode.exe: 0xC0000005: Access violation reading location 0x0000000800169eb0. Where the address of a is 0x0000000000169eb0. I am using Intel MKL 10.3 in Visual Studio 2008 in Windows 7 64bit.

I would be thankful if someone could help me.