declare a ReverseInnerIterator in sparse CwiseBinaryOp. These ReverseInnerIterator should probably be removed anyway since we currently don't have real use cases for them. The only one in TriangularSolver could be advantageously replaced by a binary search.

This commit is contained in:
Gael Guennebaud 2012-02-23 11:38:18 +01:00
parent 1edfa64f44
commit 128ff9cf07
2 changed files with 2 additions and 0 deletions

View File

@ -63,6 +63,7 @@ class CwiseBinaryOpImpl<BinaryOp, Lhs, Rhs, Sparse>
{
public:
class InnerIterator;
class ReverseInnerIterator;
typedef CwiseBinaryOp<BinaryOp, Lhs, Rhs> Derived;
EIGEN_SPARSE_PUBLIC_INTERFACE(Derived)
CwiseBinaryOpImpl()

View File

@ -156,6 +156,7 @@ struct sparse_solve_triangular_selector<Lhs,Rhs,Mode,Upper,ColMajor>
{
if(!(Mode & UnitDiag))
{
// TODO replace this by a binary search. make sure the binary search is safe for partially sorted elements
typename Lhs::ReverseInnerIterator it(lhs, i);
while(it && it.index()!=i)
--it;