1717function MOI. get (model:: AbstractLPForm , :: MOI.ListOfModelAttributesSet )
1818 list = MOI. AbstractModelAttribute[]
1919 push! (list, MOI. ObjectiveSense ())
20- if model. direction != MOI. FEASIBILITY_SENSE
20+ if model. sense != MOI. FEASIBILITY_SENSE
2121 push! (list, MOI. ObjectiveFunction {MOI.get(model, MOI.ObjectiveFunctionType())} ())
2222 end
2323 return list
2424end
25- MOI. get (model:: AbstractLPForm , :: MOI.ObjectiveSense ) = model. direction
25+ MOI. get (model:: AbstractLPForm , :: MOI.ObjectiveSense ) = model. sense
2626function MOI. get (model:: AbstractLPForm{T} ,
2727 :: MOI.ObjectiveFunction{MOI.ScalarAffineFunction{T}} ) where T
2828 return _dot (model. c)
@@ -47,15 +47,24 @@ function MOI.get(model::AbstractLPForm{T}, ::MOI.ConstraintFunction,
4747 return _dot (model. A[ci. value, :])
4848end
4949
50+ """
51+ LPStandardForm{T, AT<:AbstractMatrix{T}, VT <: AbstractVector{T}} <: AbstractLPForm{T}
5052
53+ Represents a problem of the form:
54+ ```
55+ sense ⟨c, x⟩
56+ s.t. A x == b
57+ x ≥ 0
58+ ```
59+ """
5160struct LPStandardForm{T, AT<: AbstractMatrix{T} , VT <: AbstractVector{T} } <: AbstractLPForm{T}
52- direction :: MOI.OptimizationSense
61+ sense :: MOI.OptimizationSense
5362 c:: VT
5463 A:: AT
5564 b:: VT
5665end
5766
58- function MOI. get (model :: LPStandardForm{T} , :: MOI.ListOfConstraints ) where T
67+ function MOI. get (:: LPStandardForm{T} , :: MOI.ListOfConstraints ) where T
5968 return [(MOI. ScalarAffineFunction{T}, MOI. EqualTo{T}),
6069 (MOI. VectorOfVariables, MOI. Nonnegatives)]
6170end
@@ -77,7 +86,7 @@ function MOI.get(model::LPStandardForm, ::MOI.ConstraintSet,
7786end
7887const NONNEG = MOI. ConstraintIndex{MOI. VectorOfVariables, MOI. Nonnegatives}
7988function MOI. get (
80- model :: LPStandardForm ,
89+ :: LPStandardForm ,
8190 :: MOI.ListOfConstraintIndices {
8291 MOI. VectorOfVariables, MOI. Nonnegatives}
8392)
@@ -92,14 +101,23 @@ function MOI.get(model::LPStandardForm, ::MOI.ConstraintSet,
92101 return MOI. Nonnegatives (MOI. get (model, MOI. NumberOfVariables ()))
93102end
94103
104+ """
105+ LPGeometricForm{T, AT<:AbstractMatrix{T}, VT <: AbstractVector{T}} <: AbstractLPForm{T}
106+
107+ Represents a linear problem of the form:
108+ ```
109+ sense ⟨c, x⟩
110+ s.t. Ax <= b
111+ ```
112+ """
95113struct LPGeometricForm{T, AT<: AbstractMatrix{T} , VT <: AbstractVector{T} } <: AbstractLPForm{T}
96- direction :: MOI.OptimizationSense
114+ sense :: MOI.OptimizationSense
97115 c:: VT
98116 A:: AT
99117 b:: VT
100118end
101119
102- function MOI. get (model :: LPGeometricForm{T} , :: MOI.ListOfConstraints ) where T
120+ function MOI. get (:: LPGeometricForm{T} , :: MOI.ListOfConstraints ) where T
103121 return [(MOI. ScalarAffineFunction{T}, MOI. LessThan{T})]
104122end
105123const LT{T} = MOI. ConstraintIndex{MOI. ScalarAffineFunction{T}, MOI. LessThan{T}}
@@ -175,15 +193,25 @@ function MOI.get(model::LPMixedForm{T}, ::MOI.ListOfConstraintIndices{MOI.Single
175193 VBOUND {S} (vi. value)
176194 end )
177195end
178- function MOI. get (model :: LPMixedForm , :: MOI.ConstraintFunction , ci:: VBOUND )
196+ function MOI. get (:: LPMixedForm , :: MOI.ConstraintFunction , ci:: VBOUND )
179197 return MOI. SingleVariable (MOI. VariableIndex (ci. value))
180198end
181199function MOI. get (model:: LPMixedForm , :: MOI.ConstraintSet , ci:: VBOUND )
182200 return _bound_set (model. v_lb[ci. value], model. v_ub[ci. value])
183201end
184202
203+ """
204+ LPForm{T, AT<:AbstractMatrix{T}, VT <: AbstractVector{T}}
205+
206+ Represents a problem of the form:
207+ ```
208+ sense ⟨c, x⟩
209+ s.t. c_lb <= Ax <= c_ub
210+ v_lb <= x <= v_ub
211+ ```
212+ """
185213struct LPForm{T, AT<: AbstractMatrix{T} , VT <: AbstractVector{T} } <: LPMixedForm{T} # , V<:AbstractVector{T} #, M<:AbstractMatrix{T}}
186- direction :: MOI.OptimizationSense
214+ sense :: MOI.OptimizationSense
187215 c:: VT
188216 A:: AT
189217 c_lb:: VT
@@ -199,8 +227,18 @@ function MOI.get(model::LPForm, ::MOI.ConstraintSet, ci::AFF)
199227 return _bound_set (model. c_lb[ci. value], model. c_ub[ci. value])
200228end
201229
230+ """
231+ LPSolverForm{T, AT<:AbstractMatrix{T}, VT<:AbstractVector{T}}
232+
233+ Represents a problem of the form:
234+ ```
235+ sense ⟨c, x⟩
236+ s.t. Ax senses b
237+ v_lb <= x <= v_ub
238+ ```
239+ """
202240struct LPSolverForm{T, AT<: AbstractMatrix{T} , VT<: AbstractVector{T} } <: LPMixedForm{T}
203- direction :: MOI.OptimizationSense
241+ sense :: MOI.OptimizationSense
204242 c:: VT
205243 A:: AT
206244 b:: VT
@@ -225,6 +263,12 @@ function MOI.get(model::LPSolverForm, ::MOI.ConstraintSet, ci::AFF)
225263 end
226264end
227265
266+ """
267+ MILP{T, LP<:AbstractLPForm{T}}
268+
269+ A mixed-integer problem represented by a linear problem of type `LP`
270+ and a vector indicating each `VariableType`.
271+ """
228272struct MILP{T, LP<: AbstractLPForm{T} }
229273 lp:: LP
230274 variable_type:: Vector{VariableType}
0 commit comments