@@ -10,12 +10,9 @@ abstract type FlipSignBridge{
1010 S1<: MOI.AbstractSet , S2<: MOI.AbstractSet ,
1111 F<: MOI.AbstractFunction } <: AbstractBridge end
1212
13- # Apparently, Julia does not consider, say `GreaterToLessBridge{T}` to be a
14- # subtype of `FlipSignBridge{MOI.GreaterTo{T}, MOI.LessThan{T}}` but consider
15- # it to be a subtype of `FlipSignBridge{MOI.GreaterTo{T}, MOI.LessThan{T}, <:Any}`
16- function MOI. supports_constraint (:: Type{<:FlipSignBridge{S1, S2, <:Any}} ,
13+ function MOI. supports_constraint (:: Type{<:FlipSignBridge{S1}} ,
1714 :: Type{<:MOI.AbstractScalarFunction} ,
18- :: Type{S1} ) where {S1<: MOI.AbstractSet , S2 <: MOI.AbstractSet }
15+ :: Type{S1} ) where {S1<: MOI.AbstractSet }
1916 return true
2017end
2118function added_constraint_types (
@@ -67,14 +64,14 @@ function MOI.modify(model::MOI.ModelLike, bridge::FlipSignBridge,
6764end
6865
6966"""
70- GreaterToLessBridge{T, F} <: FlipSignBridge{ MOI.GreaterThan{T},
71- MOI.LessThan{T}, F}
67+ GreaterToLessBridge{T, F<: MOI.AbstractScalarFunction} <:
68+ FlipSignBridge{MOI.GreaterThan{T}, MOI.LessThan{T}, F}
7269
7370Transforms a `G`-in-`GreaterThan{T}` constraint into an `F`-in-`LessThan{T}`
7471constraint.
7572"""
76- struct GreaterToLessBridge{T, F} <: FlipSignBridge { MOI. GreaterThan{T},
77- MOI. LessThan{T}, F}
73+ struct GreaterToLessBridge{T, F<: MOI.AbstractScalarFunction } < :
74+ FlipSignBridge{MOI . GreaterThan{T}, MOI. LessThan{T}, F}
7875 flipped_constraint:: CI{F, MOI.LessThan{T}}
7976end
8077function GreaterToLessBridge {T, F} (model:: MOI.ModelLike ,
@@ -97,14 +94,14 @@ function MOI.set(model::MOI.ModelLike, attr::MOI.ConstraintSet,
9794end
9895
9996"""
100- LessToGreaterBridge{T, F} <: FlipSignBridge{ MOI.LessThan{T},
101- MOI.GreaterThan{T}, F}
97+ LessToGreaterBridge{T, F<: MOI.AbstractScalarFunction} <:
98+ FlipSignBridge{MOI.LessThan{T}, MOI.GreaterThan{T}, F}
10299
103100Transforms a `G`-in-`LessThan{T}` constraint into an `F`-in-`GreaterThan{T}`
104101constraint.
105102"""
106- struct LessToGreaterBridge{T, F} <: FlipSignBridge { MOI. LessThan{T},
107- MOI. GreaterThan{T}, F}
103+ struct LessToGreaterBridge{T, F<: MOI.AbstractScalarFunction } < :
104+ FlipSignBridge{MOI . LessThan{T}, MOI. GreaterThan{T}, F}
108105 flipped_constraint:: CI{F, MOI.GreaterThan{T}}
109106end
110107function LessToGreaterBridge {T, F} (model:: MOI.ModelLike ,
@@ -127,13 +124,13 @@ function MOI.set(model::MOI.ModelLike, attr::MOI.ConstraintSet,
127124end
128125
129126"""
130- NonnegToNonposBridge{T, F}
127+ NonnegToNonposBridge{T, F<:MOI.AbstractVectorFunction }
131128
132129Transforms a `G`-in-`Nonnegatives` constraint into a `F`-in-`Nonpositives`
133130constraint.
134131"""
135- struct NonnegToNonposBridge{T, F} <: FlipSignBridge { MOI. Nonnegatives,
136- MOI. Nonpositives, F}
132+ struct NonnegToNonposBridge{T, F<: MOI.AbstractVectorFunction } < :
133+ FlipSignBridge{MOI . Nonnegatives, MOI. Nonpositives, F}
137134 flipped_constraint:: CI{F, MOI.Nonpositives}
138135end
139136function NonnegToNonposBridge {T, F} (model:: MOI.ModelLike ,
@@ -152,13 +149,13 @@ function concrete_bridge_type(::Type{<:NonnegToNonposBridge{T}},
152149end
153150
154151"""
155- NonposToNonnegBridge{T, F}
152+ NonposToNonnegBridge{T, F<:MOI.AbstractVectorFunction }
156153
157154Transforms a `G`-in-`Nonpositives` constraint into a `F`-in-`Nonnegatives`
158155constraint.
159156"""
160- struct NonposToNonnegBridge{T, F} <: FlipSignBridge { MOI. Nonpositives,
161- MOI. Nonnegatives, F}
157+ struct NonposToNonnegBridge{T, F<: MOI.AbstractVectorFunction } < :
158+ FlipSignBridge{MOI . Nonpositives, MOI. Nonnegatives, F}
162159 flipped_constraint:: CI{F, MOI.Nonnegatives}
163160end
164161function NonposToNonnegBridge {T, F} (model:: MOI.ModelLike ,
0 commit comments