add ReverseInnerIterators to loop over the elements in reverse order,

and partly fix bug #356 (issue in trisolve for upper-column major))
This commit is contained in:
Gael Guennebaud
2011-12-03 23:49:37 +01:00
parent a09cc5d4c0
commit 91e392a042
6 changed files with 142 additions and 34 deletions

View File

@@ -156,9 +156,11 @@ struct sparse_solve_triangular_selector<Lhs,Rhs,Mode,Upper,ColMajor>
{
if(!(Mode & UnitDiag))
{
// FIXME lhs.coeff(i,i) might not be always efficient while it must simply be the
// last element of the column !
other.coeffRef(i,col) /= lhs.innerVector(i).lastCoeff();
typename Lhs::ReverseInnerIterator it(lhs, i);
while(it && it.index()!=i)
--it;
eigen_assert(it && it.index()==i);
other.coeffRef(i,col) /= it.value();
}
typename Lhs::InnerIterator it(lhs, i);
for(; it && it.index()<i; ++it)