Skip to content

Commit

Permalink
use get_fx function to check unboundedness
Browse files Browse the repository at this point in the history
  • Loading branch information
tmigot committed Sep 9, 2022
1 parent 9f655c5 commit a503dc6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Stopping/NLPStoppingmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,14 @@ function _unbounded_problem_check!(
stp::NLPStopping{Pb, M, SRC, NLPAtX{Score, S, T}, MStp, LoS},
x::AbstractVector,
) where {Pb, M, SRC, MStp, LoS, Score, S, T}
if isnan(stp.current_state.fx)
if isnan(get_fx(stp.current_state))
stp.current_state.fx = obj(stp.pb, x)
end

if stp.pb.meta.minimize
f_too_large = stp.current_state.fx <= -stp.meta.unbounded_threshold
f_too_large = get_fx(stp.current_state) <= -stp.meta.unbounded_threshold
else
f_too_large = stp.current_state.fx >= stp.meta.unbounded_threshold
f_too_large = get_fx(stp.current_state) >= stp.meta.unbounded_threshold
end

if f_too_large
Expand All @@ -435,14 +435,14 @@ function _unbounded_problem_check!(
stp::NLPStopping{Pb, M, SRC, OneDAtX{S, T}, MStp, LoS},
x::Union{AbstractVector, Number},
) where {Pb, M, SRC, MStp, LoS, S, T}
if isnan(stp.current_state.fx)
if isnan(get_fx(stp.current_state))
stp.current_state.fx = obj(stp.pb, x)
end

if stp.pb.meta.minimize
f_too_large = stp.current_state.fx <= -stp.meta.unbounded_threshold
f_too_large = get_fx(stp.current_state) <= -stp.meta.unbounded_threshold
else
f_too_large = stp.current_state.fx >= stp.meta.unbounded_threshold
f_too_large = get_fx(stp.current_state) >= stp.meta.unbounded_threshold
end

return stp.meta.unbounded_pb
Expand Down

0 comments on commit a503dc6

Please sign in to comment.