Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add _createConsBasicLinear #917

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -262,7 +262,7 @@
if rc == SCIP_OKAY:
pass
elif rc == SCIP_ERROR:
raise Exception('SCIP: unspecified error!')

Check failure on line 265 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / test-coverage (3.11)

SCIP: unspecified error!

Check failure on line 265 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Integration-test (3.8)

SCIP: unspecified error!

Check failure on line 265 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Windows-test (3.8)

SCIP: unspecified error!

Check failure on line 265 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Integration-test (3.9)

SCIP: unspecified error!

Check failure on line 265 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Windows-test (3.9)

SCIP: unspecified error!

Check failure on line 265 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Integration-test (3.10)

SCIP: unspecified error!

Check failure on line 265 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Windows-test (3.10)

SCIP: unspecified error!

Check failure on line 265 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Integration-test (3.11)

SCIP: unspecified error!

Check failure on line 265 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Windows-test (3.11)

SCIP: unspecified error!

Check failure on line 265 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Integration-test (3.12)

SCIP: unspecified error!

Check failure on line 265 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Windows-test (3.12)

SCIP: unspecified error!
elif rc == SCIP_NOMEMORY:
raise MemoryError('SCIP: insufficient memory error!')
elif rc == SCIP_READERROR:
Expand Down Expand Up @@ -2057,6 +2057,15 @@
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 @@

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 @@

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
Loading