@@ -285,15 +285,13 @@ If you implement this method, you must also implement
285285function final_touch end
286286
287287"""
288- cost (BT::Type{<:AbstractBridge})::Int
288+ bridging_cost (BT::Type{<:AbstractBridge})::Int
289289
290- Return the * cost* a bridge of type `BT`.
290+ Return the cost of adding a bridge of type `BT`.
291291
292- This cost is used to compute the [`bridging_cost`](@ref).
293-
294- There is a default implementation for any [`AbstractBridge`](@ref) returning
295- `1` so this should only be implemented for bridges returning a distance
296- different from `1`.
292+ The default implementation for any [`AbstractBridge`](@ref) returns `1`, so this
293+ method should only be implemented for bridges returning a cost different from
294+ `1`.
297295
298296## Example
299297
@@ -302,22 +300,23 @@ constraints from a given function type to a function type to a wider one,
302300we want it to have lower priority.
303301
304302For example, we want to prioritize bridging a
305- [`MOI.ScalarAffineFunction`](@ref)-in-[`MOI.LessThan`](@ref) constraint into
306- a [`MOI.VectorAffineFunction`](@ref)-in-[`MOI.Nonnegatives`](@ref) constraint
307- over bridging it to a [`MOI.ScalarQuadraticFunction`](@ref)-in-[`MOI.LessThan`](@ref) constraint.
303+ [`MOI.ScalarAffineFunction`](@ref)-in-[`MOI.LessThan`](@ref) constraint into a
304+ [`MOI.VectorAffineFunction`](@ref)-in-[`MOI.Nonnegatives`](@ref) constraint
305+ over bridging it to a [`MOI.ScalarQuadraticFunction`](@ref)-in-[`MOI.LessThan`](@ref)
306+ constraint.
308307
309308For this reason, the [`Bridges.Constraint.FunctionConversionBridge`](@ref) is
310309given a cost of `10`:
311310
312311```jldoctest; setup=(import MathOptInterface as MOI)
313- julia> T = Float64;
314-
315- julia> F = MOI.ScalarQuadraticFunction{T};
312+ julia> F = MOI.ScalarQuadraticFunction{Float64};
316313
317- julia> G = MOI.ScalarAffineFunction{T };
314+ julia> G = MOI.ScalarAffineFunction{Float64 };
318315
319- julia> MOI.Bridges.cost(MOI.Bridges.Constraint.FunctionConversionBridge{T,F,G})
316+ julia> MOI.Bridges.bridging_cost(
317+ MOI.Bridges.Constraint.FunctionConversionBridge{Float64,F,G},
318+ )
32031910
321320```
322321"""
323- cost (:: Type{<:AbstractBridge} ) = 1
322+ bridging_cost (:: Type{<:AbstractBridge} ) = 1
0 commit comments