New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 835 - Implement OnTheLeft/OnTheRight for SparseTriangularView::solve
Summary: Implement OnTheLeft/OnTheRight for SparseTriangularView::solve
Status: CONFIRMED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Sparse (show other bugs)
Version: 3.2
Hardware: All All
: Normal Feature Request
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on: ExprEval
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-27 04:34 UTC by Henrik Friberg
Modified: 2014-06-27 10:42 UTC (History)
1 user (show)



Attachments

Description Henrik Friberg 2014-06-27 04:34:14 UTC
The following does not compile:
---------------------------
Matrix3d A;
RowVector3d bT, xT;

A << 1, 2, 3,
     4, 5, 6,
     7, 8, 9;

bT << 1, 2, 3;

xT = A.triangularView<Upper>().solve<OnTheRight>(bT);  // WORKS FINE!
printf("(%g, %g, %g)", xT(0), xT(1), xT(2));

SparseMatrix<double> spA = A.sparseView();
spA.triangularView<Upper>().solve<OnTheRight>(bT);  // COMPILE ERROR!
---------------------------

SparseTriangularView::solve accepts neither <OnTheLeft> nor <OnTheRight> as template argument, but neglecting the argument compiles fine..
Comment 1 Christoph Hertzberg 2014-06-27 10:42:21 UTC
Most likely this will not be implemented without bug 99. With bug 99, we might directly make things like
  xt = bT * spA.triangularView<Upper>().inverse();
do "the right thing". You can workaround using:
  xT=spA.transpose().triangularView<Lower>().solve(bT.transpose()).transpose();
or, if possible, model your matrices and vectors the other way around.

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