Skip to content

Commit

Permalink
fix get(, PrimalStatus) with field N
Browse files Browse the repository at this point in the history
  • Loading branch information
rschwarz committed Oct 11, 2019
1 parent 9322649 commit 568f56e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/MOI_wrapper/results.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ function MOI.get(o::Optimizer, ::MOI.TerminationStatus)
return term_status_map[SCIPgetStatus(o)]
end

function MOI.get(o::Optimizer, ::MOI.PrimalStatus)
return SCIPgetNSols(o) > 0 ? MOI.FEASIBLE_POINT : MOI.NO_SOLUTION
function MOI.get(o::Optimizer, attr::MOI.PrimalStatus)
return if 1 <= attr.N <= MOI.get(o, MOI.ResultCount())
MOI.FEASIBLE_POINT
else
MOI.NO_SOLUTION
end
end

function MOI.get(o::Optimizer, ::MOI.ResultCount)::Int
Expand Down

0 comments on commit 568f56e

Please sign in to comment.