@@ -149,6 +149,7 @@ function _reset_bridge_graph(b::LazyBridgeOptimizer)
149149 return
150150end
151151
152+ @nospecialize
152153"""
153154 _variable_nodes(b::LazyBridgeOptimizer, ::Type{BT}) where {BT}
154155
@@ -162,7 +163,9 @@ function _variable_nodes(
162163 return node (b, S):: VariableNode
163164 end
164165end
166+ @specialize
165167
168+ @nospecialize
166169"""
167170 _constraint_nodes(b::LazyBridgeOptimizer, ::Type{BT}) where {BT}
168171
@@ -176,7 +179,9 @@ function _constraint_nodes(
176179 node (b, F, S) for (F, S) in added_constraint_types (BT)
177180 ]
178181end
182+ @specialize
179183
184+ @nospecialize
180185"""
181186 _edge(b::LazyBridgeOptimizer, index::Int, BT::Type{<:AbstractBridge})
182187
@@ -191,6 +196,7 @@ function _edge(b::LazyBridgeOptimizer, index::Int, BT::Type{<:AbstractBridge})
191196 bridging_cost (BT),
192197 )
193198end
199+ @specialize
194200
195201# Method for objective bridges because they produce ObjectiveEdge.
196202function _edge (
@@ -376,12 +382,14 @@ function _bridge_types(
376382 return b. variable_bridge_types
377383end
378384
385+ @nospecialize
379386function _bridge_types (
380387 b:: LazyBridgeOptimizer ,
381388 :: Type{<:Constraint.AbstractBridge} ,
382389)
383390 return b. constraint_bridge_types
384391end
392+ @specialize
385393
386394function _bridge_types (
387395 b:: LazyBridgeOptimizer ,
@@ -390,6 +398,7 @@ function _bridge_types(
390398 return b. objective_bridge_types
391399end
392400
401+ @nospecialize
393402"""
394403 add_bridge(b::LazyBridgeOptimizer, BT::Type{<:AbstractBridge})
395404
@@ -402,6 +411,7 @@ function add_bridge(b::LazyBridgeOptimizer, BT::Type{<:AbstractBridge})
402411 end
403412 return
404413end
414+ @specialize
405415
406416"""
407417 remove_bridge(b::LazyBridgeOptimizer, BT::Type{<:AbstractBridge})
@@ -422,14 +432,16 @@ function remove_bridge(b::LazyBridgeOptimizer, BT::Type{<:AbstractBridge})
422432 return
423433end
424434
435+ @nospecialize
425436"""
426437 has_bridge(b::LazyBridgeOptimizer, BT::Type{<:AbstractBridge})
427438
428439Return a `Bool` indicating whether the bridges of type `BT` are used by `b`.
429440"""
430- function has_bridge (b:: LazyBridgeOptimizer , BT:: Type{<:AbstractBridge} )
441+ function has_bridge (b:: LazyBridgeOptimizer , BT:: Type{<:AbstractBridge} ):: Bool
431442 return findfirst (isequal (BT), _bridge_types (b, BT)) != = nothing
432443end
444+ @specialize
433445
434446# It only bridges when the constraint is not supporting, hence the name "Lazy"
435447function is_bridged (b:: LazyBridgeOptimizer , S:: Type{<:MOI.AbstractScalarSet} )
0 commit comments