From 32cf735be587b7cd78e28af0c765bdbea27c7003 Mon Sep 17 00:00:00 2001 From: FHoltorf <32248677+FHoltorf@users.noreply.github.com> Date: Wed, 27 Sep 2023 14:08:20 -0400 Subject: [PATCH] convergence check for NocedalWright --- src/trustRegion.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/trustRegion.jl b/src/trustRegion.jl index 4f85760e6..124c887b2 100644 --- a/src/trustRegion.jl +++ b/src/trustRegion.jl @@ -476,6 +476,11 @@ function trust_region_step!(cache::TrustRegionCache) cache.trust_r = min(2 * cache.trust_r, cache.max_trust_r) end + # convergence test + if iszero(cache.fu) || cache.internalnorm(cache.fu) < cache.abstol + cache.force_stop = true + end + elseif radius_update_scheme === RadiusUpdateSchemes.Hei if r > cache.step_threshold take_step!(cache)