From 8027c5ea90e6877695fc8bf929b023d93ede212f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sun, 26 May 2024 19:39:21 +0200 Subject: [PATCH] Use dual of equality from slack --- src/Bridges/Constraint/bridges/slack.jl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Bridges/Constraint/bridges/slack.jl b/src/Bridges/Constraint/bridges/slack.jl index 4109d9ccbf..3bc5c8ea3d 100644 --- a/src/Bridges/Constraint/bridges/slack.jl +++ b/src/Bridges/Constraint/bridges/slack.jl @@ -127,9 +127,15 @@ function MOI.get( bridge::_AbstractSlackBridge, ) # The dual constraint on slack (since it is free) is - # -dual_slack_in_set + dual_equality = 0 so the two duals are + # `-dual_slack_in_set + dual_equality = 0` so the two duals are # equal and we can return either one of them. - return MOI.get(model, a, bridge.slack_in_set) + # We decide to use the dual of the equality constraints because + # the `slack_in_set` constraint might be bridge by a variable bridge that + # does not # support `ConstraintDual`. This is the case if the adjoint of + # the linear map on which the bridge is based is not invertible, as for + # instance with `Variable.ZerosBridge` or + # `SumOfSquares.Bridges.Variable.KernelBridge`. + return MOI.get(model, a, bridge.equality) end function MOI.set(