diff --git a/src/constraints.jl b/src/constraints.jl index bfc62d4aea..36ca0fbe22 100644 --- a/src/constraints.jl +++ b/src/constraints.jl @@ -19,25 +19,6 @@ implemented if `model` does not support free variables. For instance, if a solver requires all variables to be nonnegative, it should implement this method and return `false` because free variables cannot be copied to the solver. -Note that free variables are not explicitly set to be free by calling -[`add_constraint`](@ref) with the set [`Reals`](@ref), instead, free variables -are created with [`add_variable`](@ref) and [`add_variables`](@ref). -If `model` does not support free variables, it should not implement -[`add_variable`](@ref) nor [`add_variables`](@ref) but should implement -this method and return `false`. This allows free variables to be bridged as the -sum of a nonnegative and a nonpositive variables. -""" # Implemented as only one method to avoid ambiguity -function supports_constraint(model::ModelLike, F::Type{<:AbstractFunction}, - S::Type{<:AbstractSet}) - return F == VectorOfVariables && S == Reals -end - - supports_constraint(model::ModelLike, ::Type{VectorOfVariables}, ::Type{Reals})::Bool - -Return a `Bool` indicating whether `model` supports free variables. -By default, this method returns `true` so it should only be implemented if -`model` does not support free variables. - Note that free variables are not explicitly set to be free by calling [`add_constraint`](@ref) with the set [`Reals`](@ref), instead, free variables are created with [`add_variable`](@ref) and [`add_variables`](@ref).