@@ -9,19 +9,19 @@ s.t. b_i - A_i x ∈ C_i ∀ i
99```
1010with each `C_i` a cone defined in MOI.
1111"""
12- mutable struct GeometricConicForm{T, AT, VT , C} <: MOI.ModelLike
12+ mutable struct GeometricConicForm{T, AT, VB, VC , C} <: MOI.ModelLike
1313 num_rows:: Vector{Int}
1414 dimension:: Dict{Int, Int}
1515 sense:: MOI.OptimizationSense
1616 objective_constant:: T # The objective
1717 A:: Union{Nothing, AT} # The constraints
18- b:: VT # `b - Ax in cones`
19- c:: VT # `sense c'x + objective_constant`
18+ b:: VB # `b - Ax in cones`
19+ c:: VC # `sense c'x + objective_constant`
2020 cone_types:: C
2121 cone_types_dict:: Dict{DataType, Int}
2222
23- function GeometricConicForm {T, AT, VT } (cone_types) where {T, AT, VT }
24- model = new {T, AT, VT , typeof(cone_types)} ()
23+ function GeometricConicForm {T, AT, VB, VC } (cone_types) where {T, AT, VB, VC }
24+ model = new {T, AT, VB, VC , typeof(cone_types)} ()
2525 model. cone_types = cone_types
2626 model. cone_types_dict = Dict {DataType, Int} (
2727 s => i for (i, s) in enumerate (cone_types)
@@ -33,6 +33,10 @@ mutable struct GeometricConicForm{T, AT, VT, C} <: MOI.ModelLike
3333 end
3434end
3535
36+ function GeometricConicForm {T, AT, VT} (cone_types) where {T, AT, VT}
37+ return GeometricConicForm {T, AT, VT, VT} (cone_types)
38+ end
39+
3640_set_type (:: MOI.ConstraintIndex{F,S} ) where {F,S} = S
3741
3842MOI. is_empty (model:: GeometricConicForm ) = model. A === nothing
@@ -68,7 +72,7 @@ function MOI.set(::GeometricConicForm, ::MOI.VariablePrimalStart,
6872 :: MOI.VariableIndex , :: Nothing )
6973end
7074function MOI. set (model:: GeometricConicForm{T} , :: MOI.VariablePrimalStart ,
71- vi:: MOI.VariableIndex , value:: T ) where T
75+ vi:: MOI.VariableIndex , value:: T ) where {T}
7276 model. primal[vi. value] = value
7377end
7478function MOI. set (:: GeometricConicForm , :: MOI.ConstraintPrimalStart ,
9397variable_index_value (t:: MOI.ScalarAffineTerm ) = t. variable_index. value
9498variable_index_value (t:: MOI.VectorAffineTerm ) = variable_index_value (t. scalar_term)
9599function MOI. set (model:: GeometricConicForm{T} , :: MOI.ObjectiveFunction ,
96- f:: MOI.ScalarAffineFunction{T} ) where T
100+ f:: MOI.ScalarAffineFunction{T} ) where {T}
97101 c = Vector (sparsevec (variable_index_value .(f. terms), MOI. coefficient .(f. terms),
98102 model. A. n))
99103 model. objective_constant = f. constant
0 commit comments