From 678ab12906d373266edf6fb22664f2eb957f1b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Fri, 6 Oct 2023 08:45:43 +0200 Subject: [PATCH] Fixes --- docs/src/submodules/Bridges/list_of_bridges.md | 3 ++- src/Bridges/Objective/bridges/conversion.jl | 6 +++--- test/Bridges/lazy_bridge_optimizer.jl | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/src/submodules/Bridges/list_of_bridges.md b/docs/src/submodules/Bridges/list_of_bridges.md index 3a7c8e2c4b..60e3236e65 100644 --- a/docs/src/submodules/Bridges/list_of_bridges.md +++ b/docs/src/submodules/Bridges/list_of_bridges.md @@ -88,8 +88,9 @@ These bridges are subtypes of [`Bridges.Objective.AbstractBridge`](@ref). ```@docs Bridges.Objective.FunctionizeBridge Bridges.Objective.QuadratizeBridge -Bridges.Objective.SlackBridge Bridges.Objective.VectorFunctionizeBridge +Bridges.Objective.FunctionConversionBridge +Bridges.Objective.SlackBridge Bridges.Objective.VectorSlackBridge ``` diff --git a/src/Bridges/Objective/bridges/conversion.jl b/src/Bridges/Objective/bridges/conversion.jl index 5c4b6ddce2..c0e573f551 100644 --- a/src/Bridges/Objective/bridges/conversion.jl +++ b/src/Bridges/Objective/bridges/conversion.jl @@ -112,7 +112,7 @@ function MOI.get( end """ - FunctionizeBridge{T,G} + FunctionizeBridge{T,G} <: FunctionConversionBridge{T,MOI.ScalarAffineFunction{T},G} `FunctionizeBridge` implements the following reformulations: @@ -140,7 +140,7 @@ const Functionize{T,OT<:MOI.ModelLike} = SingleBridgeOptimizer{FunctionizeBridge{T},OT} """ - QuadratizeBridge{T,G} + QuadratizeBridge{T,G} <: FunctionConversionBridge{T,MOI.ScalarQuadraticFunction{T},G} `QuadratizeBridge` implements the following reformulations: @@ -168,7 +168,7 @@ const Quadratize{T,OT<:MOI.ModelLike} = SingleBridgeOptimizer{QuadratizeBridge{T},OT} """ - VectorFunctionizeBridge{T,G} + VectorFunctionizeBridge{T,G} <: FunctionConversionBridge{T,MOI.VectorAffineFunction{T},G} `VectorFunctionizeBridge` implements the following reformulations: diff --git a/test/Bridges/lazy_bridge_optimizer.jl b/test/Bridges/lazy_bridge_optimizer.jl index 4695af4451..8fa70aa3e0 100644 --- a/test/Bridges/lazy_bridge_optimizer.jl +++ b/test/Bridges/lazy_bridge_optimizer.jl @@ -746,7 +746,7 @@ Bridge graph with 1 variable nodes, 3 constraint nodes and 0 objective nodes. MOI.Bridges.add_bridge(bridged, MOI.Bridges.Objective.FunctionizeBridge{T}) @test MOI.supports(bridged, MOI.ObjectiveFunction{MOI.VariableIndex}()) @test MOI.Bridges.bridge_type(bridged, MOI.VariableIndex) == - MOI.Bridges.Objective.FunctionizeBridge{T} + MOI.Bridges.Objective.FunctionizeBridge{T,MOI.VariableIndex} @test MOI.supports(bridged, attr) @test MOI.Bridges.bridge_type(bridged, F) == MOI.Bridges.Objective.SlackBridge{T,F,F} @@ -1085,7 +1085,7 @@ Bridge graph with 2 variable nodes, 5 constraint nodes and 2 objective nodes. (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) 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}). + |2| objective function of type `MOI.VariableIndex` is bridged (distance 1) by $(MOI.Bridges.Objective.FunctionizeBridge{T,MOI.VariableIndex}). """, ) end