File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -962,6 +962,7 @@ The following utilities are available for functions:
962962Utilities.eval_variables
963963Utilities.map_indices
964964Utilities.substitute_variables
965+ Utilities.filter_variables
965966Utilities.remove_variable
966967Utilities.all_coefficients
967968Utilities.unsafe_add
Original file line number Diff line number Diff line change @@ -663,6 +663,11 @@ Return a new function `f` with the variable vi removed.
663663function remove_variable (f:: MOI.AbstractFunction , vi:: MOI.VariableIndex )
664664 return filter_variables (v -> v != vi, f)
665665end
666+ function remove_variable (f:: MOI.AbstractFunction , vis:: Vector{MOI.VariableIndex} )
667+ # Create a `Set` to test membership in `vis` in O(1).
668+ set = Set (vis)
669+ return filter_variables (vi -> ! (vi in set), f)
670+ end
666671
667672"""
668673 modify_function(f::AbstractFunction, change::AbstractFunctionModification)
You can’t perform that action at this time.
0 commit comments