You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pyscipopt/scip.pxi
+166-4Lines changed: 166 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2489,6 +2489,118 @@ cdef class Model:
2489
2489
2490
2490
return constraints
2491
2491
2492
+
defaddConsConjunction(self, conss, name='',
2493
+
relaxcons=None, enforce=True, check=True,
2494
+
local=False, modifiable=False, dynamic=False):
2495
+
"""Add a conjunction constraint.
2496
+
2497
+
:param Iterable[Constraint] conss: An iterable of constraint objects to be included initially in the conjunction. Currently, these must be expressions.
2498
+
:param name: the name of the conjunction constraint.
2499
+
:param relaxcons: a conjunction constraint containing the linear relaxation of the conjunction constraint, or None. (Default value = None)
2500
+
:param enforce: should the constraint be enforced during node processing? (Default value = True)
2501
+
:param check: should the constraint be checked for feasibility? (Default value = True)
2502
+
:param local: is the constraint only valid locally? (Default value = False)
2503
+
:param modifiable: is the constraint modifiable (subject to column generation)? (Default value = False)
2504
+
:param dynamic: is the constraint subject to aging? (Default value = False)
2505
+
:return The added @ref scip#Constraint "Constraint" object.
2506
+
"""
2507
+
defensure_iterable(elem, length):
2508
+
ifisinstance(elem, Iterable):
2509
+
return elem
2510
+
else:
2511
+
returnlist(repeat(elem, length))
2512
+
assertisinstance(conss, Iterable), "Given constraint list is not iterable"
"""Create a conjunction constraint without adding it to the problem.
2559
+
2560
+
:param Iterable[Constraint] conss: An iterable of constraint objects to be included initially in the conjunction. Currently, these must be expressions.
2561
+
:param name: the name of the conjunction constraint.
2562
+
:param relaxcons: a conjunction constraint containing the linear relaxation of the conjunction constraint, or None. (Default value = None)
2563
+
:param enforce: should the constraint be enforced during node processing? (Default value = True)
2564
+
:param check: should the constraint be checked for feasibility? (Default value = True)
2565
+
:param local: is the constraint only valid locally? (Default value = False)
2566
+
:param modifiable: is the constraint modifiable (subject to column generation)? (Default value = False)
2567
+
:param dynamic: is the constraint subject to aging? (Default value = False)
2568
+
:return The added @ref scip#Constraint "Constraint" object.
2569
+
"""
2570
+
defensure_iterable(elem, length):
2571
+
ifisinstance(elem, Iterable):
2572
+
return elem
2573
+
else:
2574
+
returnlist(repeat(elem, length))
2575
+
assertisinstance(conss, Iterable), "Given constraint list is not iterable"
:param Iterable[Constraint] conss: An iterable of constraint objects to be included initially in the disjunction. Currently, these must be expressions.
2661
+
:param name: the name of the disjunction constraint.
2662
+
:param initial: should the LP relaxation of disjunction constraint be in the initial LP? (Default value = True)
2663
+
:param relaxcons: a conjunction constraint containing the linear relaxation of the disjunction constraint, or None. (Default value = None)
2664
+
:param enforce: should the constraint be enforced during node processing? (Default value = True)
2665
+
:param check: should the constraint be checked for feasibility? (Default value = True)
2666
+
:param local: is the constraint only valid locally? (Default value = False)
2667
+
:param modifiable: is the constraint modifiable (subject to column generation)? (Default value = False)
2668
+
:param dynamic: is the constraint subject to aging? (Default value = False)
2669
+
:return The added @ref scip#Constraint "Constraint" object.
2670
+
"""
2671
+
defensure_iterable(elem, length):
2672
+
ifisinstance(elem, Iterable):
2673
+
return elem
2674
+
else:
2675
+
returnlist(repeat(elem, length))
2676
+
assertisinstance(conss, Iterable), "Given constraint list is not iterable"
0 commit comments