mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
bugfix when the diagonal is not stored and assumed to be 1
This commit is contained in:
@@ -79,7 +79,7 @@ struct ei_sparse_solve_triangular_selector<Lhs,Rhs,Mode,UpperTriangular,RowMajor
|
|||||||
{
|
{
|
||||||
Scalar tmp = other.coeff(i,col);
|
Scalar tmp = other.coeff(i,col);
|
||||||
typename Lhs::InnerIterator it(lhs, i);
|
typename Lhs::InnerIterator it(lhs, i);
|
||||||
if (it.index() == i)
|
if (it && it.index() == i)
|
||||||
++it;
|
++it;
|
||||||
for(; it; ++it)
|
for(; it; ++it)
|
||||||
{
|
{
|
||||||
@@ -91,7 +91,7 @@ struct ei_sparse_solve_triangular_selector<Lhs,Rhs,Mode,UpperTriangular,RowMajor
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
typename Lhs::InnerIterator it(lhs, i);
|
typename Lhs::InnerIterator it(lhs, i);
|
||||||
ei_assert(it.index() == i);
|
ei_assert(it && it.index() == i);
|
||||||
other.coeffRef(i,col) = tmp/it.value();
|
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);
|
ei_assert(it.index()==i);
|
||||||
tmp /= it.value();
|
tmp /= it.value();
|
||||||
}
|
}
|
||||||
if (it.index()==i)
|
if (it && it.index()==i)
|
||||||
++it;
|
++it;
|
||||||
for(; it; ++it)
|
for(; it; ++it)
|
||||||
other.coeffRef(it.index(), col) -= tmp * it.value();
|
other.coeffRef(it.index(), col) -= tmp * it.value();
|
||||||
|
|||||||
Reference in New Issue
Block a user