Skip to content

Commit

Permalink
[Bridges] use dual of equality in slack bridge (#2508)
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Jun 14, 2024
1 parent 08d3400 commit 8c82526
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Bridges/Constraint/bridges/slack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 8c82526

Please sign in to comment.