Skip to content

Commit d938ef9

Browse files
committed
Add SCIPvarMarkRelaxationOnly
1 parent 112a8fc commit d938ef9

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Added support for knapsack constraints
77
- Added isPositive(), isNegative(), isFeasLE(), isFeasLT(), isFeasGE(), isFeasGT(), isHugeValue(), and tests
88
- Added SCIP_LOCKTYPE, addVarLocksType(), getNLocksDown(), getNLocksUp(), getNLocksDownType(), getNLocksUpType(), and tests
9+
- Added SCIPvarMarkRelaxationOnly
910
### Fixed
1011
- Raised an error when an expression is used when a variable is required
1112
### Changed

src/pyscipopt/scip.pxd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,7 @@ cdef extern from "scip/scip.h":
817817
void SCIPvarSetData(SCIP_VAR* var, SCIP_VARDATA* vardata)
818818
SCIP_VARDATA* SCIPvarGetData(SCIP_VAR* var)
819819
SCIP_Real SCIPvarGetAvgSol(SCIP_VAR* var)
820+
void SCIPvarMarkRelaxationOnly(SCIP_VAR* var)
820821
SCIP_Real SCIPgetVarPseudocost(SCIP* scip, SCIP_VAR* var, SCIP_BRANCHDIR dir)
821822
SCIP_Real SCIPvarGetCutoffSum(SCIP_VAR* var, SCIP_BRANCHDIR dir)
822823
SCIP_Longint SCIPvarGetNBranchings(SCIP_VAR* var, SCIP_BRANCHDIR dir)

src/pyscipopt/scip.pxi

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,6 +1676,21 @@ cdef class Variable(Expr):
16761676
16771677
"""
16781678
return SCIPvarGetAvgSol(self.scip_var)
1679+
1680+
def markRelaxationOnly(self):
1681+
"""
1682+
marks that this variable has only been introduced to define a relaxation
1683+
1684+
The variable must not have a coefficient in the objective and must be deletable.
1685+
If it is not marked deletable, it will be marked as deletable, which is only possible before
1686+
the variable is added to a problem.
1687+
1688+
Returns
1689+
-------
1690+
None
1691+
1692+
"""
1693+
PY_SCIP_CALL(SCIPvarMarkRelaxationOnly(self.scip_var))
16791694

16801695
def getNLocksDown(self):
16811696
"""

0 commit comments

Comments
 (0)