Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dual of equality from slack #2508

Merged
merged 1 commit into from
May 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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)

Check warning on line 138 in src/Bridges/Constraint/bridges/slack.jl

View check run for this annotation

Codecov / codecov/patch

src/Bridges/Constraint/bridges/slack.jl#L138

Added line #L138 was not covered by tests
end

function MOI.set(
Expand Down
Loading