Page 1 of 1

### Timing issues (eigenvectors of symmetric matrix)

Posted: Tue May 30, 2017 12:35 pm
Hello Everyone,

I'm trying to get all eigenvalues and eigenvectors of a real-valued symmetric matrix by using the ssyevr feature. I'm doing this in C and so using the LAPACKE_ssyevr_work(...) function. I've tested it with a trivial 4x4 matrix and the function gives the right answer and performs quickly in a fraction of a second. I think this means that I've used the function correctly in my code. However, when I try to solve my real problem with a 228x228 matrix, the function ran overnight and still was not done. According to the benchmark tests I found online for LAPACK, it should have performed in less than 10 seconds. What am I missing? Thank you very much for your help.

Here is my code
N = 228
VL = VU = 0.0
IL = IU = 0
ABSTOL = 0.0001
LWORK = 26*N
LIWORK = 10*N
support has length 2*N

LAPACKE_ssyevr_work(LAPACK_ROW_MAJOR, 'V', 'A', 'U', N, (float*) A.begin(), N, VL, VU, IL, IU, ABSTOL, &numberEigenVals, (float*) eigenValues.begin(), (float*) leftEigenVectors.begin(), N, (int*) support.begin(), (float*) WORK.begin(), LWORK, (int*) IWORK.begin(), LIWORK);

### Re: Timing issues (eigenvectors of symmetric matrix)

Posted: Tue May 30, 2017 11:29 pm
The problem is not obvious to me. Can you try (1) using LAPACKE_ssyevr instead of LAPACKE_ssyevr_work? This clear up any problem of workspace. Maybe the workspace (26*N) is too small. I do not know. Can you please LAPACKE_ssyevr on the same matrix? (2) If (1) does not work, I would suggest then to try LAPACKE_ssyevr and set ABSTOL to 0.0. ? If you want to report, we can try to think some more of what the problem can then be. Cheers, Julien.

### Re: Timing issues (eigenvectors of symmetric matrix)

Posted: Tue May 30, 2017 11:31 pm
( You are correct that for a 228x228 matrix SSYEVR should not take `overnight` to complete. So there is a problem. )

### Re: Timing issues (eigenvectors of symmetric matrix)

Posted: Wed May 31, 2017 1:06 pm
Wow. That indeed fixed it. So it must have been the small size of the workspace. Now the runtime is about 1 second. Fantastic. Thank you.