Skip to content

Commit

Permalink
Merge branch 'master' into sb/edit_test_branch_probing_lp
Browse files Browse the repository at this point in the history
  • Loading branch information
sbolusani committed Oct 23, 2023
2 parents 21adadd + 8ae8132 commit ae0f138
Show file tree
Hide file tree
Showing 8 changed files with 10,540 additions and 14 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
- Add SCIP functions SCIPchgCoefLinear, SCIPaddCoefLinear and SCIPdelCoefLinear
- Add SCIP function SCIPgetSolTime and wrapper getSolTime
### Fixed
- Pricer plugin fundamental callbacks now raise an error if not implemented
- Brachrule plugin fundamental callbacks now raise an error if not implemented
- Fixed segmentation fault when accessing the Solution class directly
- Changed getSols so that it prints solutions in terms of the original variables
### Changed
- Improved error message when using < or > instead of <= or >=
### Removed
- Removed double declaration of SCIPfindEventhdlr

## 4.3.0 - 2023-03-17
### Added
Expand All @@ -18,7 +23,6 @@

### Fixed
### Changed
- Pricer plugin fundamental callbacks now raise an error if not implemented
### Removed
- Removed function rowGetNNonz

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
PySCIPOpt
=========

This project provides an interface from Python to the [SCIP Optimization
Suite](https://www.scipopt.org/). Please review [SCIP's license restrictions](https://scipopt.org/index.php#license) before installing PySCIPOpt.
This project provides an interface from Python to the [SCIP Optimization Suite](https://www.scipopt.org/). Starting from v8.0.3, SCIP uses the [Apache2.0](https://www.apache.org/licenses/LICENSE-2.0) license. If you plan to use an earlier version of SCIP, please review [SCIP's license restrictions](https://scipopt.org/index.php#license).

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/PySCIPOpt/Lobby)
[![PySCIPOpt on PyPI](https://img.shields.io/pypi/v/pyscipopt.svg)](https://pypi.python.org/pypi/pyscipopt)
Expand Down
9 changes: 4 additions & 5 deletions src/pyscipopt/branchrule.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,17 @@ cdef class Branchrule:

def branchexeclp(self, allowaddcons):
'''executes branching rule for fractional LP solution'''
# this method needs to be implemented by the user
return {}
raise NotImplementedError("branchexeclp() is a fundamental callback and should be implemented in the derived "
"class")

def branchexecext(self, allowaddcons):
'''executes branching rule for external branching candidates '''
# this method needs to be implemented by the user
return {}
raise NotImplementedError("branchexecext() is a fundamental callback and should be implemented in the derived class")

def branchexecps(self, allowaddcons):
'''executes branching rule for not completely fixed pseudo solution '''
# this method needs to be implemented by the user
return {}
raise NotImplementedError("branchexecps() is a fundamental callback and should be implemented in the derived class")



Expand Down
1 change: 0 additions & 1 deletion src/pyscipopt/scip.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,6 @@ cdef extern from "scip/scip.h":
SCIP_RETCODE (*eventdelete) (SCIP* scip, SCIP_EVENTHDLR* eventhdlr, SCIP_EVENTDATA** eventdata),
SCIP_RETCODE (*eventexec) (SCIP* scip, SCIP_EVENTHDLR* eventhdlr, SCIP_EVENT* event, SCIP_EVENTDATA* eventdata),
SCIP_EVENTHDLRDATA* eventhdlrdata)
SCIP_EVENTHDLR* SCIPfindEventhdlr(SCIP* scip, const char* name)
SCIP_EVENTHDLRDATA* SCIPeventhdlrGetData(SCIP_EVENTHDLR* eventhdlr)

# Variable pricer plugin
Expand Down
11 changes: 8 additions & 3 deletions src/pyscipopt/scip.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -535,11 +535,16 @@ cdef class NLRow:
cdef class Solution:
"""Base class holding a pointer to corresponding SCIP_SOL"""

# We are raising an error here to avoid creating a solution without an associated model. See Issue #625
def __init__(self, raise_error = False):
if not raise_error:
raise ValueError("To create a solution you should use the createSol method of the Model class.")

@staticmethod
cdef create(SCIP* scip, SCIP_SOL* scip_sol):
if scip == NULL:
raise Warning("cannot create Solution with SCIP* == NULL")
sol = Solution()
sol = Solution(True)
sol.sol = scip_sol
sol.scip = scip
return sol
Expand Down Expand Up @@ -567,8 +572,8 @@ cdef class Solution:

vals = {}
self._checkStage("SCIPgetSolVal")
for i in range(SCIPgetNVars(self.scip)):
scip_var = SCIPgetVars(self.scip)[i]
for i in range(SCIPgetNOrigVars(self.scip)):
scip_var = SCIPgetOrigVars(self.scip)[i]

# extract name
cname = bytes(SCIPvarGetName(scip_var))
Expand Down
Loading

0 comments on commit ae0f138

Please sign in to comment.