Skip to content

Commit 9970afb

Browse files
authored
Merge pull request #256 from scipopt/binbounds-fixed
binbounds fixed
2 parents 4703243 + 6ae0005 commit 9970afb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/MOI_wrapper/variable.jl

+3
Original file line numberDiff line numberDiff line change
@@ -223,17 +223,20 @@ function MOI.set(o::Optimizer, ::MOI.ConstraintSet, ci::CI{VI,S}, set::S) where
223223
allow_modification(o)
224224
v = var(o, VI(ci.value)) # cons index is actually var index
225225
lb, ub = bounds(set)
226+
old_interval = get(o.binbounds, VI(ci.value), MOI.Interval(0.0, 1.0))
226227
if lb !== nothing
227228
if SCIPvarGetType(v) == SCIP_VARTYPE_BINARY
228229
lb = max(lb, 0.0)
229230
end
230231
@SCIP_CALL SCIPchgVarLb(o, v, lb)
232+
o.binbounds[VI(ci.value)] = MOI.Interval(lb, old_interval.upper)
231233
end
232234
if ub !== nothing
233235
if SCIPvarGetType(v) == SCIP_VARTYPE_BINARY
234236
ub = min(ub, 1.0)
235237
end
236238
@SCIP_CALL SCIPchgVarUb(o, v, ub)
239+
o.binbounds[VI(ci.value)] = MOI.Interval(old_interval.lower, ub)
237240
end
238241
return nothing
239242
end

0 commit comments

Comments
 (0)