Skip to content

Commit

Permalink
remove bad contributions
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao-Dionisio committed Nov 15, 2024
1 parent c7ecb2a commit a006ea6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased
### Added
- Added stage checks to presolve, freereoptsolve, freetransform
- Added primal_dual_evolution recipe and a plot recipe
### Fixed
### Changed
Expand Down
23 changes: 23 additions & 0 deletions src/pyscipopt/scip.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -2057,6 +2057,15 @@ cdef class Model:
def freeTransform(self):
"""Frees all solution process data including presolving and
transformed problem, only original problem is kept."""
if self.getStage() not in [SCIP_STAGE_INIT,
SCIP_STAGE_PROBLEM,
SCIP_STAGE_TRANSFORMED,
SCIP_STAGE_PRESOLVING,
SCIP_STAGE_PRESOLVED,
SCIP_STAGE_SOLVING,
SCIP_STAGE_SOLVED]:
raise Warning("method cannot be called in stage %i." % self.getStage())

self._modelvars = {
var: value
for var, value in self._modelvars.items()
Expand Down Expand Up @@ -6175,6 +6184,11 @@ cdef class Model:

def presolve(self):
"""Presolve the problem."""
if self.getStage() not in [SCIP_STAGE_PROBLEM, SCIP_STAGE_TRANSFORMED,\
SCIP_STAGE_PRESOLVING, SCIP_STAGE_PRESOLVED, \
SCIP_STAGE_SOLVED]:
raise Warning("method cannot be called in stage %i." % self.getStage())

PY_SCIP_CALL(SCIPpresolve(self._scip))
self._bestSol = Solution.create(self._scip, SCIPgetBestSol(self._scip))

Expand Down Expand Up @@ -8977,6 +8991,15 @@ cdef class Model:

def freeReoptSolve(self):
"""Frees all solution process data and prepares for reoptimization."""

if self.getStage() not in [SCIP_STAGE_INIT,
SCIP_STAGE_PROBLEM,
SCIP_STAGE_TRANSFORMED,
SCIP_STAGE_PRESOLVING,
SCIP_STAGE_PRESOLVED,
SCIP_STAGE_SOLVING,
SCIP_STAGE_SOLVED]:
raise Warning("method cannot be called in stage %i." % self.getStage())
PY_SCIP_CALL(SCIPfreeReoptSolve(self._scip))

def chgReoptObjective(self, coeffs, sense = 'minimize'):
Expand Down

0 comments on commit a006ea6

Please sign in to comment.