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-2024 Zuse Institute Berlin (ZIB) */
7 /* */
8 /* Licensed under the Apache License, Version 2.0 (the "License"); */
9 /* you may not use this file except in compliance with the License. */
10 /* You may obtain a copy of the License at */
11 /* */
12 /* http://www.apache.org/licenses/LICENSE-2.0 */
13 /* */
14 /* Unless required by applicable law or agreed to in writing, software */
15 /* distributed under the License is distributed on an "AS IS" BASIS, */
16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17 /* See the License for the specific language governing permissions and */
18 /* limitations under the License. */
19 /* */
20 /* You should have received a copy of the Apache-2.0 license */
21 /* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22 /* */
23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24 
25 /**@file scip_prop.h
26  * @ingroup PUBLICCOREAPI
27  * @brief public methods for propagator plugins
28  * @author Tobias Achterberg
29  * @author Timo Berthold
30  * @author Thorsten Koch
31  * @author Alexander Martin
32  * @author Marc Pfetsch
33  * @author Kati Wolter
34  * @author Gregor Hendel
35  * @author Leona Gottwald
36  */
37 
38 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
39 
40 #ifndef __SCIP_SCIP_PROP_H__
41 #define __SCIP_SCIP_PROP_H__
42 
43 
44 #include "scip/def.h"
45 #include "scip/type_lp.h"
46 #include "scip/type_prop.h"
47 #include "scip/type_result.h"
48 #include "scip/type_retcode.h"
49 #include "scip/type_scip.h"
50 #include "scip/type_timing.h"
51 #include "scip/type_var.h"
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 /**@addtogroup PublicPropagatorMethods
58  *
59  * @{
60  */
61 
62 /** creates a propagator and includes it in SCIP.
63  *
64 
65  * @note method has all propagator callbacks as arguments and is thus changed every time a new
66  * callback is added in future releases; consider using SCIPincludePropBasic() and setter functions
67  * if you seek for a method which is less likely to change in future releases
68  */
69 SCIP_EXPORT
71  SCIP* scip, /**< SCIP data structure */
72  const char* name, /**< name of propagator */
73  const char* desc, /**< description of propagator */
74  int priority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
75  int freq, /**< frequency for calling propagator */
76  SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
77  SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagator should be executed */
78  int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */
79  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
80  SCIP_PRESOLTIMING presoltiming, /**< timing mask of the propagator's presolving method */
81  SCIP_DECL_PROPCOPY ((*propcopy)), /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
82  SCIP_DECL_PROPFREE ((*propfree)), /**< destructor of propagator */
83  SCIP_DECL_PROPINIT ((*propinit)), /**< initialize propagator */
84  SCIP_DECL_PROPEXIT ((*propexit)), /**< deinitialize propagator */
85  SCIP_DECL_PROPINITPRE ((*propinitpre)), /**< presolving initialization method of propagator */
86  SCIP_DECL_PROPEXITPRE ((*propexitpre)), /**< presolving deinitialization method of propagator */
87  SCIP_DECL_PROPINITSOL ((*propinitsol)), /**< solving process initialization method of propagator */
88  SCIP_DECL_PROPEXITSOL ((*propexitsol)), /**< solving process deinitialization method of propagator */
89  SCIP_DECL_PROPPRESOL ((*proppresol)), /**< presolving method */
90  SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
91  SCIP_DECL_PROPRESPROP ((*propresprop)), /**< propagation conflict resolving method */
92  SCIP_PROPDATA* propdata /**< propagator data */
93  );
94 
95 /** creates a propagator and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
96  * Optional callbacks can be set via specific setter functions, see SCIPsetPropInit(), SCIPsetPropExit(),
97  * SCIPsetPropCopy(), SCIPsetPropFree(), SCIPsetPropInitsol(), SCIPsetPropExitsol(),
98  * SCIPsetPropInitpre(), SCIPsetPropExitpre(), SCIPsetPropPresol(), and SCIPsetPropResprop().
99  *
100  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeProp() instead
101  */
102 SCIP_EXPORT
104  SCIP* scip, /**< SCIP data structure */
105  SCIP_PROP** propptr, /**< reference to a propagator pointer, or NULL */
106  const char* name, /**< name of propagator */
107  const char* desc, /**< description of propagator */
108  int priority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
109  int freq, /**< frequency for calling propagator */
110  SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
111  SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagators should be executed */
112  SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
113  SCIP_PROPDATA* propdata /**< propagator data */
114  );
115 
116 /** sets copy method of propagator */
117 SCIP_EXPORT
119  SCIP* scip, /**< SCIP data structure */
120  SCIP_PROP* prop, /**< propagator */
121  SCIP_DECL_PROPCOPY ((*propcopy)) /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
122  );
123 
124 /** sets destructor method of propagator */
125 SCIP_EXPORT
127  SCIP* scip, /**< SCIP data structure */
128  SCIP_PROP* prop, /**< propagator */
129  SCIP_DECL_PROPFREE ((*propfree)) /**< destructor of propagator */
130  );
131 
132 /** sets initialization method of propagator */
133 SCIP_EXPORT
135  SCIP* scip, /**< SCIP data structure */
136  SCIP_PROP* prop, /**< propagator */
137  SCIP_DECL_PROPINIT ((*propinit)) /**< initialize propagator */
138  );
139 
140 /** sets deinitialization method of propagator */
141 SCIP_EXPORT
143  SCIP* scip, /**< SCIP data structure */
144  SCIP_PROP* prop, /**< propagator */
145  SCIP_DECL_PROPEXIT ((*propexit)) /**< deinitialize propagator */
146  );
147 
148 /** sets solving process initialization method of propagator */
149 SCIP_EXPORT
151  SCIP* scip, /**< SCIP data structure */
152  SCIP_PROP* prop, /**< propagator */
153  SCIP_DECL_PROPINITSOL((*propinitsol)) /**< solving process initialization method of propagator */
154  );
155 
156 /** sets solving process deinitialization method of propagator */
157 SCIP_EXPORT
159  SCIP* scip, /**< SCIP data structure */
160  SCIP_PROP* prop, /**< propagator */
161  SCIP_DECL_PROPEXITSOL ((*propexitsol)) /**< solving process deinitialization method of propagator */
162  );
163 
164 /** sets preprocessing initialization method of propagator */
165 SCIP_EXPORT
167  SCIP* scip, /**< SCIP data structure */
168  SCIP_PROP* prop, /**< propagator */
169  SCIP_DECL_PROPINITPRE((*propinitpre)) /**< preprocessing initialization method of propagator */
170  );
171 
172 /** sets preprocessing deinitialization method of propagator */
173 SCIP_EXPORT
175  SCIP* scip, /**< SCIP data structure */
176  SCIP_PROP* prop, /**< propagator */
177  SCIP_DECL_PROPEXITPRE((*propexitpre)) /**< preprocessing deinitialization method of propagator */
178  );
179 
180 /** sets presolving method of propagator */
181 SCIP_EXPORT
183  SCIP* scip, /**< SCIP data structure */
184  SCIP_PROP* prop, /**< propagator */
185  SCIP_DECL_PROPPRESOL((*proppresol)), /**< presolving method of propagator */
186  int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */
187  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
188  SCIP_PRESOLTIMING presoltiming /**< timing mask of the propagator's presolving method */
189  );
190 
191 /** sets propagation conflict resolving callback of propagator */
192 SCIP_EXPORT
194  SCIP* scip, /**< SCIP data structure */
195  SCIP_PROP* prop, /**< propagator */
196  SCIP_DECL_PROPRESPROP ((*propresprop)) /**< propagation conflict resolving callback */
197  );
198 
199 /** returns the propagator of the given name, or NULL if not existing */
200 SCIP_EXPORT
202  SCIP* scip, /**< SCIP data structure */
203  const char* name /**< name of propagator */
204  );
205 
206 /** returns the array of currently available propagators */
207 SCIP_EXPORT
209  SCIP* scip /**< SCIP data structure */
210  );
211 
212 /** returns the number of currently available propagators */
213 SCIP_EXPORT
214 int SCIPgetNProps(
215  SCIP* scip /**< SCIP data structure */
216  );
217 
218 /** sets the priority of a propagator */
219 SCIP_EXPORT
221  SCIP* scip, /**< SCIP data structure */
222  SCIP_PROP* prop, /**< propagator */
223  int priority /**< new priority of the propagator */
224  );
225 
226 /** sets the presolving priority of a propagator */
227 SCIP_EXPORT
229  SCIP* scip, /**< SCIP data structure */
230  SCIP_PROP* prop, /**< propagator */
231  int presolpriority /**< new presol priority of the propagator */
232  );
233 
234 /** @} */
235 
236 #ifdef __cplusplus
237 }
238 #endif
239 
240 #endif
SCIP_RETCODE SCIPsetPropPresol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPPRESOL((*proppresol)), int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming)
Definition: scip_prop.c:279
timing definitions for SCIP
SCIP_PROP * SCIPfindProp(SCIP *scip, const char *name)
Definition: scip_prop.c:329
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
#define SCIP_DECL_PROPEXITPRE(x)
Definition: type_prop.h:114
type definitions for return codes for SCIP methods
#define SCIP_DECL_PROPEXEC(x)
Definition: type_prop.h:217
type definitions for LP management
SCIP_RETCODE SCIPsetPropExitpre(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITPRE((*propexitpre)))
Definition: scip_prop.c:263
SCIP_PROP ** SCIPgetProps(SCIP *scip)
Definition: scip_prop.c:342
type definitions for SCIP&#39;s main datastructure
#define SCIP_DECL_PROPEXITSOL(x)
Definition: type_prop.h:141
#define SCIP_DECL_PROPCOPY(x)
Definition: type_prop.h:61
SCIP_RETCODE SCIPsetPropPriority(SCIP *scip, SCIP_PROP *prop, int priority)
Definition: scip_prop.c:366
unsigned int SCIP_PRESOLTIMING
Definition: type_timing.h:61
#define SCIP_DECL_PROPINITPRE(x)
Definition: type_prop.h:99
type definitions for problem variables
SCIP_RETCODE SCIPsetPropInit(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINIT((*propinit)))
Definition: scip_prop.c:183
#define SCIP_Bool
Definition: def.h:91
#define SCIP_DECL_PROPFREE(x)
Definition: type_prop.h:69
#define SCIP_DECL_PROPINITSOL(x)
Definition: type_prop.h:129
SCIP_RETCODE SCIPsetPropCopy(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPCOPY((*propcopy)))
Definition: scip_prop.c:151
SCIP_RETCODE SCIPsetPropPresolPriority(SCIP *scip, SCIP_PROP *prop, int presolpriority)
Definition: scip_prop.c:381
SCIP_RETCODE SCIPsetPropExitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
Definition: scip_prop.c:231
type definitions for propagators
SCIP_RETCODE SCIPsetPropResprop(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop)))
Definition: scip_prop.c:312
unsigned int SCIP_PROPTIMING
Definition: type_timing.h:75
#define SCIP_DECL_PROPRESPROP(x)
Definition: type_prop.h:258
#define SCIP_DECL_PROPPRESOL(x)
Definition: type_prop.h:193
SCIP_RETCODE SCIPsetPropInitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINITSOL((*propinitsol)))
Definition: scip_prop.c:215
struct SCIP_PropData SCIP_PROPDATA
Definition: type_prop.h:52
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:62
SCIP_RETCODE SCIPsetPropFree(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
Definition: scip_prop.c:167
#define SCIP_DECL_PROPEXIT(x)
Definition: type_prop.h:85
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:247
SCIP_RETCODE SCIPsetPropExit(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXIT((*propexit)))
Definition: scip_prop.c:199
int SCIPgetNProps(SCIP *scip)
Definition: scip_prop.c:355
#define SCIP_DECL_PROPINIT(x)
Definition: type_prop.h:77
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:114