@@ -1804,37 +1804,6 @@ cdef class Variable(Expr):
1804
1804
mayround = SCIPvarMayRoundUp(self .scip_var)
1805
1805
return mayround
1806
1806
1807
- def getNBranchings (self , branchdir ):
1808
- """
1809
- returns the number of times a bound of the variable was changed in given direction due to branching
1810
-
1811
- Parameters
1812
- ----------
1813
- branchdir : PY_SCIP_BRANCHDIR
1814
- branching direction (downwards, or upwards)
1815
-
1816
- Returns
1817
- -------
1818
- int
1819
- """
1820
- return SCIPvarGetNBranchings(self .scip_var, branchdir)
1821
-
1822
- def getNBranchingsCurrentRun (self , branchdir ):
1823
- """
1824
- returns the number of times a bound of the variable was changed in given direction due to branching in the
1825
- current run
1826
-
1827
- Parameters
1828
- ----------
1829
- branchdir : PY_SCIP_BRANCHDIR
1830
- branching direction (downwards, or upwards)
1831
-
1832
- Returns
1833
- -------
1834
- int
1835
- """
1836
- return SCIPvarGetNBranchingsCurrentRun(self .scip_var, branchdir)
1837
-
1838
1807
class MatrixVariable (MatrixExpr ):
1839
1808
1840
1809
def vtype (self ):
@@ -4737,6 +4706,11 @@ cdef class Model:
4737
4706
list of Column
4738
4707
4739
4708
"""
4709
+ stage_check = SCIPgetStage(self ._scip) in [SCIP_STAGE_SOLVING]
4710
+
4711
+ if not stage_check:
4712
+ raise Warning (" Method cannot be called in stage " , self .getStage())
4713
+
4740
4714
cdef SCIP_COL** cols
4741
4715
cdef int ncols
4742
4716
cdef int i
@@ -9738,6 +9712,11 @@ cdef class Model:
9738
9712
9739
9713
def restartSolve (self ):
9740
9714
""" Restarts the solving process as soon as possible."""
9715
+ stage_check = SCIPgetStage(self ._scip) in [SCIP_STAGE_INITPRESOLVE, SCIP_STAGE_PRESOLVING, SCIP_STAGE_EXITPRESOLVE, SCIP_STAGE_SOLVING]
9716
+
9717
+ if not stage_check:
9718
+ raise Warning (" Method cannot be called in stage " , self .getStage())
9719
+
9741
9720
PY_SCIP_CALL(SCIPrestartSolve(self ._scip))
9742
9721
9743
9722
# Solution functions
@@ -10109,6 +10088,11 @@ cdef class Model:
10109
10088
whether given solution was feasible and good enough to keep
10110
10089
10111
10090
"""
10091
+ stage_check = SCIPgetStage(self ._scip) in [SCIP_STAGE_TRANSFORMED, SCIP_STAGE_INITPRESOLVE, SCIP_STAGE_PRESOLVING, SCIP_STAGE_EXITPRESOLVE, SCIP_STAGE_PRESOLVED, SCIP_STAGE_SOLVING]
10092
+
10093
+ if not stage_check:
10094
+ raise Warning (" Method cannot be called in stage " , self .getStage())
10095
+
10112
10096
cdef SCIP_Bool stored
10113
10097
if free:
10114
10098
PY_SCIP_CALL(SCIPtrySolFree(self ._scip, & solution.sol, printreason, completely, checkbounds, checkintegrality, checklprows, & stored))
0 commit comments