mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-15 13:15:57 +08:00
Fix Jacobi preconditioner with zero diagonal entries
(grafted from c06ec0f464a312dbce24edfde1de75bb1a69c4a6 )
This commit is contained in:
parent
5c70b43abd
commit
befa141699
@ -65,10 +65,10 @@ class DiagonalPreconditioner
|
||||
{
|
||||
typename MatType::InnerIterator it(mat,j);
|
||||
while(it && it.index()!=j) ++it;
|
||||
if(it && it.index()==j)
|
||||
if(it && it.index()==j && it.value()!=Scalar(0))
|
||||
m_invdiag(j) = Scalar(1)/it.value();
|
||||
else
|
||||
m_invdiag(j) = 0;
|
||||
m_invdiag(j) = Scalar(1);
|
||||
}
|
||||
m_isInitialized = true;
|
||||
return *this;
|
||||
|
Loading…
x
Reference in New Issue
Block a user