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

Skip terms when printing a large vector of expressions #3759

Merged
merged 3 commits into from
May 28, 2024
Merged

Conversation

odow
Copy link
Member

@odow odow commented May 27, 2024

Closes #3757

TODO

  • matrices

Copy link

codecov bot commented May 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.38%. Comparing base (ba34a49) to head (909eee9).

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.
📢 Have feedback on the report? Share it here.

@odow odow requested a review from blegat May 28, 2024 02:34
@odow
Copy link
Member Author

odow commented May 28, 2024

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()

@odow
Copy link
Member Author

odow commented 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.

@odow odow force-pushed the od/skip-vector branch from 1b88b05 to 909eee9 Compare May 28, 2024 22:51
@odow odow merged commit 51ac43c into master May 28, 2024
11 checks passed
@odow odow deleted the od/skip-vector branch May 28, 2024 23:33
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.

Printing of large vectorized constraints should probably cause output eliding?
2 participants