Skip to content

Commit

Permalink
convergence check for NocedalWright
Browse files Browse the repository at this point in the history
  • Loading branch information
FHoltorf committed Sep 27, 2023
1 parent 609f67c commit 32cf735
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/trustRegion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 32cf735

Please sign in to comment.