Skip to content

Commit fcf6603

Browse files
committed
use pyscipopt code and doc style
Condensed the addMatrixConsIndicator method signature to a single line and updated the docstring for improved clarity and consistency. Parameter descriptions were streamlined and default values were explicitly stated.
1 parent 9fce800 commit fcf6603

1 file changed

Lines changed: 31 additions & 52 deletions

File tree

src/pyscipopt/scip.pxi

Lines changed: 31 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6810,68 +6810,47 @@ cdef class Model:
68106810
return pyCons
68116811

68126812

6813-
def addMatrixConsIndicator(
6814-
self,
6815-
cons: MatrixExprCons,
6816-
binvar: Union[Variable, MatrixVariable] = None,
6817-
activeone: Union[bool, np.ndarray] = True,
6818-
name: Union[str, np.ndarray] = "",
6819-
initial: Union[bool, np.ndarray] = True,
6820-
separate: Union[bool, np.ndarray] = True,
6821-
enforce: Union[bool, np.ndarray] = True,
6822-
check: Union[bool, np.ndarray] = True,
6823-
propagate: Union[bool, np.ndarray] = True,
6824-
local: Union[bool, np.ndarray] = False,
6825-
dynamic: Union[bool, np.ndarray] = False,
6826-
removable: Union[bool, np.ndarray] = False,
6827-
stickingatnode: Union[bool, np.ndarray] = False,
6828-
):
6813+
def addMatrixConsIndicator(self, cons: MatrixExprCons, binvar: Union[Variable, MatrixVariable] = None,
6814+
activeone: Union[bool, np.ndarray] = True, name: Union[str, np.ndarray] = "",
6815+
initial: Union[bool, np.ndarray] = True, separate: Union[bool, np.ndarray] = True,
6816+
enforce: Union[bool, np.ndarray] = True, check: Union[bool, np.ndarray] = True,
6817+
propagate: Union[bool, np.ndarray] = True, local: Union[bool, np.ndarray] = False,
6818+
dynamic: Union[bool, np.ndarray] = False, removable: Union[bool, np.ndarray] = False,
6819+
stickingatnode: Union[bool, np.ndarray] = False):
68296820
"""Add an indicator matrix constraint for the linear inequality `cons`.
68306821
68316822
The `binvar` argument models the redundancy of the linear constraint. A solution
68326823
for which `binvar` is 1 must satisfy the constraint.
68336824
68346825
Parameters
68356826
----------
6836-
cons : MatrixExprCons
6837-
A linear inequality of the form "<=".
6838-
6827+
cons : MatrixExprCons, optional
6828+
a linear inequality of the form "<=".
68396829
binvar : Variable or MatrixVariable, default None
6840-
Binary indicator variable / matrix variable, or None if it should be created.
6841-
6830+
binary indicator variable / matrix variable, or None if it should be created.
68426831
activeone : bool or np.ndarray, default True
6843-
The matrix constraint should be active if binvar is 1 (0 if activeone = False).
6844-
6832+
the matrix constraint should be active if binvar is 1 (0 if activeone = False).
68456833
name : str or np.ndarray, default ""
6846-
Name of the matrix constraint.
6847-
6848-
initial : bool or np.ndarray, default True
6849-
Should the LP relaxation of matrix constraint be in the initial LP?
6850-
6851-
separate : bool or np.ndarray, default True
6852-
Should the matrix constraint be separated during LP processing?
6853-
6854-
enforce : bool or np.ndarray, default True
6855-
Should the matrix constraint be enforced during node processing?
6856-
6857-
check : bool or np.ndarray, default True
6858-
Should the matrix constraint be checked for feasibility?
6859-
6860-
propagate : bool or np.ndarray, default True
6861-
Should the matrix constraint be propagated during node processing?
6862-
6863-
local : bool or np.ndarray, default False
6864-
Is the matrix constraint only valid locally?
6865-
6866-
dynamic : bool or np.ndarray, default False
6867-
Is the matrix constraint subject to aging?
6868-
6869-
removable : bool or np.ndarray, default False
6870-
Should the relaxation be removed from the LP due to aging or cleanup?
6871-
6872-
stickingatnode : bool or np.ndarray, default False
6873-
Should the matrix constraint always be kept at the node where it was added,
6874-
even if it may be moved to a more global node?
6834+
name of the matrix constraint.
6835+
initial : bool or np.ndarray, optional
6836+
should the LP relaxation of matrix constraint be in the initial LP?
6837+
separate : bool or np.ndarray, optional
6838+
should the matrix constraint be separated during LP processing?
6839+
enforce : bool or np.ndarray, optional
6840+
should the matrix constraint be enforced during node processing?
6841+
check : bool or np.ndarray, optional
6842+
should the matrix constraint be checked for feasibility?
6843+
propagate : bool or np.ndarray, optional
6844+
should the matrix constraint be propagated during node processing? (Default value = True)
6845+
local : bool or np.ndarray, optional
6846+
is the matrix constraint only valid locally? (Default value = False)
6847+
dynamic : bool or np.ndarray, optional
6848+
is the matrix constraint subject to aging? (Default value = False)
6849+
removable : bool or np.ndarray, optional
6850+
should the relaxation be removed from the LP due to aging or cleanup? (Default value = False)
6851+
stickingatnode : bool or np.ndarray, optional
6852+
should the matrix constraint always be kept at the node where it was added,
6853+
even if it may be moved to a more global node? (Default value = False)
68756854
68766855
Returns
68776856
-------

0 commit comments

Comments
 (0)