Skip to content

Commit

Permalink
Handle limit case in LM
Browse files Browse the repository at this point in the history
  • Loading branch information
ocommowi committed Nov 12, 2018
1 parent 2a21515 commit 8157338
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <animaBoundedLevenbergMarquardtOptimizer.h>
#include <animaBaseTensorTools.h>
#include <vnl_qr.h>
#include <limits>

namespace anima
{
Expand Down Expand Up @@ -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<double>::max() / 2.0))
return true;

double normDiffParams = 0.0;
Expand Down

0 comments on commit 8157338

Please sign in to comment.