File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -2059,7 +2059,7 @@ cdef class MixedIntegerLinearProgram(SageObject):
2059
2059
<BLANKLINE>
2060
2060
Constraints:
2061
2061
1. 0 <= x_0 - x_1
2062
- -2. 0 <= -2. 0 x_0 + 2. 0 x_1
2062
+ -2. 0 <= -2. 0 x_0 + 2. 0 x_1
2063
2063
Variables:
2064
2064
x_0 is a continuous variable ( min=-oo, max=+ oo)
2065
2065
x_1 is a continuous variable ( min=-oo, max=+ oo)
@@ -2275,11 +2275,20 @@ cdef class MixedIntegerLinearProgram(SageObject):
2275
2275
sage: for each in range( 10) : p. add_constraint( x - y, max = 10)
2276
2276
sage: p. number_of_constraints( )
2277
2277
3
2278
+
2279
+ TESTS:
2280
+
2281
+ Removing no constraints does not make Sage crash, see
2282
+ :trac:`34881`::
2283
+
2284
+ sage: MixedIntegerLinearProgram( ) . remove_constraints( [])
2285
+
2278
2286
"""
2279
2287
if self ._check_redundant:
2280
2288
for i in sorted (constraints, reverse = True ):
2281
2289
self ._constraints.pop(i)
2282
- self ._backend.remove_constraints(constraints)
2290
+ if constraints:
2291
+ self ._backend.remove_constraints(constraints)
2283
2292
2284
2293
def set_binary (self , ee ):
2285
2294
r """
You can’t perform that action at this time.
0 commit comments