diff --git a/src/MathOptInterfaceOSQP.jl b/src/MathOptInterfaceOSQP.jl index ff4baf7..37219b1 100644 --- a/src/MathOptInterfaceOSQP.jl +++ b/src/MathOptInterfaceOSQP.jl @@ -1,6 +1,6 @@ module MathOptInterfaceOSQP -export OSQPOptimizer, OSQPSettings +export OSQPOptimizer, OSQPSettings, OSQPModel using Compat using MathOptInterface @@ -641,4 +641,15 @@ end # There is currently no ScalarQuadraticCoefficientChange. +MOIU.@model(OSQPModel, # modelname + (), # scalarsets + (Interval, LessThan, GreaterThan, EqualTo), # typedscalarsets + (), # vectorsets + (), # typedvectorsets + (SingleVariable,), # scalarfunctions + (ScalarAffineFunction, ScalarQuadraticFunction), # typedscalarfunctions + (), # vectorfunctions + () # typedvectorfunctions +) + end # module diff --git a/test/MathOptInterfaceOSQP.jl b/test/MathOptInterfaceOSQP.jl index 5f25f3b..72f7cc0 100644 --- a/test/MathOptInterfaceOSQP.jl +++ b/test/MathOptInterfaceOSQP.jl @@ -95,17 +95,6 @@ MOI.canget(src::BadObjectiveModel, ::MOI.ObjectiveFunction{<:Any}) = false MOIT.failcopytest(optimizer, BadObjectiveModel(), MOI.CopyOtherError) end -MOIU.@model(OSQPModel, # modelname - (), # scalarsets - (Interval, LessThan, GreaterThan, EqualTo), # typedscalarsets - (), # vectorsets - (), # typedvectorsets - (SingleVariable,), # scalarfunctions - (ScalarAffineFunction, ScalarQuadraticFunction), # typedscalarfunctions - (), # vectorfunctions - () # typedvectorfunctions -) - # FIXME: type piracy. Generalize and move to MOIU. MOI.canget(optimizer::MOIU.CachingOptimizer, ::MOI.ConstraintPrimal, ::Type{<:MOI.ConstraintIndex}) = true function MOI.get(optimizer::MOIU.CachingOptimizer, ::MOI.ConstraintPrimal, ci::MOI.ConstraintIndex{<:MOI.SingleVariable, <:Any})