Skip to content

Commit

Permalink
Allow stage PRESOLVING in assert_solved
Browse files Browse the repository at this point in the history
This might happen if a user limit (ie time) stops the solver during presolving.
  • Loading branch information
rschwarz committed Dec 9, 2021
1 parent 697be6b commit 4e2b836
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MOI_wrapper/results.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ end
function assert_stage(o::Optimizer, stages)
stage = SCIPgetStage(o)
if !(stage in stages)
error("SCIP is wrong stage ($stage, need $stages), can not query results!")
error("SCIP is wrong stage ($stage, need $stages)!")
end
end

"Make sure that the problem was solved (SCIP is in SOLVED stage)."
function assert_solved(o::Optimizer)
# SCIP's stage is SOLVING when stopped by user limit!
assert_stage(o, (SCIP_STAGE_SOLVING, SCIP_STAGE_SOLVED))
assert_stage(o, (SCIP_STAGE_PRESOLVING, SCIP_STAGE_SOLVING, SCIP_STAGE_SOLVED))

# Check for invalid status (when stage is SOLVING).
status = SCIPgetStatus(o)
Expand Down

0 comments on commit 4e2b836

Please sign in to comment.