Skip to content

Commit

Permalink
Add unbounded optimality for TRUNK
Browse files Browse the repository at this point in the history
  • Loading branch information
tmigot committed Apr 9, 2024
1 parent c93b91d commit f6374fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/trunk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ function SolverCore.solve!(
set_objective!(stats, f)
set_dual_residual!(stats, ∇fNorm2)
optimal = ∇fNorm2 ϵ
fmin = min(-one(T), f) / eps(T)
unbounded = f < fmin

verbose > 0 && @info log_header(
[:iter, :f, :dual, :radius, :ratio, :inner, :bk, :cgstatus],
Expand All @@ -210,6 +212,7 @@ function SolverCore.solve!(
nlp,
elapsed_time = stats.elapsed_time,
optimal = optimal,
unbounded = unbounded,
max_eval = max_eval,
iter = stats.iter,
max_iter = max_iter,
Expand Down Expand Up @@ -381,13 +384,15 @@ function SolverCore.solve!(
update!(tr, sNorm)

optimal = ∇fNorm2 ϵ
unbounded = f < fmin

set_status!(
stats,
get_status(
nlp,
elapsed_time = stats.elapsed_time,
optimal = optimal,
unbounded = unbounded,
max_eval = max_eval,
iter = stats.iter,
max_iter = max_iter,
Expand Down

0 comments on commit f6374fe

Please sign in to comment.