New user self-registration is disabled due to spam. Please email eigen-core-team @ if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 1690 - Have SelfAdjointEigenSolver.computePartial()
Summary: Have SelfAdjointEigenSolver.computePartial()
Alias: None
Product: Eigen
Classification: Unclassified
Component: Eigenvalues (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Low Feature Request
Assignee: Nobody
Depends on:
Reported: 2019-03-06 10:43 UTC by Chuen Teck See
Modified: 2019-03-07 18:20 UTC (History)
4 users (show)


Description Chuen Teck See 2019-03-06 10:43:28 UTC
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.
Comment 1 Christoph Hertzberg 2019-03-07 18:20:36 UTC
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 ``.

--> Changed status to "DECISIONNEEDED", since API should be agreed on.

Note You need to log in before you can comment on or make changes to this bug.