Scippy

SCIP

Solving Constraint Integer Programs

relax.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2014 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file relax.h
17  * @brief internal methods for relaxators
18  * @author Tobias Achterberg
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #ifndef __SCIP_RELAX_H__
24 #define __SCIP_RELAX_H__
25 
26 
27 #include "scip/def.h"
28 #include "blockmemshell/memory.h"
29 #include "scip/type_retcode.h"
30 #include "scip/type_result.h"
31 #include "scip/type_set.h"
32 #include "scip/type_stat.h"
33 #include "scip/type_relax.h"
34 #include "scip/pub_relax.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /** copies the given relaxator to a new scip */
41 extern
43  SCIP_RELAX* relax, /**< relaxator */
44  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
45  );
46 
47 /** creates a relaxator */
48 extern
50  SCIP_RELAX** relax, /**< pointer to relaxator data structure */
51  SCIP_SET* set, /**< global SCIP settings */
52  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
53  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
54  const char* name, /**< name of relaxator */
55  const char* desc, /**< description of relaxator */
56  int priority, /**< priority of the relaxator (negative: after LP, non-negative: before LP) */
57  int freq, /**< frequency for calling relaxator */
58  SCIP_DECL_RELAXCOPY ((*relaxcopy)), /**< copy method of relaxator or NULL if you don't want to copy your plugin into sub-SCIPs */
59  SCIP_DECL_RELAXFREE ((*relaxfree)), /**< destructor of relaxator */
60  SCIP_DECL_RELAXINIT ((*relaxinit)), /**< initialize relaxator */
61  SCIP_DECL_RELAXEXIT ((*relaxexit)), /**< deinitialize relaxator */
62  SCIP_DECL_RELAXINITSOL((*relaxinitsol)), /**< solving process initialization method of relaxator */
63  SCIP_DECL_RELAXEXITSOL((*relaxexitsol)), /**< solving process deinitialization method of relaxator */
64  SCIP_DECL_RELAXEXEC ((*relaxexec)), /**< execution method of relaxator */
65  SCIP_RELAXDATA* relaxdata /**< relaxator data */
66  );
67 
68 /** calls destructor and frees memory of relaxator */
69 extern
71  SCIP_RELAX** relax, /**< pointer to relaxator data structure */
72  SCIP_SET* set /**< global SCIP settings */
73  );
74 
75 /** initializes relaxator */
76 extern
78  SCIP_RELAX* relax, /**< relaxator */
79  SCIP_SET* set /**< global SCIP settings */
80  );
81 
82 /** calls exit method of relaxator */
83 extern
85  SCIP_RELAX* relax, /**< relaxator */
86  SCIP_SET* set /**< global SCIP settings */
87  );
88 
89 /** informs relaxator that the branch and bound process is being started */
90 extern
92  SCIP_RELAX* relax, /**< relaxator */
93  SCIP_SET* set /**< global SCIP settings */
94  );
95 
96 /** informs relaxator that the branch and bound process data is being freed */
97 extern
99  SCIP_RELAX* relax, /**< relaxator */
100  SCIP_SET* set /**< global SCIP settings */
101  );
102 
103 /** calls execution method of relaxator */
104 extern
106  SCIP_RELAX* relax, /**< relaxator */
107  SCIP_SET* set, /**< global SCIP settings */
108  SCIP_STAT* stat, /**< dynamic problem statistics */
109  int depth, /**< depth of current node */
110  SCIP_Real* lowerbound, /**< pointer to lower bound computed by the relaxator */
111  SCIP_RESULT* result /**< pointer to store the result of the callback method */
112  );
113 
114 /** sets priority of relaxator */
115 extern
117  SCIP_RELAX* relax, /**< relaxator */
118  SCIP_SET* set, /**< global SCIP settings */
119  int priority /**< new priority of the relaxator */
120  );
121 
122 /** set copy callback of relaxation handler */
123 extern
124 void SCIPrelaxSetCopy(
125  SCIP_RELAX* relax, /**< relaxation handler */
126  SCIP_DECL_RELAXCOPY ((*relaxcopy)) /**< copy method of relaxation handler */
127  );
128 
129 /** set destructor callback of relaxation handler */
130 extern
131 void SCIPrelaxSetFree(
132  SCIP_RELAX* relax, /**< relaxation handler */
133  SCIP_DECL_RELAXFREE ((*relaxfree)) /**< destructor of relaxation handler */
134  );
135 
136 /** set initialization callback of relaxation handler */
137 extern
138 void SCIPrelaxSetInit(
139  SCIP_RELAX* relax, /**< relaxation handler */
140  SCIP_DECL_RELAXINIT ((*relaxinit)) /**< initialize relaxation handler */
141  );
142 
143 /** set deinitialization callback of relaxation handler */
144 extern
145 void SCIPrelaxSetExit(
146  SCIP_RELAX* relax, /**< relaxation handler */
147  SCIP_DECL_RELAXEXIT ((*relaxexit)) /**< deinitialize relaxation handler */
148  );
149 
150 /** set solving process initialization callback of relaxation handler */
151 extern
153  SCIP_RELAX* relax, /**< relaxation handler */
154  SCIP_DECL_RELAXINITSOL((*relaxinitsol)) /**< solving process initialization method of relaxation handler */
155  );
156 
157 /** set solving process deinitialization callback of relaxation handler */
158 extern
160  SCIP_RELAX* relax, /**< relaxation handler */
161  SCIP_DECL_RELAXEXITSOL((*relaxexitsol)) /**< solving process deinitialization callback relaxation handler */
162  );
163 
164 /** returns whether the relaxation was completely solved at the current node */
165 extern
167  SCIP_RELAX* relax, /**< relaxator */
168  SCIP_STAT* stat /**< dynamic problem statistics */
169  );
170 
171 /*
172  * methods for the global relaxation data
173  */
174 
175 /** creates global relaxation data */
176 extern
178  SCIP_RELAXATION** relaxation /**< global relaxation data */
179  );
180 
181 /** frees global relaxation data */
182 extern
184  SCIP_RELAXATION** relaxation /**< global relaxation data */
185  );
186 
187 /** sets the relaxsolzero flag in the relaxation data to the given value */
188 extern
190  SCIP_RELAXATION* relaxation, /**< global relaxation data */
191  SCIP_Bool iszero /**< are all values of the relaxation solution set to zero? */
192  );
193 
194 /** returns whether the global relaxation solution is cleared and all values are set to zero */
195 extern
197  SCIP_RELAXATION* relaxation /**< global relaxation data */
198  );
199 
200 /** sets the relaxsolvalid flag in the relaxation data to the given value */
201 extern
203  SCIP_RELAXATION* relaxation, /**< global relaxation data */
204  SCIP_Bool isvalid /**< is the stored solution valid? */
205  );
206 
207 /** returns whether the global relaxation solution is valid */
208 extern
210  SCIP_RELAXATION* relaxation /**< global relaxation data */
211  );
212 
213 /** sets the objective value of the global relaxation solution */
214 extern
216  SCIP_RELAXATION* relaxation, /**< global relaxation data */
217  SCIP_Real obj /**< objective value */
218  );
219 
220 /** returns the objective value of the global relaxation solution w.r.t. the transformed problem */
221 extern
223  SCIP_RELAXATION* relaxation /**< global relaxation data */
224  );
225 
226 /** adds the given value to the global relaxation solution's objective value */
227 extern
229  SCIP_RELAXATION* relaxation, /**< global relaxation data */
230  SCIP_Real val /**< value to add to the objective value */
231  );
232 
233 #ifdef __cplusplus
234 }
235 #endif
236 
237 #endif
238