Skip to content

Commit

Permalink
Another fix
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed May 5, 2021
1 parent 01b8913 commit 69667d2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Utilities/vector_of_constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ MOI.is_empty(v::VectorOfConstraints) = v.constraints === nothing
MOI.empty!(v::VectorOfConstraints) = (v.constraints = nothing)

function MOI.supports_constraint(
v::VectorOfConstraints{F,S},
::VectorOfConstraints{F,S},
::Type{F},
::Type{S},
) where {F<:MOI.AbstractFunction,S<:MOI.AbstractSet}
Expand Down Expand Up @@ -241,7 +241,8 @@ function _delete_variables(
if MOI.is_empty(v)
return
end
filter!(_constraints(v)) do p
cons = _constraints(v)
filter!(cons) do p
f = p.second[1]
del = if length(f.variables) == 1
first(f.variables) in vis
Expand All @@ -253,6 +254,9 @@ function _delete_variables(
end
return !del
end
if length(cons) == 0
MOI.empty!(v)
end
return
end

Expand Down

0 comments on commit 69667d2

Please sign in to comment.