Skip to content

Conversation

@Joao-Dionisio
Copy link
Member

@Joao-Dionisio Joao-Dionisio commented Mar 14, 2024

getObjVal, getVal are too strict in the stage checks. For example, the following code crashes:

from pyscipopt import Model

m = Model()

x = m.addVar()
m.setObjective(x)

m.setParam("limits/solutions", 1)
m.optimize()

print("Stage: ", m.getStage())

print(m.getNSols())
print(m.getObjVal()) # crashes here, even though the model does have solutions

I changed it to reflect SCIP.

I also removed the noexcept from the code, because I couldn't compile otherwise. It's probably me being a dummy, but I do have Cython >= 3 (EDIT: It was me being a dummy). Of course, I imagine that not removing them is desirable.

EDIT2:

Okay, right now I'm having segfaults in test_customizedbenders.py, and I'm pretty sure it's because self._bestSol.sol is NULL, but I can't figure out why that is.

@Joao-Dionisio Joao-Dionisio marked this pull request as draft March 14, 2024 17:11
@Joao-Dionisio
Copy link
Member Author

PR closed while there are still problems with it. Opened issue #847 to keep track of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant