Skip to content
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 @@ -13,6 +13,7 @@
- Added `getBase()` and `setBase()` methods to `LP` class for getting/setting basis status
- Added `getMemUsed()`, `getMemTotal()`, and `getMemExternEstim()` methods
- Added `isReoptEnabled()` and raising error if not enabled upon calling `reoptSolve()`
- SOS1/SOS2 constraints are now realease after addition similar to the other constraint types
### Fixed
- Removed `Py_INCREF`/`Py_DECREF` on `Model` in `catchEvent`/`dropEvent` that caused memory leak for imbalanced usage
- Used `getIndex()` instead of `ptr()` for sorting nonlinear expression terms to avoid nondeterministic behavior
Expand Down
8 changes: 6 additions & 2 deletions src/pyscipopt/scip.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -7151,8 +7151,10 @@ cdef class Model:
PY_SCIP_CALL(SCIPaddVarSOS1(self._scip, scip_cons, wrapper.ptr[i], weights[i]))

PY_SCIP_CALL(SCIPaddCons(self._scip, scip_cons))
pyCons = self._getOrCreateCons(scip_cons)
PY_SCIP_CALL(SCIPreleaseCons(self._scip, &scip_cons))

return self._getOrCreateCons(scip_cons)
return pyCons

def addConsSOS2(self, vars, weights=None, name="",
initial=True, separate=True, enforce=True, check=True,
Expand Down Expand Up @@ -7216,8 +7218,10 @@ cdef class Model:
PY_SCIP_CALL(SCIPaddVarSOS2(self._scip, scip_cons, wrapper.ptr[i], weights[i]))

PY_SCIP_CALL(SCIPaddCons(self._scip, scip_cons))
pyCons = self._getOrCreateCons(scip_cons)
PY_SCIP_CALL(SCIPreleaseCons(self._scip, &scip_cons))

return self._getOrCreateCons(scip_cons)
return pyCons

def addConsAnd(self, vars, resvar, name="",
initial=True, separate=True, enforce=True, check=True,
Expand Down
Loading