Skip to content

Commit

Permalink
Move OSQPModel to src.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkoolen committed Feb 19, 2018
1 parent afb8281 commit e2611ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
13 changes: 12 additions & 1 deletion src/MathOptInterfaceOSQP.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module MathOptInterfaceOSQP

export OSQPOptimizer, OSQPSettings
export OSQPOptimizer, OSQPSettings, OSQPModel

using Compat
using MathOptInterface
Expand Down Expand Up @@ -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
11 changes: 0 additions & 11 deletions test/MathOptInterfaceOSQP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit e2611ae

Please sign in to comment.