This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 1690 - Have SelfAdjointEigenSolver.computePartial()
Summary: Have SelfAdjointEigenSolver.computePartial()
Status: DECISIONNEEDED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Eigenvalues (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Low Feature Request
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-06 10:43 UTC by Chuen Teck See
Modified: 2019-12-04 18:32 UTC (History)
4 users (show)



Attachments

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'):
http://www.netlib.org/lapack/explore-html/d2/d8a/group__double_s_yeigen_gaeed8a131adf56eaa2a9e5b1e0cce5718.html

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.
Comment 2 Nobody 2019-12-04 18:32:58 UTC
-- 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.

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