Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/MathOptLazy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ function MOI.get(
attr::MOI.ListOfConstraintIndices{F,S},
) where {F<:MOI.AbstractScalarFunction,S<:MOI.AbstractScalarSet}
ret = MOI.get(model.inner, attr)
if (data = _data(model, F, S)) !== nothing
if (data = _maybe_data(model, F, S)) !== nothing
in_model = Set(ci for (ci, z) in zip(data.index, data.active) if z)
ret = filter!(ci -> !(ci in in_model), ret)
end
Expand Down
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ function _basic_constraint_test_helper(
F, S, IS = typeof(constraint_function), typeof(set), typeof(inner_set)
@test MOI.supports_constraint(model, F, S)
@test MOI.get(model, MOI.NumberOfConstraints{F,S}()) == 0
@test isempty(MOI.get(model, MOI.ListOfConstraintIndices{F,S}()))
@test MOI.get(model, MOI.NumberOfConstraints{F,IS}()) == 0
@test isempty(MOI.get(model, MOI.ListOfConstraintIndices{F,IS}()))
c = MOI.add_constraint(model, constraint_function, set)
if activate
data = MathOptLazy._data(model, F, IS)
Expand Down
Loading