Skip to content

Commit

Permalink
Fix sign of objective
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Dec 10, 2023
1 parent 30488fe commit 46fdb41
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ function MOI.set(
)
sign = sense == MOI.MAX_SENSE ? -1 : 1
if model.objective_sign != sign
model.b .*= -1
model.Cent .*= -1
model.objective_sign = sign
end
return
Expand All @@ -383,6 +383,9 @@ function MOI.set(
model.Cinfo_type,
func,
)
if model.objective_sign != 1
model.Cent .*= -1
end
return
end

Expand Down

0 comments on commit 46fdb41

Please sign in to comment.