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

TODO list #2

Open
8 of 20 tasks
blegat opened this issue Dec 12, 2024 · 0 comments
Open
8 of 20 tasks

TODO list #2

blegat opened this issue Dec 12, 2024 · 0 comments

Comments

@blegat
Copy link
Owner

blegat commented Dec 12, 2024

This is just the comment of jump-dev/MathOptInterface.jl#2198 moved here

Note that once this is done, you can write an SDP in SDPA format directly in JuMP with something like

C = rand(d, d)
A = [rand(d, d) for i in 1:m]
model = Model()
@variable(model, x[1:m+1] in MOI.SetWithDotProducts(
    MOI.PositiveSemidefiniteConeTriangle(d),
    MOI.TriangleVectorization.([A; [C]]),
))
@constraint(model, x[1:m] == b)
@objective(model, Min, x[end])

or

model = Model()
@variable(model, y[1:m])
@constraint(model, [y; -1] in MOI.LinearCombinationInSet([A; [C]]))
@objective(model, Max, dot(y, b))

And Dualization.dualize should take you from one to the other one!

Solvers implementing this:

Basic

  • Add a new AbstractScalarSet or AbstractVectorSet to src/sets.jl
  • If isbitstype(S) == false, implement Base.copy(set::S)
  • If isbitstype(S) == false, implement Base.:(==)(x::S, y::S)
  • If an AbstractVectorSet, implement dimension(set::S), unless the
    dimension is given by set.dimension.

Utilities

  • If an AbstractVectorSet, implement Utilities.set_dot,
    unless the dot product between two vectors in the set is equivalent to
    LinearAlgebra.dot
  • If an AbstractVectorSet, implement Utilities.set_with_dimension in
    src/Utilities/matrix_of_constraints.jl
  • Add the set to the @model macro at the bottom of src/Utilities.model.jl

Documentation

  • Add a docstring, which gives the mathematical definition of the set,
    along with an ## Example block containing a jldoctest
  • Add the docstring to docs/src/reference/standard_form.md
  • Add the set to the relevant table in docs/src/manual/standard_form.md

Tests

  • Define a new _set(::Type{S}) method in src/Test/test_basic_constraint.jl
    and add the name of the set to the list at the bottom of that files
  • If the set has any checks in its constructor, add tests to test/sets.jl

MathOptFormat

  • Open an issue at https://github.com/jump-dev/MathOptFormat to add
    support for the new set {{ replace with link to the issue }} I don't think we should add any set specialization of that set or at least not yet

Optional

  • Implement dual_set(::S) and dual_set_type(::Type{S})
  • Add new tests to the Test submodule exercising your new set
  • Add new bridges to convert your set into more commonly used sets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant