Skip to content

Commit 244083f

Browse files
authored
Allow Dichotomy to return solutions on error (#142)
1 parent 636b319 commit 244083f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/algorithms/Dichotomy.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ function optimize_multiobjective!(algorithm::Dichotomy, model::Optimizer)
112112
w = y_d[2] / (y_d[2] - y_d[1])
113113
status, solution = _solve_weighted_sum(model, algorithm, [w, 1.0 - w])
114114
if !_is_scalar_status_optimal(status)
115-
# Exit the solve with some error.
116-
return status, nothing
115+
break # Exit the solve with some error.
117116
elseif solution solutions[a] || solution solutions[b]
118117
# We have found an existing solution. We're free to prune (a, b)
119118
# from the search space.

test/algorithms/Dichotomy.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,8 @@ function test_solve_failures()
434434
end
435435
MOI.optimize!(model)
436436
@test MOI.get(model, MOI.TerminationStatus()) == MOI.NUMERICAL_ERROR
437+
@test MOI.get(model, MOI.ResultCount()) ==
438+
(fail_after < 2 ? 0 : fail_after)
437439
end
438440
return
439441
end

0 commit comments

Comments
 (0)