Skip to content

Commit

Permalink
Revert Variable changes
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Dec 30, 2024
1 parent b9048fa commit a74fddc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/Bridges/Variable/Variable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ Add all bridges defined in the `Bridges.Variable` submodule to `model`.
The coefficient type used is `T`.
"""
function add_all_bridges(model, ::Type{T}) where {T}
MOI.Bridges.add_bridge(model, ZerosBridge{T})
MOI.Bridges.add_bridge(model, FreeBridge{T})
MOI.Bridges.add_bridge(model, HermitianToSymmetricPSDBridge{T})
MOI.Bridges.add_bridge(model, NonposToNonnegBridge{T})
MOI.Bridges.add_bridge(model, ParameterToEqualToBridge{T})
MOI.Bridges.add_bridge(model, RSOCtoPSDBridge{T})
MOI.Bridges.add_bridge(model, RSOCtoSOCBridge{T})
MOI.Bridges.add_bridge(model, SOCtoRSOCBridge{T})
MOI.Bridges.add_bridge(model, VectorizeBridge{T})
MOI.Bridges.add_bridge(model, ZerosBridge{T})
MOI.Bridges.add_bridge(model, SOCtoRSOCBridge{T})
MOI.Bridges.add_bridge(model, RSOCtoSOCBridge{T})
MOI.Bridges.add_bridge(model, RSOCtoPSDBridge{T})
MOI.Bridges.add_bridge(model, HermitianToSymmetricPSDBridge{T})
MOI.Bridges.add_bridge(model, ParameterToEqualToBridge{T})
return
end

Expand Down
2 changes: 0 additions & 2 deletions src/Bridges/Variable/bridges/RSOCtoPSDBridge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ end
const RSOCtoPSD{T,OT<:MOI.ModelLike} =
SingleBridgeOptimizer{RSOCtoPSDBridge{T},OT}

MOI.Bridges.bridging_cost(::Type{<:RSOCtoPSDBridge}) = 1.5

function bridge_constrained_variable(
::Type{RSOCtoPSDBridge{T}},
model::MOI.ModelLike,
Expand Down
10 changes: 5 additions & 5 deletions test/Bridges/lazy_bridge_optimizer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1041,13 +1041,13 @@ Objective function of type `MOI.ScalarQuadraticFunction{$T}` is not supported an
"""
Bridge graph with 2 variable nodes, 5 constraint nodes and 2 objective nodes.
[1] constrained variables in `MOI.Reals` are bridged (distance 1) by $(MOI.Bridges.Variable.FreeBridge{T}).
[2] constrained variables in `MOI.RotatedSecondOrderCone` are bridged (distance 2.5) by $(MOI.Bridges.Variable.RSOCtoPSDBridge{T}).
(1) `MOI.ScalarQuadraticFunction{$T}`-in-`MOI.GreaterThan{$T}` constraints are bridged (distance 5.5) by $(MOI.Bridges.Constraint.QuadtoSOCBridge{T}).
(2) `MOI.VectorAffineFunction{$T}`-in-`MOI.RotatedSecondOrderCone` constraints are bridged (distance 4.5) by $(MOI.Bridges.Constraint.VectorSlackBridge{T,MOI.VectorAffineFunction{T},MOI.RotatedSecondOrderCone}).
[2] constrained variables in `MOI.RotatedSecondOrderCone` are bridged (distance 2) by $(MOI.Bridges.Variable.RSOCtoPSDBridge{T}).
(1) `MOI.ScalarQuadraticFunction{$T}`-in-`MOI.GreaterThan{$T}` constraints are bridged (distance 5) by $(MOI.Bridges.Constraint.QuadtoSOCBridge{T}).
(2) `MOI.VectorAffineFunction{$T}`-in-`MOI.RotatedSecondOrderCone` constraints are bridged (distance 4) by $(MOI.Bridges.Constraint.VectorSlackBridge{T,MOI.VectorAffineFunction{T},MOI.RotatedSecondOrderCone}).
(3) `MOI.VariableIndex`-in-`MOI.EqualTo{$T}` constraints are bridged (distance 1) by $(MOI.Bridges.Constraint.ScalarFunctionizeBridge{T,MOI.EqualTo{T}}).
(4) `MOI.VectorAffineFunction{$T}`-in-`MOI.Zeros` constraints are bridged (distance 1) by $(MOI.Bridges.Constraint.ScalarizeBridge{T,MOI.ScalarAffineFunction{T},MOI.EqualTo{T}}).
(5) `MOI.ScalarQuadraticFunction{$T}`-in-`MOI.LessThan{$T}` constraints are bridged (distance 5.5) by $(MOI.Bridges.Constraint.QuadtoSOCBridge{T}).
|1| objective function of type `MOI.ScalarQuadraticFunction{$T}` is bridged (distance 14) by $(MOI.Bridges.Objective.SlackBridge{T,MOI.ScalarQuadraticFunction{T},MOI.ScalarQuadraticFunction{T}}).
(5) `MOI.ScalarQuadraticFunction{$T}`-in-`MOI.LessThan{$T}` constraints are bridged (distance 5) by $(MOI.Bridges.Constraint.QuadtoSOCBridge{T}).
|1| objective function of type `MOI.ScalarQuadraticFunction{$T}` is bridged (distance 13) by $(MOI.Bridges.Objective.SlackBridge{T,MOI.ScalarQuadraticFunction{T},MOI.ScalarQuadraticFunction{T}}).
|2| objective function of type `MOI.VariableIndex` is bridged (distance 1) by $(MOI.Bridges.Objective.FunctionizeBridge{T,MOI.VariableIndex}).
""",
)
Expand Down

0 comments on commit a74fddc

Please sign in to comment.