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-2019 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 visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file prop.h
17  * @ingroup INTERNALAPI
18  * @brief internal methods for propagators
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_PROP_H__
25 #define __SCIP_PROP_H__
26 
27 
28 #include "scip/def.h"
29 #include "blockmemshell/memory.h"
30 #include "scip/type_retcode.h"
31 #include "scip/type_result.h"
32 #include "scip/type_set.h"
33 #include "scip/type_stat.h"
34 #include "scip/type_lp.h"
35 #include "scip/type_var.h"
36 #include "scip/type_prop.h"
37 #include "scip/pub_prop.h"
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /** copies the given propagator to a new scip */
44 extern
46  SCIP_PROP* prop, /**< propagator */
47  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
48  );
49 
50 /** creates a propagator */
51 extern
53  SCIP_PROP** prop, /**< pointer to propagator data structure */
54  SCIP_SET* set, /**< global SCIP settings */
55  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
56  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
57  const char* name, /**< name of propagator */
58  const char* desc, /**< description of propagator */
59  int priority, /**< priority of propagator (>= 0: before, < 0: after constraint handlers) */
60  int freq, /**< frequency for calling propagator */
61  SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
62  SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagator should be executed */
63  int presolpriority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
64  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
65  SCIP_PRESOLTIMING presoltiming, /**< timing mask of the propagator's presolving method */
66  SCIP_DECL_PROPCOPY ((*propcopy)), /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
67  SCIP_DECL_PROPFREE ((*propfree)), /**< destructor of propagator */
68  SCIP_DECL_PROPINIT ((*propinit)), /**< initialize propagator */
69  SCIP_DECL_PROPEXIT ((*propexit)), /**< deinitialize propagator */
70  SCIP_DECL_PROPINITPRE ((*propinitpre)), /**< presolving initialization method of propagator */
71  SCIP_DECL_PROPEXITPRE ((*propexitpre)), /**< presolving deinitialization method of propagator */
72  SCIP_DECL_PROPINITSOL ((*propinitsol)), /**< solving process initialization method of propagator */
73  SCIP_DECL_PROPEXITSOL ((*propexitsol)), /**< solving process deinitialization method of propagator */
74  SCIP_DECL_PROPPRESOL ((*proppresol)), /**< presolving method */
75  SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
76  SCIP_DECL_PROPRESPROP ((*propresprop)), /**< propagation conflict resolving method */
77  SCIP_PROPDATA* propdata /**< propagator data */
78  );
79 
80 /** calls destructor and frees memory of propagator */
81 extern
83  SCIP_PROP** prop, /**< pointer to propagator data structure */
84  SCIP_SET* set /**< global SCIP settings */
85  );
86 
87 /** initializes propagator */
88 extern
90  SCIP_PROP* prop, /**< propagator */
91  SCIP_SET* set /**< global SCIP settings */
92  );
93 
94 /** calls exit method of propagator */
95 extern
97  SCIP_PROP* prop, /**< propagator */
98  SCIP_SET* set /**< global SCIP settings */
99  );
100 
101 /** informs propagator that the presolving process is being started */
102 extern
104  SCIP_PROP* prop, /**< propagator */
105  SCIP_SET* set /**< global SCIP settings */
106  );
107 
108 /** informs propagator that the presolving is finished */
109 extern
111  SCIP_PROP* prop, /**< propagator */
112  SCIP_SET* set /**< global SCIP settings */
113  );
114 
115 /** informs propagator that the branch and bound process is being started */
116 extern
118  SCIP_PROP* prop, /**< propagator */
119  SCIP_SET* set /**< global SCIP settings */
120  );
121 
122 /** informs propagator that the branch and bound process data is being freed */
123 extern
125  SCIP_PROP* prop, /**< propagator */
126  SCIP_SET* set, /**< global SCIP settings */
127  SCIP_Bool restart /**< was this exit solve call triggered by a restart? */
128  );
129 
130 /** executes presolving method of propagator */
131 extern
133  SCIP_PROP* prop, /**< propagator */
134  SCIP_SET* set, /**< global SCIP settings */
135  SCIP_PRESOLTIMING timing, /**< current presolving timing */
136  int nrounds, /**< number of presolving rounds already done */
137  int* nfixedvars, /**< pointer to total number of variables fixed of all presolvers */
138  int* naggrvars, /**< pointer to total number of variables aggregated of all presolvers */
139  int* nchgvartypes, /**< pointer to total number of variable type changes of all presolvers */
140  int* nchgbds, /**< pointer to total number of variable bounds tightened of all presolvers */
141  int* naddholes, /**< pointer to total number of domain holes added of all presolvers */
142  int* ndelconss, /**< pointer to total number of deleted constraints of all presolvers */
143  int* naddconss, /**< pointer to total number of added constraints of all presolvers */
144  int* nupgdconss, /**< pointer to total number of upgraded constraints of all presolvers */
145  int* nchgcoefs, /**< pointer to total number of changed coefficients of all presolvers */
146  int* nchgsides, /**< pointer to total number of changed left/right hand sides of all presolvers */
147  SCIP_RESULT* result /**< pointer to store the result of the callback method */
148  );
149 
150 /** calls execution method of propagator */
151 extern
153  SCIP_PROP* prop, /**< propagator */
154  SCIP_SET* set, /**< global SCIP settings */
155  SCIP_STAT* stat, /**< dynamic problem statistics */
156  int depth, /**< depth of current node */
157  SCIP_Bool execdelayed, /**< execute propagator even if it is marked to be delayed */
158  SCIP_Bool instrongbranching, /**< are we currently doing strong branching? */
159  SCIP_PROPTIMING proptiming, /**< current point in the node solving process */
160  SCIP_RESULT* result /**< pointer to store the result of the callback method */
161  );
162 
163 /** resolves the given conflicting bound, that was deduced by the given propagator, by putting all "reason" bounds
164  * leading to the deduction into the conflict queue with calls to SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(),
165  * SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or SCIPaddConflictBinvar();
166  *
167  * @note it is sufficient to explain the relaxed bound change
168  */
169 extern
171  SCIP_PROP* prop, /**< propagator */
172  SCIP_SET* set, /**< global SCIP settings */
173  SCIP_VAR* infervar, /**< variable whose bound was deduced by the constraint */
174  int inferinfo, /**< user inference information attached to the bound change */
175  SCIP_BOUNDTYPE inferboundtype, /**< bound that was deduced (lower or upper bound) */
176  SCIP_BDCHGIDX* bdchgidx, /**< bound change index, representing the point of time where change took place */
177  SCIP_Real relaxedbd, /**< the relaxed bound */
178  SCIP_RESULT* result /**< pointer to store the result of the callback method */
179  );
180 
181 /** sets priority of propagator */
182 extern
184  SCIP_PROP* prop, /**< propagator */
185  SCIP_SET* set, /**< global SCIP settings */
186  int priority /**< new priority of the propagator */
187  );
188 
189 /** sets presolving priority of propagator */
190 extern
192  SCIP_PROP* prop, /**< propagator */
193  SCIP_SET* set, /**< global SCIP settings */
194  int presolpriority /**< new priority of the propagator */
195  );
196 
197 /** sets copy method of propagator */
198 extern
199 void SCIPpropSetCopy(
200  SCIP_PROP* prop, /**< propagator */
201  SCIP_DECL_PROPCOPY ((*propcopy)) /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
202  );
203 
204 /** sets destructor method of propagator */
205 extern
206 void SCIPpropSetFree(
207  SCIP_PROP* prop, /**< propagator */
208  SCIP_DECL_PROPFREE ((*propfree)) /**< destructor of propagator */
209  );
210 
211 /** sets initialization method of propagator */
212 extern
213 void SCIPpropSetInit(
214  SCIP_PROP* prop, /**< propagator */
215  SCIP_DECL_PROPINIT ((*propinit)) /**< initialize propagator */
216  );
217 
218 /** sets deinitialization method of propagator */
219 extern
220 void SCIPpropSetExit(
221  SCIP_PROP* prop, /**< propagator */
222  SCIP_DECL_PROPEXIT ((*propexit)) /**< deinitialize propagator */
223  );
224 
225 /** sets solving process initialization method of propagator */
226 extern
227 void SCIPpropSetInitsol(
228  SCIP_PROP* prop, /**< propagator */
229  SCIP_DECL_PROPINITSOL((*propinitsol)) /**< solving process initialization method of propagator */
230  );
231 
232 /** sets solving process deinitialization method of propagator */
233 extern
234 void SCIPpropSetExitsol(
235  SCIP_PROP* prop, /**< propagator */
236  SCIP_DECL_PROPEXITSOL ((*propexitsol)) /**< solving process deinitialization method of propagator */
237  );
238 
239 /** sets preprocessing initialization method of propagator */
240 extern
241 void SCIPpropSetInitpre(
242  SCIP_PROP* prop, /**< propagator */
243  SCIP_DECL_PROPINITPRE((*propinitpre)) /**< preprocessing initialization method of propagator */
244  );
245 
246 /** sets preprocessing deinitialization method of propagator */
247 extern
248 void SCIPpropSetExitpre(
249  SCIP_PROP* prop, /**< propagator */
250  SCIP_DECL_PROPEXITPRE((*propexitpre)) /**< preprocessing deinitialization method of propagator */
251  );
252 
253 /** sets presolving method of propagator */
254 extern
256  SCIP_PROP* prop, /**< propagator */
257  SCIP_DECL_PROPPRESOL ((*proppresol)), /**< presolving method */
258  int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */
259  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
260  SCIP_PRESOLTIMING presoltiming /**< timing mask of the propagator's presolving method */
261  );
262 
263 /** sets propagation conflict resolving callback of propagator */
264 extern
265 void SCIPpropSetResprop(
266  SCIP_PROP* prop, /**< propagator */
267  SCIP_DECL_PROPRESPROP ((*propresprop)) /**< propagation conflict resolving callback */
268  );
269 
270 /** enables or disables all clocks of \p prop, depending on the value of the flag */
271 extern
273  SCIP_PROP* prop, /**< the propagator for which all clocks should be enabled or disabled */
274  SCIP_Bool enable /**< should the clocks of the propagator be enabled? */
275  );
276 
277 #ifdef __cplusplus
278 }
279 #endif
280 
281 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition: type_lp.h:50
SCIP_RETCODE SCIPpropCreate(SCIP_PROP **prop, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, int freq, SCIP_Bool delay, SCIP_PROPTIMING timingmask, int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming, SCIP_DECL_PROPCOPY((*propcopy)), SCIP_DECL_PROPFREE((*propfree)), SCIP_DECL_PROPINIT((*propinit)), SCIP_DECL_PROPEXIT((*propexit)), SCIP_DECL_PROPINITPRE((*propinitpre)), SCIP_DECL_PROPEXITPRE((*propexitpre)), SCIP_DECL_PROPINITSOL((*propinitsol)), SCIP_DECL_PROPEXITSOL((*propexitsol)), SCIP_DECL_PROPPRESOL((*proppresol)), SCIP_DECL_PROPEXEC((*propexec)), SCIP_DECL_PROPRESPROP((*propresprop)), SCIP_PROPDATA *propdata)
Definition: prop.c:232
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
#define SCIP_DECL_PROPEXITPRE(x)
Definition: type_prop.h:100
type definitions for global SCIP settings
SCIP_RETCODE SCIPpropExit(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:370
void SCIPpropSetInit(SCIP_PROP *prop, SCIP_DECL_PROPINIT((*propinit)))
Definition: prop.c:822
type definitions for return codes for SCIP methods
SCIP_RETCODE SCIPpropInitpre(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:400
#define SCIP_DECL_PROPEXEC(x)
Definition: type_prop.h:203
void SCIPpropSetResprop(SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop)))
Definition: prop.c:920
type definitions for problem statistics
void SCIPpropSetInitsol(SCIP_PROP *prop, SCIP_DECL_PROPINITSOL((*propinitsol)))
Definition: prop.c:844
type definitions for LP management
SCIP_RETCODE SCIPpropExec(SCIP_PROP *prop, SCIP_SET *set, SCIP_STAT *stat, int depth, SCIP_Bool execdelayed, SCIP_Bool instrongbranching, SCIP_PROPTIMING proptiming, SCIP_RESULT *result)
Definition: prop.c:635
#define SCIP_DECL_PROPEXITSOL(x)
Definition: type_prop.h:127
#define SCIP_DECL_PROPCOPY(x)
Definition: type_prop.h:47
void SCIPpropSetExit(SCIP_PROP *prop, SCIP_DECL_PROPEXIT((*propexit)))
Definition: prop.c:833
void SCIPpropSetFree(SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
Definition: prop.c:811
unsigned int SCIP_PRESOLTIMING
Definition: type_timing.h:52
#define SCIP_DECL_PROPINITPRE(x)
Definition: type_prop.h:85
type definitions for problem variables
SCIP_RETCODE SCIPpropExitpre(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:436
SCIP_RETCODE SCIPpropCopyInclude(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:90
void SCIPpropSetInitpre(SCIP_PROP *prop, SCIP_DECL_PROPINITPRE((*propinitpre)))
Definition: prop.c:866
#define SCIP_Bool
Definition: def.h:69
#define SCIP_DECL_PROPFREE(x)
Definition: type_prop.h:55
#define SCIP_DECL_PROPINITSOL(x)
Definition: type_prop.h:115
SCIP_RETCODE SCIPpropInit(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:304
SCIP_RETCODE SCIPpropResolvePropagation(SCIP_PROP *prop, SCIP_SET *set, SCIP_VAR *infervar, int inferinfo, SCIP_BOUNDTYPE inferboundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedbd, SCIP_RESULT *result)
Definition: prop.c:727
SCIP_RETCODE SCIPpropPresol(SCIP_PROP *prop, SCIP_SET *set, SCIP_PRESOLTIMING timing, int nrounds, int *nfixedvars, int *naggrvars, int *nchgvartypes, int *nchgbds, int *naddholes, int *ndelconss, int *naddconss, int *nupgdconss, int *nchgcoefs, int *nchgsides, SCIP_RESULT *result)
Definition: prop.c:509
type definitions for propagators
void SCIPpropSetPriority(SCIP_PROP *prop, SCIP_SET *set, int priority)
Definition: prop.c:971
SCIP_RETCODE SCIPpropSetPresol(SCIP_PROP *prop, SCIP_DECL_PROPPRESOL((*proppresol)), int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming)
Definition: prop.c:890
unsigned int SCIP_PROPTIMING
Definition: type_timing.h:66
void SCIPpropSetExitsol(SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
Definition: prop.c:855
#define SCIP_DECL_PROPRESPROP(x)
Definition: type_prop.h:244
#define SCIP_DECL_PROPPRESOL(x)
Definition: type_prop.h:179
#define SCIP_Real
Definition: def.h:157
struct SCIP_PropData SCIP_PROPDATA
Definition: type_prop.h:38
result codes for SCIP callback methods
SCIP_RETCODE SCIPpropInitsol(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:460
#define SCIP_DECL_PROPEXIT(x)
Definition: type_prop.h:71
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:426
SCIP_RETCODE SCIPpropFree(SCIP_PROP **prop, SCIP_SET *set)
Definition: prop.c:274
void SCIPpropSetExitpre(SCIP_PROP *prop, SCIP_DECL_PROPEXITPRE((*propexitpre)))
Definition: prop.c:879
void SCIPpropSetPresolPriority(SCIP_PROP *prop, SCIP_SET *set, int presolpriority)
Definition: prop.c:985
void SCIPpropEnableOrDisableClocks(SCIP_PROP *prop, SCIP_Bool enable)
Definition: prop.c:1009
SCIP_RETCODE SCIPpropExitsol(SCIP_PROP *prop, SCIP_SET *set, SCIP_Bool restart)
Definition: prop.c:484
void SCIPpropSetCopy(SCIP_PROP *prop, SCIP_DECL_PROPCOPY((*propcopy)))
Definition: prop.c:800
public methods for propagators
#define SCIP_DECL_PROPINIT(x)
Definition: type_prop.h:63
memory allocation routines