Skip to content

Commit

Permalink
Merge pull request #521 from hugtalbot/fix_nostep_cg
Browse files Browse the repository at this point in the history
FIX no step if condition on denominator is met at first step
  • Loading branch information
damienmarchal authored Dec 5, 2017
2 parents 44c4f5b + 0ae8f64 commit 086e03c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SofaKernel/modules/SofaBaseLinearSolver/CGLinearSolver.inl
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ void CGLinearSolver<TMatrix,TVector>::solve(Matrix& M, Vector& x, Vector& b)
graph_den.push_back(den);


/// Break condition = THRESHOLD criterion regarding the denominator is reached
if( fabs(den)<f_smallDenominatorThreshold.getValue() )
/// Break condition = THRESHOLD criterion regarding the denominator is reached (but do at least one iteration)
if( fabs(den)<f_smallDenominatorThreshold.getValue() && nb_iter>1)
{
endcond = "threshold";
if( verbose )
Expand Down

0 comments on commit 086e03c

Please sign in to comment.