@@ -349,6 +349,18 @@ function reset_bounds(o::Optimizer, v, lb, ub, ::Type{MOI.LessThan{Float64}})
349349 return
350350end
351351
352+ function _update_binbounds (set:: MOI.Interval , :: Type{<:MOI.LessThan} )
353+ return MOI. Interval (- Inf , set. upper)
354+ end
355+
356+ function _update_binbounds (set:: MOI.Interval , :: Type{<:MOI.GreaterThan} )
357+ return MOI. Interval (set. lower, Inf )
358+ end
359+
360+ function _update_binbounds (:: MOI.Interval , :: Type{<:S} ) where {S}
361+ return MOI. Interval (- Inf , Inf )
362+ end
363+
352364function MOI. delete (
353365 o:: Optimizer ,
354366 ci:: MOI.ConstraintIndex{MOI.VariableIndex,S} ,
@@ -360,12 +372,12 @@ function MOI.delete(
360372 v = var (o, vi)
361373 if SCIPvarGetType (v) == SCIP_VARTYPE_BINARY
362374 reset_bounds (o, v, 0.0 , 1.0 , S)
375+ old_set = o. binbounds[vi]
376+ o. binbounds[vi] = _update_binbounds (old_set, S)
363377 else
364378 inf = SCIPinfinity (o)
365379 reset_bounds (o, v, - inf, inf, S)
366380 end
367- # but do delete the constraint reference
368- delete! (o. binbounds, vi)
369381 type = o. bound_types[vi]
370382 if type == _kSCIP_LESS_AND_GREATER_THAN && S <: MOI.LessThan
371383 o. bound_types[vi] = _kSCIP_GREATER_THAN
0 commit comments