diff options
author | Gael Guennebaud <g.gael@free.fr> | 2009-04-10 18:13:37 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2009-04-10 18:13:37 +0000 |
commit | 7254201632472d98dba557f32a8bc5338a0b954a (patch) | |
tree | ddaa398543ed18296b33329750fde71c53920bcd | |
parent | 22edf77470020f418ccd485e600bd63d3d4e4315 (diff) |
bugfix when the diagonal is not stored and assumed to be 1
-rw-r--r-- | Eigen/src/Sparse/TriangularSolver.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Eigen/src/Sparse/TriangularSolver.h b/Eigen/src/Sparse/TriangularSolver.h index 168439b30..30ddd1af2 100644 --- a/Eigen/src/Sparse/TriangularSolver.h +++ b/Eigen/src/Sparse/TriangularSolver.h @@ -79,7 +79,7 @@ struct ei_sparse_solve_triangular_selector<Lhs,Rhs,Mode,UpperTriangular,RowMajor { Scalar tmp = other.coeff(i,col); typename Lhs::InnerIterator it(lhs, i); - if (it.index() == i) + if (it && it.index() == i) ++it; for(; it; ++it) { @@ -91,7 +91,7 @@ struct ei_sparse_solve_triangular_selector<Lhs,Rhs,Mode,UpperTriangular,RowMajor else { typename Lhs::InnerIterator it(lhs, i); - ei_assert(it.index() == i); + ei_assert(it && it.index() == i); other.coeffRef(i,col) = tmp/it.value(); } } @@ -119,7 +119,7 @@ struct ei_sparse_solve_triangular_selector<Lhs,Rhs,Mode,LowerTriangular,ColMajor ei_assert(it.index()==i); tmp /= it.value(); } - if (it.index()==i) + if (it && it.index()==i) ++it; for(; it; ++it) other.coeffRef(it.index(), col) -= tmp * it.value(); |