|
155 | 155 | Return the list of `VariableNode` that would be added if `BT` is used in `b`. |
156 | 156 | """ |
157 | 157 | function _variable_nodes( |
158 | | - b::LazyBridgeOptimizer, |
159 | | - ::Type{BT}, |
160 | | -) where {BT<:AbstractBridge} |
| 158 | + @nospecialize(b::LazyBridgeOptimizer), |
| 159 | + @nospecialize(BT), |
| 160 | +) |
161 | 161 | return map(added_constrained_variable_types(BT)) do (S,) |
162 | 162 | return node(b, S)::VariableNode |
163 | 163 | end |
|
169 | 169 | Return the list of `ConstraintNode` that would be added if `BT` is used in `b`. |
170 | 170 | """ |
171 | 171 | function _constraint_nodes( |
172 | | - b::LazyBridgeOptimizer, |
173 | | - ::Type{BT}, |
174 | | -) where {BT<:AbstractBridge} |
| 172 | + @nospecialize(b::LazyBridgeOptimizer), |
| 173 | + @nospecialize(BT), |
| 174 | +) |
175 | 175 | return ConstraintNode[ |
176 | 176 | node(b, F, S) for (F, S) in added_constraint_types(BT) |
177 | 177 | ] |
|
183 | 183 | Return the `Edge` or `ObjectiveEdge` in the hyper-graph associated with the |
184 | 184 | bridge `BT`, where `index` is the index of `BT` in the list of bridges. |
185 | 185 | """ |
186 | | -function _edge(b::LazyBridgeOptimizer, index::Int, BT::Type{<:AbstractBridge}) |
| 186 | +function _edge( |
| 187 | + @nospecialize(b::LazyBridgeOptimizer), |
| 188 | + @nospecialize(index::Int), |
| 189 | + @nospecialize(BT::Type{<:AbstractBridge}), |
| 190 | +) |
187 | 191 | return Edge( |
188 | 192 | index, |
189 | 193 | _variable_nodes(b, BT), |
|
247 | 251 |
|
248 | 252 | Return the `VariableNode` associated with set `S` in `b`. |
249 | 253 | """ |
250 | | -function node(b::LazyBridgeOptimizer, S::Type{<:MOI.AbstractSet}) |
| 254 | +function node( |
| 255 | + @nospecialize(b::LazyBridgeOptimizer), |
| 256 | + @nospecialize(S::Type{<:MOI.AbstractSet}), |
| 257 | +) |
251 | 258 | # If we support the set, the node is 0. |
252 | 259 | if ( |
253 | 260 | S <: MOI.AbstractScalarSet && |
|
304 | 311 | Return the `ConstraintNode` associated with constraint `F`-in-`S` in `b`. |
305 | 312 | """ |
306 | 313 | function node( |
307 | | - b::LazyBridgeOptimizer, |
308 | | - F::Type{<:MOI.AbstractFunction}, |
309 | | - S::Type{<:MOI.AbstractSet}, |
| 314 | + @nospecialize(b::LazyBridgeOptimizer), |
| 315 | + @nospecialize(F::Type{<:MOI.AbstractFunction}), |
| 316 | + @nospecialize(S::Type{<:MOI.AbstractSet}), |
310 | 317 | ) |
311 | 318 | # If we support the constraint type, the node is 0. |
312 | 319 | if MOI.supports_constraint(b.model, F, S) |
@@ -377,8 +384,8 @@ function _bridge_types( |
377 | 384 | end |
378 | 385 |
|
379 | 386 | function _bridge_types( |
380 | | - b::LazyBridgeOptimizer, |
381 | | - ::Type{<:Constraint.AbstractBridge}, |
| 387 | + @nospecialize(b::LazyBridgeOptimizer), |
| 388 | + @nospecialize(BT::Type{<:Constraint.AbstractBridge}), |
382 | 389 | ) |
383 | 390 | return b.constraint_bridge_types |
384 | 391 | end |
|
395 | 402 |
|
396 | 403 | Enable the use of the bridges of type `BT` by `b`. |
397 | 404 | """ |
398 | | -function add_bridge(b::LazyBridgeOptimizer, BT::Type{<:AbstractBridge}) |
| 405 | +function add_bridge( |
| 406 | + @nospecialize(b::LazyBridgeOptimizer), |
| 407 | + @nospecialize(BT::Type{<:AbstractBridge}), |
| 408 | +) |
399 | 409 | if !has_bridge(b, BT) |
400 | 410 | push!(_bridge_types(b, BT), BT) |
401 | 411 | _reset_bridge_graph(b) |
|
427 | 437 |
|
428 | 438 | Return a `Bool` indicating whether the bridges of type `BT` are used by `b`. |
429 | 439 | """ |
430 | | -function has_bridge(b::LazyBridgeOptimizer, BT::Type{<:AbstractBridge}) |
| 440 | +function has_bridge( |
| 441 | + @nospecialize(b::LazyBridgeOptimizer), |
| 442 | + @nospecialize(BT::Type{<:AbstractBridge}), |
| 443 | +)::Bool |
431 | 444 | return findfirst(isequal(BT), _bridge_types(b, BT)) !== nothing |
432 | 445 | end |
433 | 446 |
|
|
0 commit comments