PySCIPOpt  5.1.1
Python Interface for the SCIP Optimization Suite
pricer.pxi
Go to the documentation of this file.
1 
3 cdef class Pricer:
4  cdef public Model model
5 
6  def pricerfree(self):
7  '''calls destructor and frees memory of variable pricer '''
8  pass
9 
10  def pricerinit(self):
11  '''initializes variable pricer'''
12  pass
13 
14  def pricerexit(self):
15  '''calls exit method of variable pricer'''
16  pass
17 
18  def pricerinitsol(self):
19  '''informs variable pricer that the branch and bound process is being started '''
20  pass
21 
22  def pricerexitsol(self):
23  '''informs variable pricer that the branch and bound process data is being freed'''
24  pass
25 
26  def pricerredcost(self):
27  '''calls reduced cost pricing method of variable pricer'''
28  raise NotImplementedError("pricerredcost() is a fundamental callback and should be implemented in the derived class")
29 
30  def pricerfarkas(self):
31  '''calls Farkas pricing method of variable pricer'''
32  raise NotImplementedError("pricerfarkas() is a fundamental callback and should be implemented in the derived class")
33 
34 
35 
36 cdef SCIP_RETCODE PyPricerCopy (SCIP* scip, SCIP_PRICER* pricer, SCIP_Bool* valid) noexcept with gil:
37  return SCIP_OKAY
38 
39 cdef SCIP_RETCODE PyPricerFree (SCIP* scip, SCIP_PRICER* pricer) noexcept with gil:
40  cdef SCIP_PRICERDATA* pricerdata
41  pricerdata = SCIPpricerGetData(pricer)
42  PyPricer = <Pricer>pricerdata
43  PyPricer.pricerfree()
44  Py_DECREF(PyPricer)
45  return SCIP_OKAY
46 
47 cdef SCIP_RETCODE PyPricerInit (SCIP* scip, SCIP_PRICER* pricer) noexcept with gil:
48  cdef SCIP_PRICERDATA* pricerdata
49  pricerdata = SCIPpricerGetData(pricer)
50  PyPricer = <Pricer>pricerdata
51  PyPricer.pricerinit()
52  return SCIP_OKAY
53 
54 cdef SCIP_RETCODE PyPricerExit (SCIP* scip, SCIP_PRICER* pricer) noexcept with gil:
55  cdef SCIP_PRICERDATA* pricerdata
56  pricerdata = SCIPpricerGetData(pricer)
57  PyPricer = <Pricer>pricerdata
58  PyPricer.pricerexit()
59  return SCIP_OKAY
60 
61 cdef SCIP_RETCODE PyPricerInitsol (SCIP* scip, SCIP_PRICER* pricer) noexcept with gil:
62  cdef SCIP_PRICERDATA* pricerdata
63  pricerdata = SCIPpricerGetData(pricer)
64  PyPricer = <Pricer>pricerdata
65  PyPricer.pricerinitsol()
66  return SCIP_OKAY
67 
68 cdef SCIP_RETCODE PyPricerExitsol (SCIP* scip, SCIP_PRICER* pricer) noexcept with gil:
69  cdef SCIP_PRICERDATA* pricerdata
70  pricerdata = SCIPpricerGetData(pricer)
71  PyPricer = <Pricer>pricerdata
72  PyPricer.pricerexitsol()
73  return SCIP_OKAY
74 
75 cdef SCIP_RETCODE PyPricerRedcost (SCIP* scip, SCIP_PRICER* pricer, SCIP_Real* lowerbound, SCIP_Bool* stopearly, SCIP_RESULT* result) noexcept with gil:
76  cdef SCIP_PRICERDATA* pricerdata
77  pricerdata = SCIPpricerGetData(pricer)
78  PyPricer = <Pricer>pricerdata
79  result_dict = PyPricer.pricerredcost()
80  result[0] = result_dict.get("result", <SCIP_RESULT>result[0])
81  lowerbound[0] = result_dict.get("lowerbound", <SCIP_Real>lowerbound[0])
82  stopearly[0] = result_dict.get("stopearly", <SCIP_Bool>stopearly[0])
83  return SCIP_OKAY
84 
85 cdef SCIP_RETCODE PyPricerFarkas (SCIP* scip, SCIP_PRICER* pricer, SCIP_RESULT* result) noexcept with gil:
86  cdef SCIP_PRICERDATA* pricerdata
87  pricerdata = SCIPpricerGetData(pricer)
88  PyPricer = <Pricer>pricerdata
89  result[0] = PyPricer.pricerfarkas().get("result", <SCIP_RESULT>result[0])
90  return SCIP_OKAY
pyscipopt.pricer.Pricer
Definition: pricer.pxi:3
pyscipopt.pricer.pricerinit
def pricerinit(self)
Definition: pricer.pxi:10
pyscipopt.pricer.pricerredcost
def pricerredcost(self)
Definition: pricer.pxi:26
pyscipopt.pricer.pricerfree
def pricerfree(self)
Definition: pricer.pxi:6
pyscipopt.pricer.pricerexitsol
def pricerexitsol(self)
Definition: pricer.pxi:22
pyscipopt.pricer.pricerfarkas
def pricerfarkas(self)
Definition: pricer.pxi:30
SCIPpricerGetData
SCIP_PRICERDATA * SCIPpricerGetData(SCIP_PRICER *pricer)
pyscipopt.pricer.pricerexit
def pricerexit(self)
Definition: pricer.pxi:14
pyscipopt.pricer.pricerinitsol
def pricerinitsol(self)
Definition: pricer.pxi:18