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

Fix pointer #754

Merged
merged 2 commits into from
Nov 21, 2023
Merged
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
4 changes: 3 additions & 1 deletion src/pyscipopt/scip.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -2169,7 +2169,7 @@ cdef class Model:
SCIPgetConsNVars(self._scip, constraint.scip_cons, &_nvars, &success)

cdef SCIP_VAR** _vars = <SCIP_VAR**> malloc(_nvars * sizeof(SCIP_VAR*))
SCIPgetConsVars(self._scip, constraint.scip_cons, _vars, _nvars*sizeof(SCIP_VAR), &success)
SCIPgetConsVars(self._scip, constraint.scip_cons, _vars, _nvars*sizeof(SCIP_VAR*), &success)

vars = []
for i in range(_nvars):
Expand Down Expand Up @@ -4457,6 +4457,8 @@ cdef class Model:
"""
cdef SCIP_SOL* _sol
_sol = <SCIP_SOL*>solution.sol

assert _sol != NULL, "Cannot set value to a freed solution."
mmghannam marked this conversation as resolved.
Show resolved Hide resolved
PY_SCIP_CALL(SCIPsetSolVal(self._scip, _sol, var.scip_var, val))

def trySol(self, Solution solution, printreason=True, completely=False, checkbounds=True, checkintegrality=True, checklprows=True, free=True):
Expand Down
Loading