Skip to content

Commit 6d9378a

Browse files
authored
[Bridges] use dual of equality in slack bridge (#2508)
1 parent 62b88c8 commit 6d9378a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Bridges/Constraint/bridges/slack.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,15 @@ function MOI.get(
127127
bridge::_AbstractSlackBridge,
128128
)
129129
# The dual constraint on slack (since it is free) is
130-
# -dual_slack_in_set + dual_equality = 0 so the two duals are
130+
# `-dual_slack_in_set + dual_equality = 0` so the two duals are
131131
# equal and we can return either one of them.
132-
return MOI.get(model, a, bridge.slack_in_set)
132+
# We decide to use the dual of the equality constraints because
133+
# the `slack_in_set` constraint might be bridge by a variable bridge that
134+
# does not # support `ConstraintDual`. This is the case if the adjoint of
135+
# the linear map on which the bridge is based is not invertible, as for
136+
# instance with `Variable.ZerosBridge` or
137+
# `SumOfSquares.Bridges.Variable.KernelBridge`.
138+
return MOI.get(model, a, bridge.equality)
133139
end
134140

135141
function MOI.set(

0 commit comments

Comments
 (0)