From 428ab4270212b2926b3cd9b971c398ff33590e70 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Wed, 21 May 2025 14:40:50 +0000 Subject: [PATCH] Fix incorrect stalledsuccess --- lib/NonlinearSolveBase/src/termination_conditions.jl | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/NonlinearSolveBase/src/termination_conditions.jl b/lib/NonlinearSolveBase/src/termination_conditions.jl index e445ebee0..8d47f64d0 100644 --- a/lib/NonlinearSolveBase/src/termination_conditions.jl +++ b/lib/NonlinearSolveBase/src/termination_conditions.jl @@ -199,13 +199,8 @@ function (cache::NonlinearTerminationModeCache)( min_obj, max_obj = extrema(cache.objectives_trace) end if min_obj < mode.min_max_factor * max_obj - if cache.leastsq - # If least squares, found a local minima thus success - cache.retcode = ReturnCode.StalledSuccess - else - # Not a success if f(x)>0 and residual too high - cache.retcode = ReturnCode.Stalled - end + # Not a success if f(x)>0 and residual too high + cache.retcode = ReturnCode.Stalled return true end end