56
56
_SCIP_BOUNDTYPE_TO_STRING = {SCIP_BOUNDTYPE_UPPER: ' <=' ,
57
57
SCIP_BOUNDTYPE_LOWER: ' >=' }
58
58
59
+ cdef extern from " scip/config.h" :
60
+ """
61
+ #ifdef WITH_DEBUG_SOLUTION
62
+ #define PYSCIPOPT_WITH_DEBUG_SOLUTION 1
63
+ #else
64
+ #define PYSCIPOPT_WITH_DEBUG_SOLUTION 0
65
+ #endif
66
+ """
67
+ bint PYSCIPOPT_WITH_DEBUG_SOLUTION
68
+
59
69
# Mapping the SCIP_RESULT enum to a python class
60
70
# This is required to return SCIP_RESULT in the python code
61
71
# In __init__.py this is imported as SCIP_RESULT to keep the
@@ -141,7 +151,6 @@ cdef class PY_SCIP_STATUS:
141
151
INFORUNBD = SCIP_STATUS_INFORUNBD
142
152
143
153
StageNames = {}
144
-
145
154
cdef class PY_SCIP_STAGE:
146
155
INIT = SCIP_STAGE_INIT
147
156
PROBLEM = SCIP_STAGE_PROBLEM
@@ -171,7 +180,6 @@ cdef class PY_SCIP_NODETYPE:
171
180
SUBROOT = SCIP_NODETYPE_SUBROOT
172
181
REFOCUSNODE = SCIP_NODETYPE_REFOCUSNODE
173
182
174
-
175
183
cdef class PY_SCIP_PROPTIMING:
176
184
BEFORELP = SCIP_PROPTIMING_BEFORELP
177
185
DURINGLPLOOP = SCIP_PROPTIMING_DURINGLPLOOP
@@ -198,7 +206,6 @@ cdef class PY_SCIP_HEURTIMING:
198
206
AFTERPROPLOOP = SCIP_HEURTIMING_AFTERPROPLOOP
199
207
200
208
EventNames = {}
201
-
202
209
cdef class PY_SCIP_EVENTTYPE:
203
210
DISABLED = SCIP_EVENTTYPE_DISABLED
204
211
VARADDED = SCIP_EVENTTYPE_VARADDED
@@ -7756,6 +7763,24 @@ cdef class Model:
7756
7763
"""
7757
7764
PY_SCIP_CALL(SCIPsetRelaxSolVal(self ._scip, NULL , var.scip_var, val))
7758
7765
7766
+ def enableDebugSol (self ):
7767
+ """
7768
+ Enables the debug solution mechanism, which allows tracing back the invalidation of
7769
+ a debug solution during the solution process of SCIP. It must be explicitly
7770
+ enabled for the SCIP data structure.
7771
+ """
7772
+ if not PYSCIPOPT_WITH_DEBUG_SOLUTION:
7773
+ raise RuntimeError (" SCIP must be built with `DEBUGSOL=true` to enable the debug solution mechanism." )
7774
+ SCIPenableDebugSol(self ._scip)
7775
+
7776
+ def disableDebugSol (self ):
7777
+ """
7778
+ Disables the debug solution mechanism.
7779
+ """
7780
+ if not PYSCIPOPT_WITH_DEBUG_SOLUTION:
7781
+ raise RuntimeError (" SCIP must be built with `DEBUGSOL=true` to disable the debug solution mechanism." )
7782
+ SCIPdisableDebugSol(self ._scip)
7783
+
7759
7784
def getConss (self , transformed = True ):
7760
7785
"""
7761
7786
Retrieve all constraints.
0 commit comments