Skip to content

Commit 11f12da

Browse files
add prox_unbounded status (#126)
1 parent e505b95 commit 11f12da

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/stats.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const STATUSES = Dict(
3434
:small_step => "step too small",
3535
:stalled => "stalled",
3636
:unbounded => "objective function may be unbounded from below",
37+
:prox_unbounded => "the regularizer is not prox bounded",
3738
:unknown => "unknown",
3839
:user => "user-requested stop",
3940
)
@@ -469,6 +470,7 @@ The keyword arguments may contain:
469470
- `optimal::Bool = false`: `true` if the problem reached an optimal solution (default: `false`);
470471
- `small_residual::Bool = false`: `true` if the nonlinear least squares problem reached a solution with small residual (default: `false`);
471472
- `infeasible::Bool = false`: `true` if the problem is infeasible (default: `false`);
473+
- `prox_unbounded::Bool = false`: `true` if the regularizer is not prox bounded (default: `false`);
472474
- `parameter_too_large::Bool = false`: `true` if the parameters are loo large (default: `false`);
473475
- `unbounded::Bool = false`: `true` if the problem is unbounded (default: `false`);
474476
- `stalled::Bool = false`: `true` if the algorithm is stalling (default: `false`);
@@ -485,6 +487,7 @@ function get_status(
485487
optimal::Bool = false,
486488
small_residual::Bool = false,
487489
infeasible::Bool = false,
490+
prox_unbounded = false,
488491
parameter_too_large::Bool = false,
489492
unbounded::Bool = false,
490493
stalled::Bool = false,
@@ -511,6 +514,8 @@ function get_status(
511514
:max_time
512515
elseif parameter_too_large
513516
:stalled
517+
elseif prox_unbounded
518+
:prox_unbounded
514519
elseif exception
515520
:exception
516521
else

test/test-stats.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ test_stats()
165165
@test get_status(nlp, unbounded = true) == :unbounded
166166
@test get_status(nlp, stalled = true) == :stalled
167167
@test get_status(nlp, iter = 8, max_iter = 5) == :max_iter
168+
@test get_status(nlp, prox_unbounded = true) == :prox_unbounded
168169
for i = 1:2
169170
increment!(nlp, :neval_obj)
170171
end
@@ -183,6 +184,7 @@ end
183184
@test get_status(nlp, unbounded = true) == :unbounded
184185
@test get_status(nlp, stalled = true) == :stalled
185186
@test get_status(nlp, iter = 8, max_iter = 5) == :max_iter
187+
@test get_status(nlp, prox_unbounded = true) == :prox_unbounded
186188
for i = 1:2
187189
increment!(nlp, :neval_residual)
188190
end

0 commit comments

Comments
 (0)