Skip to content

Commit 21a4768

Browse files
committed
[Bridges] explicitly document bridges not added by default
1 parent 1be26a6 commit 21a4768

File tree

1 file changed

+36
-11
lines changed

1 file changed

+36
-11
lines changed

src/Bridges/Constraint/Constraint.jl

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ end
2525
add_all_bridges(bridged_model, ::Type{T}) where {T}
2626
2727
Add all bridges defined in the `Bridges.Constraint` submodule to
28-
`bridged_model`. The coefficient type used is `T`.
28+
`bridged_model`.
29+
30+
The coefficient type used is `T`.
2931
"""
3032
function add_all_bridges(bridged_model, ::Type{T}) where {T}
3133
if T <: AbstractFloat
@@ -50,9 +52,6 @@ function add_all_bridges(bridged_model, ::Type{T}) where {T}
5052
MOI.Bridges.add_bridge(bridged_model, SplitComplexEqualToBridge{T})
5153
MOI.Bridges.add_bridge(bridged_model, SplitComplexZerosBridge{T})
5254
MOI.Bridges.add_bridge(bridged_model, QuadtoSOCBridge{T})
53-
# We do not add `(R)SOCtoNonConvexQuad` because it starts with a convex
54-
# conic constraint and generate a non-convex constraint (in the QCP
55-
# interpretation).
5655
MOI.Bridges.add_bridge(bridged_model, NormInfinityBridge{T})
5756
MOI.Bridges.add_bridge(bridged_model, NormOneBridge{T})
5857
MOI.Bridges.add_bridge(bridged_model, GeoMeantoRelEntrBridge{T})
@@ -77,9 +76,6 @@ function add_all_bridges(bridged_model, ::Type{T}) where {T}
7776
MOI.Bridges.add_bridge(bridged_model, RootDetBridge{T})
7877
MOI.Bridges.add_bridge(bridged_model, RSOCtoSOCBridge{T})
7978
MOI.Bridges.add_bridge(bridged_model, SOCtoRSOCBridge{T})
80-
# We do not add `SOCtoPSDBridge` as transforming the `SOC` to `RSOC` and
81-
# then to `PSD` produces a smaller SDP constraint.
82-
# MOI.Bridges.add_bridge(bridged_model, SOCtoPSDBridge{T})
8379
MOI.Bridges.add_bridge(bridged_model, RSOCtoPSDBridge{T})
8480
MOI.Bridges.add_bridge(bridged_model, IndicatorActiveOnFalseBridge{T})
8581
MOI.Bridges.add_bridge(bridged_model, IndicatorSOS1Bridge{T})
@@ -89,9 +85,6 @@ function add_all_bridges(bridged_model, ::Type{T}) where {T}
8985
MOI.Bridges.add_bridge(bridged_model, ZeroOneBridge{T})
9086
MOI.Bridges.add_bridge(bridged_model, IntegerToZeroOneBridge{T})
9187
MOI.Bridges.add_bridge(bridged_model, InequalityToComplementsBridge{T})
92-
# Do not add by default
93-
# MOI.Bridges.add_bridge(bridged_model, NumberConversionBridge{T})
94-
# Constraint programming bridges
9588
MOI.Bridges.add_bridge(bridged_model, AllDifferentToCountDistinctBridge{T})
9689
MOI.Bridges.add_bridge(
9790
bridged_model,
@@ -108,11 +101,43 @@ function add_all_bridges(bridged_model, ::Type{T}) where {T}
108101
MOI.Bridges.add_bridge(bridged_model, SOS1ToMILPBridge{T})
109102
MOI.Bridges.add_bridge(bridged_model, SOS2ToMILPBridge{T})
110103
MOI.Bridges.add_bridge(bridged_model, IndicatorToMILPBridge{T})
111-
112104
MOI.Bridges.add_bridge(
113105
bridged_model,
114106
ExponentialConeToScalarNonlinearFunctionBridge{T},
115107
)
108+
# Bridges not added by default:
109+
#
110+
# * FunctionConversionBridge
111+
# This bridge is not added because, even though it is not abstract, it
112+
# is highly parameterized, and parameterized versions such as
113+
# ScalarFunctionizeBridge are added.
114+
# * IndicatorSetMapBridge
115+
# This bridge is not added because, even though it is not abstract, it
116+
# is highly parameterized, and parameterized versions such as
117+
# IndicatorGreaterToLessThanBridge are added.
118+
# * NormSpecialCaseBridge
119+
# This bridge is not added because, even though it is not abstract, it
120+
# is highly parameterized, and parameterized versions such as
121+
# NormOneConeToNormConeBridge are added.
122+
# * NumberConversionBridge
123+
# This bridge is not added by default because it would silently enable
124+
# models with mixed precision. In most cases, this is a bug in the
125+
# user's code, so we leave this bridge as opt-in.
126+
# * RSOCtoNonConvexQuadBridge
127+
# This bridge is not added by default because it starts with a convex
128+
# conic constraint and generate a non-convex constraint (in the QCP
129+
# interpretation).
130+
# * SOCtoNonConvexQuadBridge
131+
# This bridge is not added by default because it starts with a convex
132+
# conic constraint and generate a non-convex constraint (in the QCP
133+
# interpretation).
134+
# * SOCtoPSDBridge
135+
# This bridge is not added because transforming the `SOC` to `RSOC` and
136+
# then to `PSD` produces a smaller SDP constraint. `RSOCtoPSDBridge` is
137+
# added by default.
138+
# * SetConversionBridge
139+
# This bridge is not added because, even though it is not abstract, it
140+
# is highly parameterized, and it intended for use by MOI extensions.
116141
return
117142
end
118143

0 commit comments

Comments
 (0)