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

Improve printing of SDP constraints #1857

Merged
merged 7 commits into from
Feb 14, 2019
Merged

Improve printing of SDP constraints #1857

merged 7 commits into from
Feb 14, 2019

Conversation

blegat
Copy link
Member

@blegat blegat commented Feb 13, 2019

Currently all SDP constraints are displayed in their vectorized form [...] in MOI.PositiveSemidefiniteCone... even if in the shape of the constraint, we have the information of whether it was constructed in this vectorized form or in matrix form.
In this PR, the function and set of a constraint are reshaped before being passed to function_string and in_set_string (hence the need to rename reshape_result into reshape_vector since the function is not a result and the need to create reshape_set).
For PSD constraint, in case the constraint was created in matrix form, the vector is reshaped to a matrix and the set is replaced by PSDCone().
Finally, the PR implements the printing of matrices similarly to how it was done in JuMP v0.18 (except I couldn't find how it was done for the IJuliaMode). The constraints_string function had to be tweaked to work with multiline constraint string.

@blegat blegat added the Category: Printing Related to printing label Feb 13, 2019
@blegat blegat added this to the 0.19 milestone Feb 13, 2019
src/print.jl Outdated Show resolved Hide resolved
src/sd.jl Outdated Show resolved Hide resolved
@blegat blegat merged commit a2376ca into master Feb 14, 2019
@odow odow deleted the bl/print_matrix branch February 15, 2019 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Printing Related to printing
Development

Successfully merging this pull request may close these issues.

2 participants