Closed LipingZhao closed 9 months ago
Hi. I guess this is not possible right now, but should be simple enough to extend the interface to have access to the following methods from SCIP:
SCIPhasPrimalRay
SCIPgetPrimalRayVal
which I guess are the ones you need
Thanks for your reply very much. If I want to extend the interface, do I have to install the SCIP from source so that it can be compiled successfully after modifying the scip.pyx file?
mmm I don't think so, but you do need to recompile the interface (or somebody @CGraczyk) would need to publish a new version. Maybe @CGraczyk can share more details
mmm I don't think so, but you do need to recompile the interface (or somebody @CGraczyk) would need to publish a new version. Maybe @CGraczyk can share more details
Thanks again for your reply. I have already understood how to extend the interface of SCIPlpigetPrimalRay for python. But I'm still not sure how to write the code in the scip.pyx file. I set the shape of ray to the number of variables, which should be wrong actually.
def getPrimalRay(self):
cdef SCIP_LPI* lpi
PY_SCIP_CALL(SCIPgetLPI(self._scip, &lpi))
cdef int nvars = SCIPgetNVars(self._scip)
cdef SCIP_Real* ray = <SCIP_Real*> malloc(nvars * sizeof(SCIP_Real))
PY_SCIP_CALL(SCIPlpiGetPrimalRay(lpi, ray))
return [ray[i] for i in range(nvars)]
I would appreciate it if somebody could give me some guidance. @CGraczyk
Hello, @LipingZhao! Sorry this took so long, but I think I managed to do what you needed. See the PR #743, where I added hasPrimalRay, getPrimalRay, and getPrimalRayVal.
You probably don't have this issue anymore, but do you think this solved it?
Closing this for now, @LipingZhao feel free to reopen if the problem remains.
I'm trying to implement benders decomposition using pyscipopt. I wonder if the pyscipopt class 'Model' can support extreme rays. If there is a certain method, could you provide some examples that can be used. Thank you so much.