We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d8a0663 + b03cf22 commit 4e90280Copy full SHA for 4e90280
src/sage/numerical/mip.pyx
@@ -2366,11 +2366,20 @@ cdef class MixedIntegerLinearProgram(SageObject):
2366
....: p.add_constraint(x - y, max=10)
2367
sage: p.number_of_constraints()
2368
3
2369
+
2370
+ TESTS:
2371
2372
+ Removing no constraints does not make Sage crash, see
2373
+ :trac:`34881`::
2374
2375
+ sage: MixedIntegerLinearProgram().remove_constraints([])
2376
2377
"""
2378
if self._check_redundant:
2379
for i in sorted(constraints, reverse=True):
2380
self._constraints.pop(i)
- self._backend.remove_constraints(constraints)
2381
+ if constraints:
2382
+ self._backend.remove_constraints(constraints)
2383
2384
def set_binary(self, ee):
2385
r"""
0 commit comments