mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-08 01:39:03 +08:00
DiagonalPrecond: fix potential segfault in case the diagonal contains explciit zeros
This commit is contained in:
parent
1beb8a6564
commit
e97879857b
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user