Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Nov 1, 2024
1 parent 5cc6fbc commit 8be2bd2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2428,14 +2428,22 @@ function MOI.is_valid(
model::Optimizer,
ci::MOI.ConstraintIndex{MOI.VariableIndex,MOI.Integer},
)
return _info(model, ci).type == _TYPE_INTEGER
info = get(model.variable_info, MOI.VariableIndex(ci.value), nothing)
if info === nothing
return false
end
return info.type == _TYPE_INTEGER
end

function MOI.is_valid(
model::Optimizer,
ci::MOI.ConstraintIndex{MOI.VariableIndex,MOI.ZeroOne},
)
return _info(model, ci).type == _TYPE_BINARY
info = get(model.variable_info, MOI.VariableIndex(ci.value), nothing)
if info === type
return false
end
return info.bound == _TYPE_BINARY
end

function MOI.get(
Expand Down

0 comments on commit 8be2bd2

Please sign in to comment.