Skip to content

Commit 7d11fa5

Browse files
committed
show all objective terms in the model MPS diagnose file
1 parent 6bc83e4 commit 7d11fa5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/util/write_information_files.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ function _without_printing_limits(f, m)
3333
for cref in all_constraints(m, F, S)
3434
]
3535
JuMP._CONSTRAINT_LIMIT_FOR_PRINTING[] = length(constraint_functions)
36-
JuMP._TERM_LIMIT_FOR_PRINTING[] = maximum(_term_count.(constraint_functions); init=0)
36+
# Get max terms from constraints
37+
max_constraint_terms = maximum(_term_count.(constraint_functions); init=0)
38+
# Also count terms in objective function
39+
obj_terms = _term_count(objective_function(m))
40+
# Use the maximum of both
41+
JuMP._TERM_LIMIT_FOR_PRINTING[] = max(max_constraint_terms, obj_terms)
3742
try
3843
return f()
3944
finally

0 commit comments

Comments
 (0)