Scippy

SCIP

Solving Constraint Integer Programs

scip_presol.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_presol.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for presolving 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_PRESOL_H__
32 #define __SCIP_SCIP_PRESOL_H__
33 
34 
35 #include "scip/def.h"
36 #include "scip/type_presol.h"
37 #include "scip/type_result.h"
38 #include "scip/type_retcode.h"
39 #include "scip/type_scip.h"
40 #include "scip/type_timing.h"
41 
42 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
43  * this structure except the interface methods in scip.c.
44  * In optimized mode, the structure is included in scip.h, because some of the methods
45  * are implemented as defines for performance reasons (e.g. the numerical comparisons).
46  * Additionally, the internal "set.h" is included, such that the defines in set.h are
47  * available in optimized mode.
48  */
49 #ifdef NDEBUG
50 #include "scip/struct_scip.h"
51 #include "scip/struct_stat.h"
52 #include "scip/set.h"
53 #include "scip/tree.h"
54 #include "scip/misc.h"
55 #include "scip/var.h"
56 #include "scip/cons.h"
57 #include "scip/solve.h"
58 #include "scip/debug.h"
59 #endif
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
65 /**@addtogroup PublicPresolverMethods
66  *
67  * @{
68  */
69 
70 /** creates a presolver and includes it in SCIP
71  *
72  * @note method has all presolver callbacks as arguments and is thus changed every time a new
73  * callback is added
74  * in future releases; consider using SCIPincludePresolBasic() and setter functions
75  * if you seek for a method which is less likely to change in future releases
76  */
77 extern
79  SCIP* scip, /**< SCIP data structure */
80  const char* name, /**< name of presolver */
81  const char* desc, /**< description of presolver */
82  int priority, /**< priority of the presolver (>= 0: before, < 0: after constraint handlers) */
83  int maxrounds, /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */
84  SCIP_PRESOLTIMING timing, /**< timing mask of the presolver */
85  SCIP_DECL_PRESOLCOPY ((*presolcopy)), /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */
86  SCIP_DECL_PRESOLFREE ((*presolfree)), /**< destructor of presolver to free user data (called when SCIP is exiting) */
87  SCIP_DECL_PRESOLINIT ((*presolinit)), /**< initialization method of presolver (called after problem was transformed) */
88  SCIP_DECL_PRESOLEXIT ((*presolexit)), /**< deinitialization method of presolver (called before transformed problem is freed) */
89  SCIP_DECL_PRESOLINITPRE((*presolinitpre)),/**< presolving initialization method of presolver (called when presolving is about to begin) */
90  SCIP_DECL_PRESOLEXITPRE((*presolexitpre)),/**< presolving deinitialization method of presolver (called after presolving has been finished) */
91  SCIP_DECL_PRESOLEXEC ((*presolexec)), /**< execution method of presolver */
92  SCIP_PRESOLDATA* presoldata /**< presolver data */
93  );
94 
95 /** Creates a presolver and includes it in SCIP with its fundamental callback. All non-fundamental (or optional)
96  * callbacks as, e.g., init and exit callbacks, will be set to NULL. Optional callbacks can be set via specific setter
97  * functions. These are SCIPsetPresolCopy(), SCIPsetPresolFree(), SCIPsetPresolInit(), SCIPsetPresolExit(),
98  * SCIPsetPresolInitpre(), and SCIPsetPresolExitPre().
99  *
100  * @note if you want to set all callbacks with a single method call, consider using SCIPincludePresol() instead
101  */
102 extern
104  SCIP* scip, /**< SCIP data structure */
105  SCIP_PRESOL** presolptr, /**< reference to presolver, or NULL */
106  const char* name, /**< name of presolver */
107  const char* desc, /**< description of presolver */
108  int priority, /**< priority of the presolver (>= 0: before, < 0: after constraint handlers) */
109  int maxrounds, /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */
110  SCIP_PRESOLTIMING timing, /**< timing mask of the presolver */
111  SCIP_DECL_PRESOLEXEC ((*presolexec)), /**< execution method of presolver */
112  SCIP_PRESOLDATA* presoldata /**< presolver data */
113  );
114 
115 /** sets copy method of presolver */
116 extern
118  SCIP* scip, /**< SCIP data structure */
119  SCIP_PRESOL* presol, /**< presolver */
120  SCIP_DECL_PRESOLCOPY ((*presolcopy)) /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */
121  );
122 
123 /** sets destructor method of presolver */
124 extern
126  SCIP* scip, /**< SCIP data structure */
127  SCIP_PRESOL* presol, /**< presolver */
128  SCIP_DECL_PRESOLFREE ((*presolfree)) /**< destructor of presolver */
129  );
130 
131 /** sets initialization method of presolver */
132 extern
134  SCIP* scip, /**< SCIP data structure */
135  SCIP_PRESOL* presol, /**< presolver */
136  SCIP_DECL_PRESOLINIT ((*presolinit)) /**< initialize presolver */
137  );
138 
139 /** sets deinitialization method of presolver */
140 extern
142  SCIP* scip, /**< SCIP data structure */
143  SCIP_PRESOL* presol, /**< presolver */
144  SCIP_DECL_PRESOLEXIT ((*presolexit)) /**< deinitialize presolver */
145  );
146 
147 /** sets solving process initialization method of presolver */
148 extern
150  SCIP* scip, /**< SCIP data structure */
151  SCIP_PRESOL* presol, /**< presolver */
152  SCIP_DECL_PRESOLINITPRE ((*presolinitpre))/**< solving process initialization method of presolver */
153  );
154 
155 /** sets solving process deinitialization method of presolver */
157  SCIP* scip, /**< SCIP data structure */
158  SCIP_PRESOL* presol, /**< presolver */
159  SCIP_DECL_PRESOLEXITPRE ((*presolexitpre))/**< solving process deinitialization method of presolver */
160  );
161 
162 /** returns the presolver of the given name, or NULL if not existing */
163 extern
165  SCIP* scip, /**< SCIP data structure */
166  const char* name /**< name of presolver */
167  );
168 
169 /** returns the array of currently available presolvers */
170 extern
172  SCIP* scip /**< SCIP data structure */
173  );
174 
175 /** returns the number of currently available presolvers */
176 extern
177 int SCIPgetNPresols(
178  SCIP* scip /**< SCIP data structure */
179  );
180 
181 /** sets the priority of a presolver */
182 extern
184  SCIP* scip, /**< SCIP data structure */
185  SCIP_PRESOL* presol, /**< presolver */
186  int priority /**< new priority of the presolver */
187  );
188 
189 /* @} */
190 
191 #ifdef __cplusplus
192 }
193 #endif
194 
195 #endif
SCIP_RETCODE SCIPincludePresolBasic(SCIP *scip, SCIP_PRESOL **presolptr, const char *name, const char *desc, int priority, int maxrounds, SCIP_PRESOLTIMING timing, SCIP_DECL_PRESOLEXEC((*presolexec)), SCIP_PRESOLDATA *presoldata)
Definition: scip_presol.c:174
struct SCIP_PresolData SCIP_PRESOLDATA
Definition: type_presol.h:37
SCIP_RETCODE SCIPsetPresolFree(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLFREE((*presolfree)))
Definition: scip_presol.c:225
internal methods for branch and bound tree
timing definitions for SCIP
SCIP_RETCODE SCIPsetPresolExit(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXIT((*presolexit)))
Definition: scip_presol.c:257
#define SCIP_DECL_PRESOLINITPRE(x)
Definition: type_presol.h:84
#define SCIP_DECL_PRESOLCOPY(x)
Definition: type_presol.h:46
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
type definitions for return codes for SCIP methods
type definitions for presolvers
int SCIPgetNPresols(SCIP *scip)
Definition: scip_presol.c:331
#define SCIP_DECL_PRESOLEXEC(x)
Definition: type_presol.h:153
#define SCIP_DECL_PRESOLFREE(x)
Definition: type_presol.h:54
#define SCIP_DECL_PRESOLEXIT(x)
Definition: type_presol.h:70
type definitions for SCIP&#39;s main datastructure
SCIP_RETCODE SCIPsetPresolInit(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLINIT((*presolinit)))
Definition: scip_presol.c:241
SCIP_PRESOL * SCIPfindPresol(SCIP *scip, const char *name)
Definition: scip_presol.c:305
SCIP_RETCODE SCIPincludePresol(SCIP *scip, const char *name, const char *desc, int priority, int maxrounds, SCIP_PRESOLTIMING timing, SCIP_DECL_PRESOLCOPY((*presolcopy)), SCIP_DECL_PRESOLFREE((*presolfree)), SCIP_DECL_PRESOLINIT((*presolinit)), SCIP_DECL_PRESOLEXIT((*presolexit)), SCIP_DECL_PRESOLINITPRE((*presolinitpre)), SCIP_DECL_PRESOLEXITPRE((*presolexitpre)), SCIP_DECL_PRESOLEXEC((*presolexec)), SCIP_PRESOLDATA *presoldata)
Definition: scip_presol.c:131
internal miscellaneous methods
SCIP_RETCODE SCIPsetPresolPriority(SCIP *scip, SCIP_PRESOL *presol, int priority)
Definition: scip_presol.c:342
internal methods for global SCIP settings
unsigned int SCIP_PRESOLTIMING
Definition: type_timing.h:52
SCIP main data structure.
SCIP_RETCODE SCIPsetPresolInitpre(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLINITPRE((*presolinitpre)))
Definition: scip_presol.c:273
internal methods for problem variables
#define SCIP_DECL_PRESOLEXITPRE(x)
Definition: type_presol.h:102
#define SCIP_DECL_PRESOLINIT(x)
Definition: type_presol.h:62
methods for debugging
datastructures for problem statistics
SCIP_PRESOL ** SCIPgetPresols(SCIP *scip)
Definition: scip_presol.c:318
internal methods for main solving loop and node processing
SCIP_RETCODE SCIPsetPresolCopy(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLCOPY((*presolcopy)))
Definition: scip_presol.c:209
result codes for SCIP callback methods
internal methods for constraints and constraint handlers
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPsetPresolExitpre(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXITPRE((*presolexitpre)))
Definition: scip_presol.c:289