Skip to content

Commit

Permalink
Assert that objective sense is either max or min
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromxavier committed Dec 4, 2023
1 parent de8f6b7 commit 2c59999
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ext/QUBOTools_MOI/qubo_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ function MOI.set(
::MOI.ObjectiveSense,
objective_sense::MOI.OptimizationSense,
)
@assert objective_sense === MOI.MIN_SENSE ||
objective_sense === MOI.MAX_SENSE

model.objective_sense = objective_sense

return nothing
Expand Down

0 comments on commit 2c59999

Please sign in to comment.