4 cdef public Model model
7 '''frees memory of cut selector'''
11 ''' executed after the problem is transformed. use this call to initialize cut selector data.'''
15 '''executed before the transformed problem is freed'''
19 '''executed when the presolving is finished and the branch-and-bound process is about to begin'''
23 '''executed before the branch-and-bound process is freed'''
27 '''first method called in each iteration in the main solving loop. '''
32 cdef SCIP_RETCODE PyCutselCopy (SCIP* scip, SCIP_CUTSEL* cutsel) noexcept
with gil:
35 cdef SCIP_RETCODE PyCutselFree (SCIP* scip, SCIP_CUTSEL* cutsel) noexcept
with gil:
36 cdef SCIP_CUTSELDATA* cutseldata
38 PyCutsel = <Cutsel>cutseldata
43 cdef SCIP_RETCODE PyCutselInit (SCIP* scip, SCIP_CUTSEL* cutsel) noexcept
with gil:
44 cdef SCIP_CUTSELDATA* cutseldata
46 PyCutsel = <Cutsel>cutseldata
51 cdef SCIP_RETCODE PyCutselExit (SCIP* scip, SCIP_CUTSEL* cutsel) noexcept
with gil:
52 cdef SCIP_CUTSELDATA* cutseldata
54 PyCutsel = <Cutsel>cutseldata
58 cdef SCIP_RETCODE PyCutselInitsol (SCIP* scip, SCIP_CUTSEL* cutsel) noexcept
with gil:
59 cdef SCIP_CUTSELDATA* cutseldata
61 PyCutsel = <Cutsel>cutseldata
62 PyCutsel.cutselinitsol()
65 cdef SCIP_RETCODE PyCutselExitsol (SCIP* scip, SCIP_CUTSEL* cutsel) noexcept
with gil:
66 cdef SCIP_CUTSELDATA* cutseldata
68 PyCutsel = <Cutsel>cutseldata
69 PyCutsel.cutselexitsol()
72 cdef SCIP_RETCODE PyCutselSelect (SCIP* scip, SCIP_CUTSEL* cutsel, SCIP_ROW** cuts, int ncuts,
73 SCIP_ROW** forcedcuts, int nforcedcuts, SCIP_Bool root, int maxnselectedcuts,
74 int* nselectedcuts, SCIP_RESULT* result) noexcept
with gil:
75 cdef SCIP_CUTSELDATA* cutseldata
76 cdef SCIP_ROW* scip_row
78 PyCutsel = <Cutsel>cutseldata
81 pycuts = [Row.create(cuts[i])
for i
in range(ncuts)]
82 pyforcedcuts = [Row.create(forcedcuts[i])
for i
in range(nforcedcuts)]
83 result_dict = PyCutsel.cutselselect(pycuts, pyforcedcuts, root, maxnselectedcuts)
87 pycuts = result_dict.get(
'cuts', pycuts)
89 assert len(pycuts) == ncuts
90 assert len(pyforcedcuts) == nforcedcuts
93 for i,cut
in enumerate(pycuts):
94 cuts[i] = <SCIP_ROW *>((<Row>cut).scip_row)
96 nselectedcuts[0] = result_dict.get(
'nselectedcuts', 0)
97 result[0] = result_dict.get(
'result', <SCIP_RESULT>result[0])