Skip to content

Commit 1f0a5b0

Browse files
committed
add documentation to new methods
1 parent 52f7384 commit 1f0a5b0

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

src/pyscipopt/scip.pxi

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2338,7 +2338,25 @@ cdef class Model:
23382338
enforce=True, check=True, propagate=True, local=False,
23392339
modifiable=False, dynamic=False, removable=False,
23402340
stickingatnode=False):
2341+
"""Create a linear or nonlinear constraint without adding it to the SCIP problem. This is useful for creating disjunction constraints
2342+
without also enforcing the individual constituents. Currently, this can only be used as an argument to `.addConsElemDisjunction`. To add
2343+
an individual linear/nonlinear constraint, prefer `.addCons()`.
23412344
2345+
:param cons: constraint object
2346+
:param name: the name of the constraint, generic name if empty (Default value = '')
2347+
:param initial: should the LP relaxation of constraint be in the initial LP? (Default value = True)
2348+
:param separate: should the constraint be separated during LP processing? (Default value = True)
2349+
:param enforce: should the constraint be enforced during node processing? (Default value = True)
2350+
:param check: should the constraint be checked for feasibility? (Default value = True)
2351+
:param propagate: should the constraint be propagated during node processing? (Default value = True)
2352+
:param local: is the constraint only valid locally? (Default value = False)
2353+
:param modifiable: is the constraint modifiable (subject to column generation)? (Default value = False)
2354+
:param dynamic: is the constraint subject to aging? (Default value = False)
2355+
:param removable: should the relaxation be removed from the LP due to aging or cleanup? (Default value = False)
2356+
:param stickingatnode: should the constraint always be kept at the node where it was added, even if it may be moved to a more global node? (Default value = False)
2357+
:return The created @ref scip#Constraint "Constraint" object.
2358+
2359+
"""
23422360
if name == '':
23432361
name = 'c'+str(SCIPgetNConss(self._scip)+1)
23442362

@@ -2474,7 +2492,19 @@ cdef class Model:
24742492
def addConsDisjunction(self, conss, name = '', initial = True,
24752493
relaxcons = None, enforce=True, check =True,
24762494
local=False, modifiable = False, dynamic = False):
2495+
"""Add a disjunction constraint.
24772496
2497+
:param Iterable[Constraint] conss: An iterable of constraint objects to be included initially in the disjunction. Currently, these must be expressions.
2498+
:param name: the name of the disjunction constraint.
2499+
:param initial: should the LP relaxation of disjunction constraint be in the initial LP? (Default value = True)
2500+
:param relaxcons: a conjunction constraint containing the linear relaxation of the disjunction constraint, or None. (Default value = None)
2501+
:param enforce: should the constraint be enforced during node processing? (Default value = True)
2502+
:param check: should the constraint be checked for feasibility? (Default value = True)
2503+
:param local: is the constraint only valid locally? (Default value = False)
2504+
:param modifiable: is the constraint modifiable (subject to column generation)? (Default value = False)
2505+
:param dynamic: is the constraint subject to aging? (Default value = False)
2506+
:return The added @ref scip#Constraint "Constraint" object.
2507+
"""
24782508
def ensure_iterable(elem, length):
24792509
if isinstance(elem, Iterable):
24802510
return elem
@@ -2513,7 +2543,12 @@ cdef class Model:
25132543
def addConsElemDisjunction(self, Constraint disj_cons, Constraint cons):
25142544
PY_SCIP_CALL(SCIPaddConsElemDisjunction(self._scip, (<Constraint>disj_cons).scip_cons, (<Constraint>cons).scip_cons))
25152545
PY_SCIP_CALL(SCIPreleaseCons(self._scip, &((<Constraint>cons).scip_cons)))
2516-
2546+
"""Appends a constraint to a disjunction.
2547+
2548+
:param Constraint disj_cons: the disjunction constraint to append to.
2549+
:param Constraint cons: the Constraint to append
2550+
:return The disjunction constraint with added @ref scip#Constraint object.
2551+
"""
25172552
return disj_cons
25182553

25192554

0 commit comments

Comments
 (0)