Skip to content

Commit 3ae6980

Browse files
committed
Fix LevenbergMarquardtMinimizer stopping condition, addressing issue #1061
1 parent f196418 commit 3ae6980

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Numerics/Optimization/LevenbergMarquardtMinimizer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public NonlinearMinimizationResult Minimum(IObjectiveModel objective, Vector<dou
158158
Pstep = Hessian.Solve(-Gradient);
159159

160160
// if ||ΔP|| <= xTol * (||P|| + xTol), found and stop
161-
if (Pstep.L2Norm() <= stepTolerance * (stepTolerance + P.DotProduct(P)))
161+
if (Pstep.L2Norm() <= stepTolerance * (P.L2Norm() + stepTolerance))
162162
{
163163
exitCondition = ExitCondition.RelativePoints;
164164
break;

0 commit comments

Comments
 (0)