Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Bridges/Constraint/bridge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Return a `Bool` indicating whether the bridges of type `BT` support bridging
function MOI.supports_constraint(
@nospecialize(BT::Type{<:AbstractBridge}),
@nospecialize(F::Type{<:MOI.AbstractFunction}),
@nospecialize(S::Type{<:MOI.AbstractSet}),
@nospecialize(S::Type{<:MOI.AbstractSet})
)
return false
end
Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/Constraint/single_bridge_optimizer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ end
function MOI.Bridges.supports_bridging_constraint(
@nospecialize(b::SingleBridgeOptimizer{BT}),
@nospecialize(F::Type{<:MOI.AbstractFunction}),
@nospecialize(S::Type{<:MOI.AbstractSet}),
@nospecialize(S::Type{<:MOI.AbstractSet})
) where {BT}
return MOI.supports_constraint(BT, F, S)
end
Expand Down
16 changes: 8 additions & 8 deletions src/Bridges/lazy_bridge_optimizer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Return the list of `VariableNode` that would be added if `BT` is used in `b`.
"""
function _variable_nodes(
@nospecialize(b::LazyBridgeOptimizer),
@nospecialize(BT),
@nospecialize(BT)
)
return map(added_constrained_variable_types(BT)) do (S,)
return node(b, S)::VariableNode
Expand All @@ -170,7 +170,7 @@ Return the list of `ConstraintNode` that would be added if `BT` is used in `b`.
"""
function _constraint_nodes(
@nospecialize(b::LazyBridgeOptimizer),
@nospecialize(BT),
@nospecialize(BT)
)
return ConstraintNode[
node(b, F, S) for (F, S) in added_constraint_types(BT)
Expand All @@ -186,7 +186,7 @@ bridge `BT`, where `index` is the index of `BT` in the list of bridges.
function _edge(
@nospecialize(b::LazyBridgeOptimizer),
@nospecialize(index::Int),
@nospecialize(BT::Type{<:AbstractBridge}),
@nospecialize(BT::Type{<:AbstractBridge})
)
return Edge(
index,
Expand Down Expand Up @@ -253,7 +253,7 @@ Return the `VariableNode` associated with set `S` in `b`.
"""
function node(
@nospecialize(b::LazyBridgeOptimizer),
@nospecialize(S::Type{<:MOI.AbstractSet}),
@nospecialize(S::Type{<:MOI.AbstractSet})
)
# If we support the set, the node is 0 unless the inner model reports a
# non-zero `VariableBridgingCost` (which can happen when the inner model is
Expand Down Expand Up @@ -327,7 +327,7 @@ Return the `ConstraintNode` associated with constraint `F`-in-`S` in `b`.
function node(
@nospecialize(b::LazyBridgeOptimizer),
@nospecialize(F::Type{<:MOI.AbstractFunction}),
@nospecialize(S::Type{<:MOI.AbstractSet}),
@nospecialize(S::Type{<:MOI.AbstractSet})
)
# If we support the constraint type, the node is 0 unless the inner model
# reports a non-zero `ConstraintBridgingCost` (which can happen when the
Expand Down Expand Up @@ -414,7 +414,7 @@ end

function _bridge_types(
@nospecialize(b::LazyBridgeOptimizer),
@nospecialize(BT::Type{<:Constraint.AbstractBridge}),
@nospecialize(BT::Type{<:Constraint.AbstractBridge})
)
return b.constraint_bridge_types
end
Expand All @@ -433,7 +433,7 @@ Enable the use of the bridges of type `BT` by `b`.
"""
function add_bridge(
@nospecialize(b::LazyBridgeOptimizer),
@nospecialize(BT::Type{<:AbstractBridge}),
@nospecialize(BT::Type{<:AbstractBridge})
)
if !has_bridge(b, BT)
push!(_bridge_types(b, BT), BT)
Expand Down Expand Up @@ -468,7 +468,7 @@ Return a `Bool` indicating whether the bridges of type `BT` are used by `b`.
"""
function has_bridge(
@nospecialize(b::LazyBridgeOptimizer),
@nospecialize(BT::Type{<:AbstractBridge}),
@nospecialize(BT::Type{<:AbstractBridge})
)::Bool
return findfirst(isequal(BT), _bridge_types(b, BT)) !== nothing
end
Expand Down
4 changes: 2 additions & 2 deletions src/Test/Test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function runtests(
warn_unsupported::Bool = false,
verbose::Bool = false,
exclude_tests_after::VersionNumber = v"999.0.0",
test_module = @__MODULE__,
test_module = @__MODULE__
)
tests = filter(names(test_module; all = true)) do name
return startswith("$name", "test_")
Expand Down Expand Up @@ -502,7 +502,7 @@ end
function _test_attribute_value_type(
@nospecialize(model::MOI.ModelLike),
@nospecialize(attribute::MOI.AbstractConstraintAttribute),
@nospecialize(ci::MOI.ConstraintIndex),
@nospecialize(ci::MOI.ConstraintIndex)
)
T = MOI.attribute_value_type(attribute)
@test @inferred(T, MOI.get(model, attribute, ci)) isa T
Expand Down
Loading