Skip to content

Commit b5378f1

Browse files
number of integer and binary variables are also retrieved
1 parent 7938a72 commit b5378f1

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/pyscipopt/scip.pxd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,8 @@ cdef extern from "scip/scip.h":
712712
int SCIPvarGetIndex(SCIP_VAR* var)
713713
int SCIPgetNVars(SCIP* scip)
714714
int SCIPgetNOrigVars(SCIP* scip)
715+
int SCIPgetNIntVars(SCIP* scip)
716+
int SCIPgetNBinVars(SCIP* scip)
715717
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR* var)
716718
SCIP_Bool SCIPvarIsOriginal(SCIP_VAR* var)
717719
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR* var)

src/pyscipopt/scip.pyx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,14 @@ cdef class Model:
16861686
"""Retrieve the number of constraints."""
16871687
return SCIPgetNConss(self._scip)
16881688

1689+
def getNIntVars(self):
1690+
"""Retrieve the number of integer variables"""
1691+
return SCIPgetNIntVars(self._scip)
1692+
1693+
def getNBinVars(self):
1694+
"""Retrieve the number of binary variables"""
1695+
return SCIPgetNBinVars(self._scip)
1696+
16891697
def updateNodeLowerbound(self, Node node, lb):
16901698
"""if given value is larger than the node's lower bound (in transformed problem),
16911699
sets the node's lower bound to the new value

0 commit comments

Comments
 (0)