This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 1225 - selfAdjointEigenSolver no longer allows passing a selfadjointView directly.
Summary: selfAdjointEigenSolver no longer allows passing a selfadjointView directly.
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Eigenvalues (show other bugs)
Version: 3.3 (current stable)
Hardware: x86 - 64-bit Linux
: Normal Compilation Problem
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on: 1230
Blocks:
  Show dependency treegraph
 
Reported: 2016-05-10 17:45 UTC by Rasmus Munk Larsen
Modified: 2019-12-04 15:49 UTC (History)
4 users (show)



Attachments

Description Rasmus Munk Larsen 2016-05-10 17:45:08 UTC
The following:

 Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> solver;
 solver.compute(covariance.selfadjointView<Eigen::Upper>());

used to compile with 3.2 but fails on the dev branch (synced at commit 6203649a0399) with:

In file included from XXX/utils.cc:11:
In file included from YYY/Eigen/Eigenvalues:38:
YYY/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:431:25: error: no member named 'triangularView' in 'Eigen::SelfAdjointView<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2>'
  mat = matrix.template triangularView<Lower>();
        ~~~~~~          ^
XXX/utils.cc:54:10: note: in instantiation of function template specialization 'Eigen::SelfAdjointEigenSolver<Eigen::Matrix<double, -1, -1, 0, -1, -1> >::compute<Eigen::SelfAdjointView<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2> >' requested here
  solver.compute(covariance.selfadjointView<Eigen::Upper>());


Workaround:

covariance = covariance.selfadjointView<Eigen::Upper>();
Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> solver;
solver.compute(covariance);
Comment 1 Rasmus Munk Larsen 2016-05-11 07:01:29 UTC
Actually, this is not really a bug, is it? Or at least, the usefulness of being able to pass in SelfAdjointView<Upper> is questionable. The code in question could just pass in a lower triangular matrix instead (in fact it makes the code simpler and faster). I'll let you decide whether to close this or not.
Comment 2 Gael Guennebaud 2016-05-18 15:00:15 UTC
Actually we could easily support SelfadjointView::triangularView, could be convenient in many other situation. In your case, since SelfAdjointEigenSolver is expected to get the lower part, you could simply pass cov.transpose(). This is how SelfadjointView<Upper>::triangularView<Lower> would be implemented.
Comment 3 Rasmus Munk Larsen 2016-05-18 16:06:40 UTC
I agree that it would be convenient. In my case the code was actually going through contortions to not create a lower-triangular matrix, so this missing feature was a good excuse to fix it :-)
Comment 4 Nobody 2019-12-04 15:49:01 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/1225.

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