SelfAdjointEigenSolver_LAPACKE.h uses lapack-DSYEV to compute all eigenvalues. Lapack documentation says the below.
For lapack, there are 2 routines.
* DSYEV computes all eigenvalues and, optionally, eigenvectors of a real symmetric matrix.
* DSYEVR computes selected eigenvalues and, optionally, eigenvectors
of a real symmetric matrix A. Eigenvalues and eigenvectors can be
selected by specifying either a range of values or a range of
indices for the desired eigenvalues.
Hence it might be useful to have SelfAdjointEigenSolver.computePartial(IL, IU) which uses DSYEVR to perform partial eigenvalue decomposition.
When not all (but a range of eigenvalue is needed), DSYEVR would be faster. Currently, I believe Eigen does not make use of DSYEVR.
If we want to integrate this into our API, we should also provide a stand-alone implementation. Maybe it would be sufficient to provide something inefficient at first, with a warning in the documentation that one should only use this if an external LAPACK back-end is used.
Also, API-wise `computePartial` needs to get the matrix passed as well, and we probably also want to support other parts of DSYEVR (e.g. RANGE='V'):
An API suggestion maybe, instead of introducing a new method, overload `compute` with something like:
es.compute(A, Eigen::seq(IL, IU));
which could also be passed to the constructor in a similar way:
SelfAdjointEigenSolver es(A, Eigen::seq(IL, IU));
And maybe introduce an `Interval` (essentially a 1D-AlignedBox) type for the `RANGE='V'` case. For both cases this would probably not be very obvious what it is doing, however.
Overall, to me this does not look like a high-priority thing, so unless someone volunteers to provide a patch, this may take a while.
If you need the functionality now, you can of course directly call LAPACK functions on `A.data()`.
--> Changed status to "DECISIONNEEDED", since API should be agreed on.
-- GitLab Migration Automatic Message --
This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1690.