-
-
Notifications
You must be signed in to change notification settings - Fork 396
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
Skip terms when printing a large vector of expressions #3759
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3759 +/- ##
=======================================
Coverage 98.38% 98.38%
=======================================
Files 44 44
Lines 5871 5872 +1
=======================================
+ Hits 5776 5777 +1
Misses 95 95 ☔ View full report in Codecov by Sentry. |
Now I get: julia> using JuMP
julia> function test_print_omit_vector()
n = 100
model = Model()
@variable(model, x[1:n, 1:n])
@constraint(model, vec(x) >= 0)
@constraint(model, x >= 0, PSDCone())
print(model)
return
end
test_print_omit_vector (generic function with 1 method)
julia> test_print_omit_vector()
Feasibility
Subject to
[x[1,1], x[2,1], x[3,1], x[4,1], x[5,1], x[6,1], x[7,1], x[8,1], x[9,1], x[10,1], x[11,1], x[12,1], x[13,1], x[14,1], x[15,1], [[...9970 terms omitted...]], x[86,100], x[87,100], x[88,100], x[89,100], x[90,100], x[91,100], x[92,100], x[93,100], x[94,100], x[95,100], x[96,100], x[97,100], x[98,100], x[99,100], x[100,100]] ∈ MathOptInterface.Nonnegatives(10000)
[x[1,1] x[1,2] x[1,3] x[1,4] … x[1,98] x[1,99] x[1,100]
x[2,1] x[2,2] x[2,3] x[2,4] x[2,98] x[2,99] x[2,100]
x[3,1] x[3,2] x[3,3] x[3,4] x[3,98] x[3,99] x[3,100]
x[4,1] x[4,2] x[4,3] x[4,4] x[4,98] x[4,99] x[4,100]
x[5,1] x[5,2] x[5,3] x[5,4] x[5,98] x[5,99] x[5,100]
x[6,1] x[6,2] x[6,3] x[6,4] … x[6,98] x[6,99] x[6,100]
x[7,1] x[7,2] x[7,3] x[7,4] x[7,98] x[7,99] x[7,100]
x[8,1] x[8,2] x[8,3] x[8,4] x[8,98] x[8,99] x[8,100]
x[9,1] x[9,2] x[9,3] x[9,4] x[9,98] x[9,99] x[9,100]
x[10,1] x[10,2] x[10,3] x[10,4] x[10,98] x[10,99] x[10,100]
⋮ ⋱
x[92,1] x[92,2] x[92,3] x[92,4] x[92,98] x[92,99] x[92,100]
x[93,1] x[93,2] x[93,3] x[93,4] x[93,98] x[93,99] x[93,100]
x[94,1] x[94,2] x[94,3] x[94,4] x[94,98] x[94,99] x[94,100]
x[95,1] x[95,2] x[95,3] x[95,4] x[95,98] x[95,99] x[95,100]
x[96,1] x[96,2] x[96,3] x[96,4] … x[96,98] x[96,99] x[96,100]
x[97,1] x[97,2] x[97,3] x[97,4] x[97,98] x[97,99] x[97,100]
x[98,1] x[98,2] x[98,3] x[98,4] x[98,98] x[98,99] x[98,100]
x[99,1] x[99,2] x[99,3] x[99,4] x[99,98] x[99,99] x[99,100]
x[100,1] x[100,2] x[100,3] x[100,4] x[100,98] x[100,99] x[100,100]] ∈ PSDCone() |
blegat
approved these changes
May 28, 2024
The downside is that it's not controllable from JuMP, but I don't think anyone is ever served by printing out the 100x100 elements of a matrix. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #3757
TODO