PySCIPOpt
Python Interface to the SCIP Optimization Suite
sepa.pxi
Go to the documentation of this file.
1 ##@file sepa.pxi
2 #@brief Base class of the Separator Plugin
3 cdef class Sepa:
4  cdef public Model model
5  cdef public str name
6 
7  def sepafree(self):
8  '''calls destructor and frees memory of separator'''
9  pass
10 
11  def sepainit(self):
12  '''initializes separator'''
13  pass
14 
15  def sepaexit(self):
16  '''calls exit method of separator'''
17  pass
18 
19  def sepainitsol(self):
20  '''informs separator that the branch and bound process is being started'''
21  pass
22 
23  def sepaexitsol(self):
24  '''informs separator that the branch and bound process data is being freed'''
25  pass
26 
27  def sepaexeclp(self):
28  '''calls LP separation method of separator'''
29  return {}
30 
31  def sepaexecsol(self, solution):
32  '''calls primal solution separation method of separator'''
33  return {}
34 
35 
36 
37 cdef SCIP_RETCODE PySepaCopy (SCIP* scip, SCIP_SEPA* sepa):
38  return SCIP_OKAY
39 
40 cdef SCIP_RETCODE PySepaFree (SCIP* scip, SCIP_SEPA* sepa):
41  cdef SCIP_SEPADATA* sepadata
42  sepadata = SCIPsepaGetData(sepa)
43  PySepa = <Sepa>sepadata
44  PySepa.sepafree()
45  Py_DECREF(PySepa)
46  return SCIP_OKAY
47 
48 cdef SCIP_RETCODE PySepaInit (SCIP* scip, SCIP_SEPA* sepa):
49  cdef SCIP_SEPADATA* sepadata
50  sepadata = SCIPsepaGetData(sepa)
51  PySepa = <Sepa>sepadata
52  PySepa.sepainit()
53  return SCIP_OKAY
54 
55 cdef SCIP_RETCODE PySepaExit (SCIP* scip, SCIP_SEPA* sepa):
56  cdef SCIP_SEPADATA* sepadata
57  sepadata = SCIPsepaGetData(sepa)
58  PySepa = <Sepa>sepadata
59  PySepa.sepaexit()
60  return SCIP_OKAY
61 
62 cdef SCIP_RETCODE PySepaInitsol (SCIP* scip, SCIP_SEPA* sepa):
63  cdef SCIP_SEPADATA* sepadata
64  sepadata = SCIPsepaGetData(sepa)
65  PySepa = <Sepa>sepadata
66  PySepa.sepainitsol()
67  return SCIP_OKAY
68 
69 cdef SCIP_RETCODE PySepaExitsol (SCIP* scip, SCIP_SEPA* sepa):
70  cdef SCIP_SEPADATA* sepadata
71  sepadata = SCIPsepaGetData(sepa)
72  PySepa = <Sepa>sepadata
73  PySepa.sepaexitsol()
74  return SCIP_OKAY
75 
76 cdef SCIP_RETCODE PySepaExeclp (SCIP* scip, SCIP_SEPA* sepa, SCIP_RESULT* result, unsigned int allowlocal):
77  cdef SCIP_SEPADATA* sepadata
78  sepadata = SCIPsepaGetData(sepa)
79  PySepa = <Sepa>sepadata
80  result_dict = PySepa.sepaexeclp()
81  result[0] = result_dict.get("result", <SCIP_RESULT>result[0])
82  return SCIP_OKAY
83 
84 cdef SCIP_RETCODE PySepaExecsol (SCIP* scip, SCIP_SEPA* sepa, SCIP_SOL* sol, SCIP_RESULT* result, unsigned int allowlocal):
85  cdef SCIP_SEPADATA* sepadata
86  sepadata = SCIPsepaGetData(sepa)
87  solution = Solution()
88  solution.sol = sol
89  PySepa = <Sepa>sepadata
90  result_dict = PySepa.sepaexecsol(solution)
91  result[0] = result_dict.get("result", <SCIP_RESULT>result[0])
92  return SCIP_OKAY
SCIP_SEPADATA * SCIPsepaGetData(SCIP_SEPA *sepa)