Scippy

SCIP

Solving Constraint Integer Programs

scip_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 scip_prop.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for propagator plugins
19  * @author Tobias Achterberg
20  * @author Timo Berthold
21  * @author Thorsten Koch
22  * @author Alexander Martin
23  * @author Marc Pfetsch
24  * @author Kati Wolter
25  * @author Gregor Hendel
26  * @author Robert Lion Gottwald
27  */
28 
29 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
30 
31 #ifndef __SCIP_SCIP_PROP_H__
32 #define __SCIP_SCIP_PROP_H__
33 
34 
35 #include "scip/def.h"
36 #include "scip/type_lp.h"
37 #include "scip/type_prop.h"
38 #include "scip/type_result.h"
39 #include "scip/type_retcode.h"
40 #include "scip/type_scip.h"
41 #include "scip/type_timing.h"
42 #include "scip/type_var.h"
43 
44 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
45  * this structure except the interface methods in scip.c.
46  * In optimized mode, the structure is included in scip.h, because some of the methods
47  * are implemented as defines for performance reasons (e.g. the numerical comparisons).
48  * Additionally, the internal "set.h" is included, such that the defines in set.h are
49  * available in optimized mode.
50  */
51 #ifdef NDEBUG
52 #include "scip/struct_scip.h"
53 #include "scip/struct_stat.h"
54 #include "scip/set.h"
55 #include "scip/tree.h"
56 #include "scip/misc.h"
57 #include "scip/var.h"
58 #include "scip/cons.h"
59 #include "scip/solve.h"
60 #include "scip/debug.h"
61 #endif
62 
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
67 /**@addtogroup PublicPropagatorMethods
68  *
69  * @{
70  */
71 
72 /** creates a propagator and includes it in SCIP.
73  *
74 
75  * @note method has all propagator callbacks as arguments and is thus changed every time a new
76  * callback is added in future releases; consider using SCIPincludePropBasic() and setter functions
77  * if you seek for a method which is less likely to change in future releases
78  */
79 extern
81  SCIP* scip, /**< SCIP data structure */
82  const char* name, /**< name of propagator */
83  const char* desc, /**< description of propagator */
84  int priority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
85  int freq, /**< frequency for calling propagator */
86  SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
87  SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagator should be executed */
88  int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */
89  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
90  SCIP_PRESOLTIMING presoltiming, /**< timing mask of the propagator's presolving method */
91  SCIP_DECL_PROPCOPY ((*propcopy)), /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
92  SCIP_DECL_PROPFREE ((*propfree)), /**< destructor of propagator */
93  SCIP_DECL_PROPINIT ((*propinit)), /**< initialize propagator */
94  SCIP_DECL_PROPEXIT ((*propexit)), /**< deinitialize propagator */
95  SCIP_DECL_PROPINITPRE ((*propinitpre)), /**< presolving initialization method of propagator */
96  SCIP_DECL_PROPEXITPRE ((*propexitpre)), /**< presolving deinitialization method of propagator */
97  SCIP_DECL_PROPINITSOL ((*propinitsol)), /**< solving process initialization method of propagator */
98  SCIP_DECL_PROPEXITSOL ((*propexitsol)), /**< solving process deinitialization method of propagator */
99  SCIP_DECL_PROPPRESOL ((*proppresol)), /**< presolving method */
100  SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
101  SCIP_DECL_PROPRESPROP ((*propresprop)), /**< propagation conflict resolving method */
102  SCIP_PROPDATA* propdata /**< propagator data */
103  );
104 
105 /** creates a propagator and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
106  * Optional callbacks can be set via specific setter functions, see SCIPsetPropInit(), SCIPsetPropExit(),
107  * SCIPsetPropCopy(), SCIPsetPropFree(), SCIPsetPropInitsol(), SCIPsetPropExitsol(),
108  * SCIPsetPropInitpre(), SCIPsetPropExitpre(), SCIPsetPropPresol(), and SCIPsetPropResprop().
109  *
110  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeProp() instead
111  */
112 extern
114  SCIP* scip, /**< SCIP data structure */
115  SCIP_PROP** propptr, /**< reference to a propagator pointer, or NULL */
116  const char* name, /**< name of propagator */
117  const char* desc, /**< description of propagator */
118  int priority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
119  int freq, /**< frequency for calling propagator */
120  SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
121  SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagators should be executed */
122  SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
123  SCIP_PROPDATA* propdata /**< propagator data */
124  );
125 
126 /** sets copy method of propagator */
127 extern
129  SCIP* scip, /**< SCIP data structure */
130  SCIP_PROP* prop, /**< propagator */
131  SCIP_DECL_PROPCOPY ((*propcopy)) /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
132  );
133 
134 /** sets destructor method of propagator */
135 extern
137  SCIP* scip, /**< SCIP data structure */
138  SCIP_PROP* prop, /**< propagator */
139  SCIP_DECL_PROPFREE ((*propfree)) /**< destructor of propagator */
140  );
141 
142 /** sets initialization method of propagator */
143 extern
145  SCIP* scip, /**< SCIP data structure */
146  SCIP_PROP* prop, /**< propagator */
147  SCIP_DECL_PROPINIT ((*propinit)) /**< initialize propagator */
148  );
149 
150 /** sets deinitialization method of propagator */
151 extern
153  SCIP* scip, /**< SCIP data structure */
154  SCIP_PROP* prop, /**< propagator */
155  SCIP_DECL_PROPEXIT ((*propexit)) /**< deinitialize propagator */
156  );
157 
158 /** sets solving process initialization method of propagator */
159 extern
161  SCIP* scip, /**< SCIP data structure */
162  SCIP_PROP* prop, /**< propagator */
163  SCIP_DECL_PROPINITSOL((*propinitsol)) /**< solving process initialization method of propagator */
164  );
165 
166 /** sets solving process deinitialization method of propagator */
167 extern
169  SCIP* scip, /**< SCIP data structure */
170  SCIP_PROP* prop, /**< propagator */
171  SCIP_DECL_PROPEXITSOL ((*propexitsol)) /**< solving process deinitialization method of propagator */
172  );
173 
174 /** sets preprocessing initialization method of propagator */
175 extern
177  SCIP* scip, /**< SCIP data structure */
178  SCIP_PROP* prop, /**< propagator */
179  SCIP_DECL_PROPINITPRE((*propinitpre)) /**< preprocessing initialization method of propagator */
180  );
181 
182 /** sets preprocessing deinitialization method of propagator */
183 extern
185  SCIP* scip, /**< SCIP data structure */
186  SCIP_PROP* prop, /**< propagator */
187  SCIP_DECL_PROPEXITPRE((*propexitpre)) /**< preprocessing deinitialization method of propagator */
188  );
189 
190 /** sets presolving method of propagator */
191 extern
193  SCIP* scip, /**< SCIP data structure */
194  SCIP_PROP* prop, /**< propagator */
195  SCIP_DECL_PROPPRESOL((*proppresol)), /**< presolving method of propagator */
196  int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */
197  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
198  SCIP_PRESOLTIMING presoltiming /**< timing mask of the propagator's presolving method */
199  );
200 
201 /** sets propagation conflict resolving callback of propagator */
202 extern
204  SCIP* scip, /**< SCIP data structure */
205  SCIP_PROP* prop, /**< propagator */
206  SCIP_DECL_PROPRESPROP ((*propresprop)) /**< propagation conflict resolving callback */
207  );
208 
209 /** returns the propagator of the given name, or NULL if not existing */
210 extern
212  SCIP* scip, /**< SCIP data structure */
213  const char* name /**< name of propagator */
214  );
215 
216 /** returns the array of currently available propagators */
217 extern
219  SCIP* scip /**< SCIP data structure */
220  );
221 
222 /** returns the number of currently available propagators */
223 extern
224 int SCIPgetNProps(
225  SCIP* scip /**< SCIP data structure */
226  );
227 
228 /** sets the priority of a propagator */
229 extern
231  SCIP* scip, /**< SCIP data structure */
232  SCIP_PROP* prop, /**< propagator */
233  int priority /**< new priority of the propagator */
234  );
235 
236 /** sets the presolving priority of a propagator */
237 extern
239  SCIP* scip, /**< SCIP data structure */
240  SCIP_PROP* prop, /**< propagator */
241  int presolpriority /**< new presol priority of the propagator */
242  );
243 
244 /* @} */
245 
246 #ifdef __cplusplus
247 }
248 #endif
249 
250 #endif
SCIP_RETCODE SCIPsetPropPresol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPPRESOL((*proppresol)), int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming)
Definition: scip_prop.c:349
internal methods for branch and bound tree
timing definitions for SCIP
SCIP_PROP * SCIPfindProp(SCIP *scip, const char *name)
Definition: scip_prop.c:399
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
#define SCIP_DECL_PROPEXITPRE(x)
Definition: type_prop.h:100
type definitions for return codes for SCIP methods
#define SCIP_DECL_PROPEXEC(x)
Definition: type_prop.h:203
type definitions for LP management
SCIP_RETCODE SCIPsetPropExitpre(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITPRE((*propexitpre)))
Definition: scip_prop.c:333
SCIP_PROP ** SCIPgetProps(SCIP *scip)
Definition: scip_prop.c:412
type definitions for SCIP&#39;s main datastructure
#define SCIP_DECL_PROPEXITSOL(x)
Definition: type_prop.h:127
#define SCIP_DECL_PROPCOPY(x)
Definition: type_prop.h:47
internal miscellaneous methods
internal methods for global SCIP settings
SCIP_RETCODE SCIPsetPropPriority(SCIP *scip, SCIP_PROP *prop, int priority)
Definition: scip_prop.c:436
unsigned int SCIP_PRESOLTIMING
Definition: type_timing.h:52
SCIP main data structure.
#define SCIP_DECL_PROPINITPRE(x)
Definition: type_prop.h:85
type definitions for problem variables
internal methods for problem variables
SCIP_RETCODE SCIPsetPropInit(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINIT((*propinit)))
Definition: scip_prop.c:253
#define SCIP_Bool
Definition: def.h:69
#define SCIP_DECL_PROPFREE(x)
Definition: type_prop.h:55
methods for debugging
#define SCIP_DECL_PROPINITSOL(x)
Definition: type_prop.h:115
SCIP_RETCODE SCIPsetPropCopy(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPCOPY((*propcopy)))
Definition: scip_prop.c:221
SCIP_RETCODE SCIPsetPropPresolPriority(SCIP *scip, SCIP_PROP *prop, int presolpriority)
Definition: scip_prop.c:451
datastructures for problem statistics
SCIP_RETCODE SCIPsetPropExitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
Definition: scip_prop.c:301
type definitions for propagators
SCIP_RETCODE SCIPsetPropResprop(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop)))
Definition: scip_prop.c:382
unsigned int SCIP_PROPTIMING
Definition: type_timing.h:66
internal methods for main solving loop and node processing
#define SCIP_DECL_PROPRESPROP(x)
Definition: type_prop.h:244
#define SCIP_DECL_PROPPRESOL(x)
Definition: type_prop.h:179
SCIP_RETCODE SCIPsetPropInitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINITSOL((*propinitsol)))
Definition: scip_prop.c:285
struct SCIP_PropData SCIP_PROPDATA
Definition: type_prop.h:38
result codes for SCIP callback methods
SCIP_RETCODE SCIPincludeProp(SCIP *scip, 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: scip_prop.c:132
internal methods for constraints and constraint handlers
SCIP_RETCODE SCIPsetPropFree(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
Definition: scip_prop.c:237
#define SCIP_DECL_PROPEXIT(x)
Definition: type_prop.h:71
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPsetPropInitpre(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINITPRE((*propinitpre)))
Definition: scip_prop.c:317
SCIP_RETCODE SCIPsetPropExit(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXIT((*propexit)))
Definition: scip_prop.c:269
int SCIPgetNProps(SCIP *scip)
Definition: scip_prop.c:425
#define SCIP_DECL_PROPINIT(x)
Definition: type_prop.h:63
SCIP_RETCODE SCIPincludePropBasic(SCIP *scip, SCIP_PROP **propptr, const char *name, const char *desc, int priority, int freq, SCIP_Bool delay, SCIP_PROPTIMING timingmask, SCIP_DECL_PROPEXEC((*propexec)), SCIP_PROPDATA *propdata)
Definition: scip_prop.c:184