|
7 | 7 | """
|
8 | 8 | FeasibilityRelaxation(
|
9 | 9 | penalties = Dict{MOI.ConstraintIndex,Float64}(),
|
10 |
| - ) <: MOI.AbstractFunctionModification |
| 10 | + ) |
11 | 11 |
|
12 | 12 | A problem modifier that, when passed to [`MOI.modify`](@ref), destructively
|
13 | 13 | modifies the model in-place to create a feasibility relaxation.
|
@@ -62,7 +62,7 @@ VariableIndex-in-GreaterThan{Float64}
|
62 | 62 | v[2] >= 0.0
|
63 | 63 | ```
|
64 | 64 | """
|
65 |
| -mutable struct FeasibilityRelaxation{T} <: MOI.AbstractFunctionModification |
| 65 | +mutable struct FeasibilityRelaxation{T} |
66 | 66 | penalties::Dict{MOI.ConstraintIndex,T}
|
67 | 67 | scale::T
|
68 | 68 | function FeasibilityRelaxation(p::Dict{MOI.ConstraintIndex,T}) where {T}
|
|
122 | 122 | function MOI.modify(
|
123 | 123 | model::MOI.ModelLike,
|
124 | 124 | ci::MOI.ConstraintIndex{F,<:MOI.AbstractScalarSet},
|
125 |
| - relax::FeasibilityRelaxation, |
| 125 | + relax::FeasibilityRelaxation{T}, |
126 | 126 | ) where {T,F<:Union{MOI.ScalarAffineFunction{T},MOI.ScalarQuadraticFunction{T}}}
|
127 | 127 | y = MOI.add_variable(model)
|
128 | 128 | z = MOI.add_variable(model)
|
|
141 | 141 | function MOI.modify(
|
142 | 142 | model::MOI.ModelLike,
|
143 | 143 | ci::MOI.ConstraintIndex{F,MOI.GreaterThan{T}},
|
144 |
| - relax::FeasibilityRelaxation, |
| 144 | + relax::FeasibilityRelaxation{T}, |
145 | 145 | ) where {T,F<:Union{MOI.ScalarAffineFunction{T},MOI.ScalarQuadraticFunction{T}}}
|
146 | 146 | # Performance optimization: we don't need the z relaxation variable.
|
147 | 147 | y = MOI.add_variable(model)
|
|
157 | 157 | function MOI.modify(
|
158 | 158 | model::MOI.ModelLike,
|
159 | 159 | ci::MOI.ConstraintIndex{F,MOI.LessThan{T}},
|
160 |
| - relax::FeasibilityRelaxation, |
| 160 | + relax::FeasibilityRelaxation{T}, |
161 | 161 | ) where {T,F<:Union{MOI.ScalarAffineFunction{T},MOI.ScalarQuadraticFunction{T}}}
|
162 | 162 | # Performance optimization: we don't need the y relaxation variable.
|
163 | 163 | z = MOI.add_variable(model)
|
|
0 commit comments