Skip to content

Commit a96cdc3

Browse files
authored
Merge pull request #1066 from diluculo/#1061
Fix LevenbergMarquardtMinimizer stopping condition
2 parents 135fa9b + 3ae6980 commit a96cdc3

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)