diff --git a/Anima/math-tools/optimizers/animaBoundedLevenbergMarquardtOptimizer.cxx b/Anima/math-tools/optimizers/animaBoundedLevenbergMarquardtOptimizer.cxx index b25a8450d..a74ab148c 100644 --- a/Anima/math-tools/optimizers/animaBoundedLevenbergMarquardtOptimizer.cxx +++ b/Anima/math-tools/optimizers/animaBoundedLevenbergMarquardtOptimizer.cxx @@ -1,6 +1,7 @@ #include #include #include +#include namespace anima { @@ -243,7 +244,7 @@ bool BoundedLevenbergMarquardtOptimizer::CheckConditions(unsigned int numIterati if (numIterations == m_NumberOfIterations) return true; - if (m_LambdaParameter == 0.0) + if ((m_LambdaParameter == 0.0)||(m_LambdaParameter >= std::numeric_limits::max() / 2.0)) return true; double normDiffParams = 0.0;