We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f02ab38 commit a2df7e6Copy full SHA for a2df7e6
src/Utilities/model.jl
@@ -222,6 +222,11 @@ function MOI.delete(model::AbstractModel, vi::MOI.VariableIndex)
222
model.objective = remove_variable(model.objective, vi)
223
end
224
function MOI.delete(model::AbstractModel, vis::Vector{MOI.VariableIndex})
225
+ if isempty(vis)
226
+ # In `keep`, we assume that `model.variable_indices !== nothing` so
227
+ # at least one variable need to be deleted.
228
+ return
229
+ end
230
# Delete `VectorOfVariables(vis)` constraints as otherwise, it will error
231
# when removing variables one by one.
232
vov_to_remove = broadcastvcat(constrs -> _vector_of_variables_with(constrs, vis), model)
0 commit comments