Skip to content

Add bridge from Hermitian PSD to complex function in Symmetric PSD #2724

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

Merged
merged 10 commits into from
Apr 19, 2025

Conversation

blegat
Copy link
Member

@blegat blegat commented Apr 15, 2025

See jump-dev/SeDuMi.jl#28 (comment)

Basic

  • Create a new file in src/Bridges/XXX/bridges named after the type of
    the bridge
  • Define the bridge, following existing examples. The name of the bridge
    struct must end in Bridge
  • Check if your bridge can be a subtype of MOI.Bridges.Constraint.SetMapBridge
  • Define a new const that is a SingleBridgeOptimizer wrapping the
    new bridge. The name of the const must be the name of the bridge, less
    the Bridge suffix
  • If the bridge should be enabled by default, add the bridge to
    add_all_bridges at the bottom of src/Bridges/XXX/XXX.jl

Tests

  • Create a new file in the appropriate subdirectory of tests/Bridges/XXX
    named after the type of the bridge
  • Use MOI.Bridges.runtests to test various inputs and outputs of the
    bridge
  • If, after opening the pull request to add the bridge, some lines are not
    covered by the tests, add additional bridge-specific tests to cover the
    untested lines.

Documentation

  • Add a docstring which uses the same template as existing bridges.

Final touch

If the bridge depends on run-time values of other variables and constraints in
the model:

  • Implement MOI.Utilities.needs_final_touch(::Bridge)
  • Implement MOI.Utilities.final_touch(::Bridge, ::MOI.ModelLike)
  • Ensure that final_touch can be called multiple times in a row

@odow
Copy link
Member

odow commented Apr 15, 2025

What's the reason not to define the SingleBridgeOptimizer?

Copy link
Member

@odow odow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked in detail, but if you're happy I'm happy.

@blegat blegat merged commit e57373b into master Apr 19, 2025
31 checks passed
@blegat blegat deleted the bl/hermitian_to_complex_symm branch April 19, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants