Scippy

SCIP

Solving Constraint Integer Programs

prop.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 prop.h
17  * @brief internal methods for propagators
18  * @author Tobias Achterberg
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #ifndef __SCIP_PROP_H__
24 #define __SCIP_PROP_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_lp.h"
34 #include "scip/type_var.h"
35 #include "scip/type_prop.h"
36 #include "scip/pub_prop.h"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /** copies the given propagator to a new scip */
43 extern
45  SCIP_PROP* prop, /**< propagator */
46  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
47  );
48 
49 /** creates a propagator */
50 extern
52  SCIP_PROP** prop, /**< pointer to propagator data structure */
53  SCIP_SET* set, /**< global SCIP settings */
54  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
55  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
56  const char* name, /**< name of propagator */
57  const char* desc, /**< description of propagator */
58  int priority, /**< priority of propagator (>= 0: before, < 0: after constraint handlers) */
59  int freq, /**< frequency for calling propagator */
60  SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
61  SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where heuristic should be executed */
62  int presolpriority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
63  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
64  SCIP_Bool presoldelay, /**< should presolving be delayed, if other presolvers found reductions? */
65  SCIP_DECL_PROPCOPY ((*propcopy)), /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
66  SCIP_DECL_PROPFREE ((*propfree)), /**< destructor of propagator */
67  SCIP_DECL_PROPINIT ((*propinit)), /**< initialize propagator */
68  SCIP_DECL_PROPEXIT ((*propexit)), /**< deinitialize propagator */
69  SCIP_DECL_PROPINITPRE ((*propinitpre)), /**< presolving initialization method of propagator */
70  SCIP_DECL_PROPEXITPRE ((*propexitpre)), /**< presolving deinitialization method of propagator */
71  SCIP_DECL_PROPINITSOL ((*propinitsol)), /**< solving process initialization method of propagator */
72  SCIP_DECL_PROPEXITSOL ((*propexitsol)), /**< solving process deinitialization method of propagator */
73  SCIP_DECL_PROPPRESOL ((*proppresol)), /**< presolving method */
74  SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
75  SCIP_DECL_PROPRESPROP ((*propresprop)), /**< propagation conflict resolving method */
76  SCIP_PROPDATA* propdata /**< propagator data */
77  );
78 
79 /** calls destructor and frees memory of propagator */
80 extern
82  SCIP_PROP** prop, /**< pointer to propagator data structure */
83  SCIP_SET* set /**< global SCIP settings */
84  );
85 
86 /** initializes propagator */
87 extern
89  SCIP_PROP* prop, /**< propagator */
90  SCIP_SET* set /**< global SCIP settings */
91  );
92 
93 /** calls exit method of propagator */
94 extern
96  SCIP_PROP* prop, /**< propagator */
97  SCIP_SET* set /**< global SCIP settings */
98  );
99 
100 /** informs propagator that the presolving process is being started */
101 extern
103  SCIP_PROP* prop, /**< propagator */
104  SCIP_SET* set /**< global SCIP settings */
105  );
106 
107 /** informs propagator that the presolving is finished */
108 extern
110  SCIP_PROP* prop, /**< propagator */
111  SCIP_SET* set /**< global SCIP settings */
112  );
113 
114 /** informs propagator that the branch and bound process is being started */
115 extern
117  SCIP_PROP* prop, /**< propagator */
118  SCIP_SET* set /**< global SCIP settings */
119  );
120 
121 /** informs propagator that the branch and bound process data is being freed */
122 extern
124  SCIP_PROP* prop, /**< propagator */
125  SCIP_SET* set, /**< global SCIP settings */
126  SCIP_Bool restart /**< was this exit solve call triggered by a restart? */
127  );
128 
129 /** executes presolving method of propagator */
130 extern
132  SCIP_PROP* prop, /**< propagator */
133  SCIP_SET* set, /**< global SCIP settings */
134  SCIP_Bool execdelayed, /**< execute presolver even if it is marked to be delayed */
135  int nrounds, /**< number of presolving rounds already done */
136  int* nfixedvars, /**< pointer to total number of variables fixed of all presolvers */
137  int* naggrvars, /**< pointer to total number of variables aggregated of all presolvers */
138  int* nchgvartypes, /**< pointer to total number of variable type changes of all presolvers */
139  int* nchgbds, /**< pointer to total number of variable bounds tightened of all presolvers */
140  int* naddholes, /**< pointer to total number of domain holes added of all presolvers */
141  int* ndelconss, /**< pointer to total number of deleted constraints of all presolvers */
142  int* naddconss, /**< pointer to total number of added constraints of all presolvers */
143  int* nupgdconss, /**< pointer to total number of upgraded constraints of all presolvers */
144  int* nchgcoefs, /**< pointer to total number of changed coefficients of all presolvers */
145  int* nchgsides, /**< pointer to total number of changed left/right hand sides of all presolvers */
146  SCIP_RESULT* result /**< pointer to store the result of the callback method */
147  );
148 
149 /** calls execution method of propagator */
150 extern
152  SCIP_PROP* prop, /**< propagator */
153  SCIP_SET* set, /**< global SCIP settings */
154  SCIP_STAT* stat, /**< dynamic problem statistics */
155  int depth, /**< depth of current node */
156  SCIP_Bool execdelayed, /**< execute propagator even if it is marked to be delayed */
157  SCIP_Bool instrongbranching, /**< are we currently doing strong branching? */
158  SCIP_PROPTIMING proptiming, /**< current point in the node solving process */
159  SCIP_RESULT* result /**< pointer to store the result of the callback method */
160  );
161 
162 /** resolves the given conflicting bound, that was deduced by the given propagator, by putting all "reason" bounds
163  * leading to the deduction into the conflict queue with calls to SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(),
164  * SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or SCIPaddConflictBinvar();
165  *
166  * @note it is sufficient to explain the relaxed bound change
167  */
168 extern
170  SCIP_PROP* prop, /**< propagator */
171  SCIP_SET* set, /**< global SCIP settings */
172  SCIP_VAR* infervar, /**< variable whose bound was deduced by the constraint */
173  int inferinfo, /**< user inference information attached to the bound change */
174  SCIP_BOUNDTYPE inferboundtype, /**< bound that was deduced (lower or upper bound) */
175  SCIP_BDCHGIDX* bdchgidx, /**< bound change index, representing the point of time where change took place */
176  SCIP_Real relaxedbd, /**< the relaxed bound */
177  SCIP_RESULT* result /**< pointer to store the result of the callback method */
178  );
179 
180 /** sets priority of propagator */
181 extern
183  SCIP_PROP* prop, /**< propagator */
184  SCIP_SET* set, /**< global SCIP settings */
185  int priority /**< new priority of the propagator */
186  );
187 
188 /** sets presolving priority of propagator */
189 extern
191  SCIP_PROP* prop, /**< propagator */
192  SCIP_SET* set, /**< global SCIP settings */
193  int presolpriority /**< new priority of the propagator */
194  );
195 
196 /** sets copy method of propagator */
197 extern
198 void SCIPpropSetCopy(
199  SCIP_PROP* prop, /**< propagator */
200  SCIP_DECL_PROPCOPY ((*propcopy)) /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
201  );
202 
203 /** sets destructor method of propagator */
204 extern
205 void SCIPpropSetFree(
206  SCIP_PROP* prop, /**< propagator */
207  SCIP_DECL_PROPFREE ((*propfree)) /**< destructor of propagator */
208  );
209 
210 /** sets initialization method of propagator */
211 extern
212 void SCIPpropSetInit(
213  SCIP_PROP* prop, /**< propagator */
214  SCIP_DECL_PROPINIT ((*propinit)) /**< initialize propagator */
215  );
216 
217 /** sets deinitialization method of propagator */
218 extern
219 void SCIPpropSetExit(
220  SCIP_PROP* prop, /**< propagator */
221  SCIP_DECL_PROPEXIT ((*propexit)) /**< deinitialize propagator */
222  );
223 
224 /** sets solving process initialization method of propagator */
225 extern
226 void SCIPpropSetInitsol(
227  SCIP_PROP* prop, /**< propagator */
228  SCIP_DECL_PROPINITSOL((*propinitsol)) /**< solving process initialization method of propagator */
229  );
230 
231 /** sets solving process deinitialization method of propagator */
232 extern
233 void SCIPpropSetExitsol(
234  SCIP_PROP* prop, /**< propagator */
235  SCIP_DECL_PROPEXITSOL ((*propexitsol)) /**< solving process deinitialization method of propagator */
236  );
237 
238 /** sets preprocessing initialization method of propagator */
239 extern
240 void SCIPpropSetInitpre(
241  SCIP_PROP* prop, /**< propagator */
242  SCIP_DECL_PROPINITPRE((*propinitpre)) /**< preprocessing initialization method of propagator */
243  );
244 
245 /** sets preprocessing deinitialization method of propagator */
246 extern
247 void SCIPpropSetExitpre(
248  SCIP_PROP* prop, /**< propagator */
249  SCIP_DECL_PROPEXITPRE((*propexitpre)) /**< preprocessing deinitialization method of propagator */
250  );
251 
252 /** sets presolving method of propagator */
253 extern
254 void SCIPpropSetPresol(
255  SCIP_PROP* prop, /**< propagator */
256  SCIP_DECL_PROPPRESOL ((*proppresol)), /**< presolving method */
257  int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */
258  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
259  SCIP_Bool presoldelay /**< should presolving be delayed, if other presolvers found reductions? */
260  );
261 
262 /** sets propagation conflict resolving callback of propagator */
263 extern
264 void SCIPpropSetResprop(
265  SCIP_PROP* prop, /**< propagator */
266  SCIP_DECL_PROPRESPROP ((*propresprop)) /**< propagation conflict resolving callback */
267  );
268 
269 #ifdef __cplusplus
270 }
271 #endif
272 
273 #endif
274