mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
DiagonalPrecond: fix potential segfault in case the diagonal contains explciit zeros
This commit is contained in:
@@ -70,7 +70,7 @@ class DiagonalPreconditioner
|
||||
{
|
||||
typename MatrixType::InnerIterator it(mat,j);
|
||||
while(it && it.index()!=j) ++it;
|
||||
if(it.index()==j)
|
||||
if(it && it.index()==j)
|
||||
m_invdiag(j) = Scalar(1)/it.value();
|
||||
else
|
||||
m_invdiag(j) = 0;
|
||||
|
||||
Reference in New Issue
Block a user