53
53
_bounds(s)
54
54
55
55
"""
56
- _bounds (s:: MOI.EqualTo{Tv } ) where {Tv } = s. value, s. value
57
- _bounds (s:: MOI.LessThan{Tv } ) where {Tv } = Tv (- Inf ), s. upper
58
- _bounds (s:: MOI.GreaterThan{Tv } ) where {Tv } = s. lower, Tv (Inf )
59
- _bounds (s:: MOI.Interval{Tv } ) where {Tv } = s. lower, s. upper
56
+ _bounds (s:: MOI.EqualTo{T } ) where {T } = s. value, s. value
57
+ _bounds (s:: MOI.LessThan{T } ) where {T } = T (- Inf ), s. upper
58
+ _bounds (s:: MOI.GreaterThan{T } ) where {T } = s. lower, T (Inf )
59
+ _bounds (s:: MOI.Interval{T } ) where {T } = s. lower, s. upper
60
60
61
- const SCALAR_SETS{Tv } = Union{
62
- MOI. LessThan{Tv },
63
- MOI. GreaterThan{Tv },
64
- MOI. EqualTo{Tv },
65
- MOI. Interval{Tv }
66
- } where {Tv }
61
+ const SCALAR_SETS{T } = Union{
62
+ MOI. LessThan{T },
63
+ MOI. GreaterThan{T },
64
+ MOI. EqualTo{T },
65
+ MOI. Interval{T }
66
+ } where {T }
67
67
68
68
69
69
@@ -76,12 +76,12 @@ const SCALAR_SETS{Tv} = Union{
76
76
# ==============================================================================
77
77
78
78
"""
79
- Optimizer{Tv }
79
+ Optimizer{T }
80
80
81
81
Wrapper for MOI.
82
82
"""
83
- mutable struct Optimizer{Tv } <: MOI.AbstractOptimizer
84
- inner:: Model{Tv }
83
+ mutable struct Optimizer{T } <: MOI.AbstractOptimizer
84
+ inner:: Model{T }
85
85
86
86
is_feas:: Bool # Model is feasibility problem if true
87
87
@@ -91,7 +91,7 @@ mutable struct Optimizer{Tv} <: MOI.AbstractOptimizer
91
91
var_indices_moi:: Vector{MOI.VariableIndex}
92
92
var_indices:: Dict{MOI.VariableIndex, Int}
93
93
con_indices_moi:: Vector{MOI.ConstraintIndex}
94
- con_indices:: Dict{MOI.ConstraintIndex{MOI.ScalarAffineFunction{Tv }, <:SCALAR_SETS{Tv }}, Int}
94
+ con_indices:: Dict{MOI.ConstraintIndex{MOI.ScalarAffineFunction{T }, <:SCALAR_SETS{T }}, Int}
95
95
96
96
# Variable and constraint names
97
97
name2var:: Dict{String, MOI.VariableIndex}
@@ -104,14 +104,14 @@ mutable struct Optimizer{Tv} <: MOI.AbstractOptimizer
104
104
# Keep track of bound constraints
105
105
var2bndtype:: Dict{MOI.VariableIndex, Set{Type{<:MOI.AbstractScalarSet}}}
106
106
107
- function Optimizer {Tv } (;kwargs... ) where {Tv }
108
- m = new {Tv } (
109
- Model {Tv } (), false ,
107
+ function Optimizer {T } (;kwargs... ) where {T }
108
+ m = new {T } (
109
+ Model {T } (), false ,
110
110
# Variable and constraint counters
111
111
0 , 0 ,
112
112
# Index mapping
113
113
MOI. VariableIndex[], Dict {MOI.VariableIndex, Int} (),
114
- MOI. ConstraintIndex[], Dict {MOI.ConstraintIndex{MOI.ScalarAffineFunction, <:SCALAR_SETS{Tv }}, Int} (),
114
+ MOI. ConstraintIndex[], Dict {MOI.ConstraintIndex{MOI.ScalarAffineFunction, <:SCALAR_SETS{T }}, Int} (),
115
115
# Name -> index mapping
116
116
Dict {String, MOI.VariableIndex} (), Dict {String, MOI.ConstraintIndex} (),
117
117
Dict {MOI.ConstraintIndex, String} (), # Variable bounds tracking
0 commit comments