Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
Merge pull request #39 from rdeits/rd/inner-type
Browse files Browse the repository at this point in the history
make it possible to set the type of the inner model
  • Loading branch information
joaquimg authored Jul 25, 2018
2 parents d448b17 + 95d1794 commit d6957f3
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/LinQuadOptInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -199,24 +199,17 @@ function Base.isempty(map::ConstraintMapping)
return ret
end

macro def(name, definition)
return quote
macro $(esc(name))()
esc($(Expr(:quote, definition)))
end
end
end

@enum(ObjectiveType,
SingleVariableObjective,
AffineObjective,
QuadraticObjective)

# Abstract + macro
abstract type LinQuadOptimizer <: MOI.AbstractOptimizer end
@def LinQuadOptimizerBase begin

inner#::LinQuadOptInterface.LinQuadOptimizer
macro LinQuadOptimizerBase(inner_model_type=Any)
esc(quote
inner::$inner_model_type

name::String

Expand Down Expand Up @@ -256,8 +249,10 @@ abstract type LinQuadOptimizer <: MOI.AbstractOptimizer end
dual_result_count::Int

solvetime::Float64
end)
end


function MOI.isempty(m::LinQuadOptimizer)

ret = true
Expand Down

0 comments on commit d6957f3

Please sign in to comment.