Skip to content

Commit 2592c94

Browse files
committed
avoid stackoverflow error for large disjunctions
1 parent a7bf324 commit 2592c94

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/utils.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ constraint_variables(constr::AbstractDict) = Iterators.flatten(
202202
is_constraint(constr)
203203
204204
Check if a constraint or tuple of constraints is valid.
205+
206+
NOTE: NOT USED CURRENTLY
205207
"""
206208
is_constraint(constr::ConstraintRef) = is_valid(constr.model,constr)
207209
is_constraint(constr::AbstractArray) = all(is_constraint.(constr))
@@ -214,7 +216,7 @@ is_constraint(constr::Nothing) = false
214216
Update constraint list (for disjunction constraints stored in .ext Dict)
215217
"""
216218
function update_constraint_list!(disj, list::Vector)
217-
disj_constraints = filter(is_constraint, disj)
219+
disj_constraints = filter(!isnothing, disj) #remove any empty disjuncts
218220
for item in disj_constraints
219221
update_constraint_list!(item, list)
220222
end

0 commit comments

Comments
 (0)