Handle zero right hand side in CG and GMRES

This commit is contained in:
Desire NUENTSA
2013-03-20 11:22:45 +01:00
parent 9bfeeba1c5
commit 4107b371e3
2 changed files with 8 additions and 1 deletions

View File

@@ -348,7 +348,8 @@ public:
template<typename Rhs,typename Dest>
void _solve(const Rhs& b, Dest& x) const
{
x.setZero();
x = b;
if(!x.squaredNorm()) return; // Check Zero right hand side
_solveWithGuess(b,x);
}