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

Writing SDPA-formatted file using sdpa.jl #31

Open
JiazhengZhu opened this issue Jul 24, 2019 · 3 comments
Open

Writing SDPA-formatted file using sdpa.jl #31

JiazhengZhu opened this issue Jul 24, 2019 · 3 comments

Comments

@JiazhengZhu
Copy link

JiazhengZhu commented Jul 24, 2019

Hi @blegat ,

I am a summer student working with @ericphanson. Following up the discussion at jump-dev/SDPA.jl#19 about SDPA.jl not fully implementing SemidefiniteOptInterface interface, we have been exploring the possibility of writing SDPA-formatted file by directing those missing functions, such as getconstraintconstant, to problem parameters already cached in the SemidefiniteOptInterface.SOItoMOIBridge() object.

However, looking at

print(io, getconstraintconstant(optimizer, c))
, the function getconstraintconstant() doesn't seem to be related to any one of the fields in SOItoMOIBridge. Could you perhaps specify how fields in SOItoMOIBridge parameterize the problem, and in particular which parameter should getconstraintconstant() refer to?

On the other hand, comparing the code with the standard SDPA format (http://plato.asu.edu/ftp/sdpa_format.txt), it seems that this line should be getobjectivecoefficient() instead? Swapping getconstraintconstant() and getobjectivecoefficient() in the code would seem to make more sense but would you also kindly clarify this? Thanks.

@blegat
Copy link
Member

blegat commented Jul 25, 2019

Could you perhaps specify how fields in SOItoMOIBridge parameterize the problem, and in particular which parameter should getconstraintconstant() refer to?

It's not stored in SOItoMOIBridge, it is stored in the solver.

would you also kindly clarify this?

The naming is based on the dual (D) of that webpage.

@JiazhengZhu
Copy link
Author

JiazhengZhu commented Jul 25, 2019

Thanks for the reply.

As far as printing the SDPA-formatted file is concerned, it seems possible to load the problem into the mock optimizer by defining

mock = SDOI.MockSDOptimizer{Float64}()
mock_optimizer = SDOI.SDOIOptimizer(mock, Float64)

and then it is possible to load the problem using the Convex.jl branch at https://github.com/ericphanson/Convex.jl/tree/MathOptInterface using a function almost identical to this but without the last line: https://github.com/ericphanson/Convex.jl/blob/4309a3a1afdb608555a51473fb4d9c1faf5e397b/src/moi_model.jl#L119. Then the file can be printed using MOI.write(mock, 'out.sdpa'). The sparse format output file describes, as you already pointed out, the dual problem.

This is of course a temporary measure but I will be sure to post any updates here. Once again thank you for the help!

@blegat
Copy link
Member

blegat commented Jul 25, 2019

Note that you can print use the primal sdpa form for printing by combining this with AutomaticDualization.jl

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

2 participants