Skip to content

Commit

Permalink
fix ResultCount for unbounded problems
Browse files Browse the repository at this point in the history
  • Loading branch information
rschwarz committed Dec 22, 2018
1 parent 0abb816 commit f4b71d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,13 @@ function MOI.get(o::Optimizer, ::MOI.PrimalStatus)
SCIPgetNSols(get_scip(o)) > 0 ? MOI.FEASIBLE_POINT : MOI.NO_SOLUTION
end

MOI.get(o::Optimizer, ::MOI.ResultCount) = SCIPgetNSols(get_scip(o))
function MOI.get(o::Optimizer, ::MOI.ResultCount)
status = SCIPgetStatus(get_scip(o))
if status in [SCIP_STATUS_UNBOUNDED, SCIP_STATUS_INFORUNBD]
return 0
end
return SCIPgetNSols(get_scip(o))
end

function MOI.get(o::Optimizer, ::MOI.ObjectiveValue)
scip = get_scip(o)
Expand Down
2 changes: 0 additions & 2 deletions test/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ const config = MOIT.TestConfig(duals=false, infeas_certificates=false)
"linear1", # needs MOI.delete
"linear5", # needs MOI.delete
"linear7", # needs MOI.VectorAffineFunction
"linear8b", # TODO: have solutions for unbounded problem
"linear8c", # TODO: have solutions for unbounded problem
"linear11", # needs MOI.delete
"linear13", # TODO: support MOI.FEASIBILITY_SENSE
"linear14", # needs MOI.delete
Expand Down

0 comments on commit f4b71d8

Please sign in to comment.