File tree Expand file tree Collapse file tree 5 files changed +20
-0
lines changed
Expand file tree Collapse file tree 5 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 88- Added pre-commit hook for automatic stub regeneration (see .pre-commit-config.yaml)
99- Wrapped isObjIntegral() and test
1010- Added structured_optimization_trace recipe for structured optimization progress tracking
11+ - Added methods: getPrimalDualIntegral()
1112### Fixed
1213- getBestSol() now returns None for infeasible problems instead of a Solution with NULL pointer
1314- all fundamental callbacks now raise an error if not implemented
Original file line number Diff line number Diff line change @@ -1473,6 +1473,7 @@ cdef extern from "scip/scip.h":
14731473 int SCIPgetPlungeDepth(SCIP* scip)
14741474 SCIP_Longint SCIPgetNNodeLPIterations(SCIP* scip)
14751475 SCIP_Longint SCIPgetNStrongbranchLPIterations(SCIP* scip)
1476+ SCIP_Real SCIPgetPrimalDualIntegral(SCIP* scip)
14761477
14771478 # Parameter Functions
14781479 SCIP_RETCODE SCIPsetBoolParam(SCIP* scip, char * name, SCIP_Bool value)
Original file line number Diff line number Diff line change @@ -3385,6 +3385,16 @@ cdef class Model:
33853385 """
33863386 return SCIPgetNStrongbranchLPIterations(self ._scip)
33873387
3388+ def getPrimalDualIntegral (self ):
3389+ """
3390+ Recomputes and returns the primal dual gap stored in the stats
3391+
3392+ Returns
3393+ ------
3394+ float
3395+ """
3396+ return SCIPgetPrimalDualIntegral(self ._scip)
3397+
33883398 def cutoffNode (self , Node node ):
33893399 """
33903400 marks node and whole subtree to be cut off from the branch and bound tree.
Original file line number Diff line number Diff line change @@ -1129,6 +1129,7 @@ class Model:
11291129 def getNSols (self ) -> Incomplete : ...
11301130 def getNSolsFound (self ) -> Incomplete : ...
11311131 def getNStrongbranchLPIterations (self ) -> Incomplete : ...
1132+ def getPrimalDualIntegral (self ) -> Incomplete : ...
11321133 def getNTotalNodes (self ) -> Incomplete : ...
11331134 def getNVars (self , transformed : Incomplete = ...) -> Incomplete : ...
11341135 def getNVarsAnd (self , and_cons : Incomplete ) -> Incomplete : ...
Original file line number Diff line number Diff line change @@ -12,3 +12,10 @@ def test_statistics_json():
1212 assert data ["origprob" ]["problem_name" ] == "model"
1313
1414 os .remove ("statistics.json" )
15+
16+ def test_getPrimalDualIntegral ():
17+ model = random_mip_1 (small = True )
18+ model .optimize ()
19+ primal_dual_integral = model .getPrimalDualIntegral ()
20+
21+ assert isinstance (primal_dual_integral , float )
You can’t perform that action at this time.
0 commit comments