I have a problem with the documentation of the DGEEV function on page 1030 of the pdf manual, namely, the lwork parameter, I am copying directly from the manual,
The dimension of the array work.
lwork ≥ max(1, 3n), and if jobvl = 'V' or jobvr = 'V', lwork <
max(1, 4n) (for real flavors);
lwork < max(1, 2n) (for complex flavors).
For good performance, lwork must generally be larger.
And for my problem I need to compute only the right eigenvectors, so I am setting jobvr = 'V', jobvl = 'N' however setting
lwork = 3*n + 5(or 4*n)
DGEEV results in -13 error for a problem size of 82X82. However setting it to 5*n or 10*n works fine. So could you please make this point clear for me?
I'll get some clarification from the MKL team about the description for lwork. Meanwhile, you can set lwork to -1 for the first call to DGEEV. When it returns it will tell you the optimal value ( via work(1) ) you should use for lwork. Then, you call DGEEV again with this optimal lwork value to do the actual computation.
This definitely looks like a mistake/misprint in MKL documentation. lwork should be constraint like “not less than” rather than “less than”. All "<" values in the description of lwork should be read as ">=".
We’ll fix it in the next release of MKL. Thank you for your attention!