forked from scipopt/PySCIPOpt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelax.pxi
78 lines (63 loc) · 2.28 KB
/
relax.pxi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
##@file relax.pxi
#@brief Base class of the Relaxator Plugin
cdef class Relax:
cdef public Model model
cdef public str name
def relaxfree(self):
'''calls destructor and frees memory of relaxation handler'''
pass
def relaxinit(self):
'''initializes relaxation handler'''
pass
def relaxexit(self):
'''calls exit method of relaxation handler'''
pass
def relaxinitsol(self):
'''informs relaxaton handler that the branch and bound process is being started'''
pass
def relaxexitsol(self):
'''informs relaxation handler that the branch and bound process data is being freed'''
pass
def relaxexec(self):
'''callls execution method of relaxation handler'''
print("python error in relaxexec: this method needs to be implemented")
return{}
cdef SCIP_RETCODE PyRelaxCopy (SCIP* scip, SCIP_RELAX* relax):
return SCIP_OKAY
cdef SCIP_RETCODE PyRelaxFree (SCIP* scip, SCIP_RELAX* relax):
cdef SCIP_RELAXDATA* relaxdata
relaxdata = SCIPrelaxGetData(relax)
PyRelax = <Relax>relaxdata
PyRelax.relaxfree()
Py_DECREF(PyRelax)
return SCIP_OKAY
cdef SCIP_RETCODE PyRelaxInit (SCIP* scip, SCIP_RELAX* relax):
cdef SCIP_RELAXDATA* relaxdata
relaxdata = SCIPrelaxGetData(relax)
PyRelax = <Relax>relaxdata
PyRelax.relaxinit()
return SCIP_OKAY
cdef SCIP_RETCODE PyRelaxExit (SCIP* scip, SCIP_RELAX* relax):
cdef SCIP_RELAXDATA* relaxdata
relaxdata = SCIPrelaxGetData(relax)
PyRelax = <Relax>relaxdata
PyRelax.relaxexit()
return SCIP_OKAY
cdef SCIP_RETCODE PyRelaxInitsol (SCIP* scip, SCIP_RELAX* relax):
cdef SCIP_RELAXDATA* relaxdata
relaxdata = SCIPrelaxGetData(relax)
PyRelax = <Relax>relaxdata
PyRelax.relaxinitsol()
return SCIP_OKAY
cdef SCIP_RETCODE PyRelaxExitsol (SCIP* scip, SCIP_RELAX* relax):
cdef SCIP_RELAXDATA* relaxdata
relaxdata = SCIPrelaxGetData(relax)
PyRelax = <Relax>relaxdata
PyRelax.relaxexitsol()
return SCIP_OKAY
cdef SCIP_RETCODE PyRelaxExec (SCIP* scip, SCIP_RELAX* relax, SCIP_Real* lowerbound, SCIP_RESULT* result):
cdef SCIP_RELAXDATA* relaxdata
relaxdata = SCIPrelaxGetData(relax)
PyRelax = <Relax>relaxdata
PyRelax.relaxexec()
return SCIP_OKAY