From e010d6b3481d1185638262466c957573cfd21449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Thu, 3 Sep 2020 22:38:59 +0200 Subject: [PATCH] Use supports_add_constrained_variables --- Project.toml | 2 +- src/MOI_wrapper.jl | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Project.toml b/Project.toml index 98112de..70c8f79 100644 --- a/Project.toml +++ b/Project.toml @@ -15,7 +15,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [compat] BinaryProvider = "0.5" DoubleFloats = "0.9.9" -MathOptInterface = "0.9.5" +MathOptInterface = "0.9.14" julia = "1.5" [extras] diff --git a/src/MOI_wrapper.jl b/src/MOI_wrapper.jl index 7db1d07..220c184 100644 --- a/src/MOI_wrapper.jl +++ b/src/MOI_wrapper.jl @@ -207,16 +207,9 @@ function MOI.supports( return true end -function MOI.supports_constraint( - ::Optimizer, ::Type{MOI.VectorOfVariables}, ::Type{MOI.Reals}) - return false -end +MOI.supports_add_constrained_variables(::Optimizer, ::Type{MOI.Reals}) = false const SupportedSets = Union{MOI.Nonnegatives, MOI.PositiveSemidefiniteConeTriangle} -function MOI.supports_constraint( - ::Optimizer, ::Type{MOI.VectorOfVariables}, - ::Type{<:SupportedSets}) - return true -end +MOI.supports_add_constrained_variables(::Optimizer, ::Type{<:SupportedSets}) = true function MOI.supports_constraint( ::Optimizer, ::Type{MOI.ScalarAffineFunction{T}}, ::Type{MOI.EqualTo{T}}) where T