- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Guys,.
I am using the LAPACKE_cheev now from MKL. I have written a piece of code with this API. However, its outputs are out of my expectation. The code is attached.
lapack_complex_float *a = (lapack_complex_float*)malloc(sizeof(lapack_complex_float)*N*N);
a[0].imag = 0;
a[0].real = 0;
a[1].imag = 1;
a[1].real = 0;
a[2].imag = 0;
a[2].real = 1;
a[3].imag = 0;
a[3].real = 0;
a[4].imag = 0;
a[4].real = 0;
a[5].imag = 0;
a[5].real = 0;
int matrix_order = LAPACK_ROW_MAJOR; //LAPACK_COL_MAJOR
const char jobz = 'N';
const char uplo = 'U';
lapack_int n = N;
lapack_int lda = N;
float *w = (float*)malloc(sizeof(float)*N);
LAPACKE_cheev(matrix_order, jobz, uplo, n, a, lda, w);
for (int i = 0; i < N; i++)
{
cout << w << endl;
}
I expect the outputs as follows:
[-1.414, 0, 1.414]
However, the outputs from my local machine is as follows:
[-4.31602e+008, -1, 1]
Could anybody help me with this issue?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the value of N in your code? The matrix 'a' doesn't look to have a square shape. I believe this is the problem. Take a look at the lapacke_cheev_row.c example in MKL, please. It can be found in the 'examples' folder in your MKL installation.
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