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 2002-2022 Zuse Institute Berlin */
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_presol.h
26  * @ingroup PUBLICCOREAPI
27  * @brief public methods for presolving 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_PRESOL_H__
41 #define __SCIP_SCIP_PRESOL_H__
42 
43 
44 #include "scip/def.h"
45 #include "scip/type_presol.h"
46 #include "scip/type_result.h"
47 #include "scip/type_retcode.h"
48 #include "scip/type_scip.h"
49 #include "scip/type_timing.h"
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 /**@addtogroup PublicPresolverMethods
56  *
57  * @{
58  */
59 
60 /** creates a presolver and includes it in SCIP
61  *
62  * @note method has all presolver callbacks as arguments and is thus changed every time a new
63  * callback is added
64  * in future releases; consider using SCIPincludePresolBasic() and setter functions
65  * if you seek for a method which is less likely to change in future releases
66  */
67 SCIP_EXPORT
69  SCIP* scip, /**< SCIP data structure */
70  const char* name, /**< name of presolver */
71  const char* desc, /**< description of presolver */
72  int priority, /**< priority of the presolver (>= 0: before, < 0: after constraint handlers) */
73  int maxrounds, /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */
74  SCIP_PRESOLTIMING timing, /**< timing mask of the presolver */
75  SCIP_DECL_PRESOLCOPY ((*presolcopy)), /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */
76  SCIP_DECL_PRESOLFREE ((*presolfree)), /**< destructor of presolver to free user data (called when SCIP is exiting) */
77  SCIP_DECL_PRESOLINIT ((*presolinit)), /**< initialization method of presolver (called after problem was transformed) */
78  SCIP_DECL_PRESOLEXIT ((*presolexit)), /**< deinitialization method of presolver (called before transformed problem is freed) */
79  SCIP_DECL_PRESOLINITPRE((*presolinitpre)),/**< presolving initialization method of presolver (called when presolving is about to begin) */
80  SCIP_DECL_PRESOLEXITPRE((*presolexitpre)),/**< presolving deinitialization method of presolver (called after presolving has been finished) */
81  SCIP_DECL_PRESOLEXEC ((*presolexec)), /**< execution method of presolver */
82  SCIP_PRESOLDATA* presoldata /**< presolver data */
83  );
84 
85 /** Creates a presolver and includes it in SCIP with its fundamental callback. All non-fundamental (or optional)
86  * callbacks as, e.g., init and exit callbacks, will be set to NULL. Optional callbacks can be set via specific setter
87  * functions. These are SCIPsetPresolCopy(), SCIPsetPresolFree(), SCIPsetPresolInit(), SCIPsetPresolExit(),
88  * SCIPsetPresolInitpre(), and SCIPsetPresolExitPre().
89  *
90  * @note if you want to set all callbacks with a single method call, consider using SCIPincludePresol() instead
91  */
92 SCIP_EXPORT
94  SCIP* scip, /**< SCIP data structure */
95  SCIP_PRESOL** presolptr, /**< reference to presolver, or NULL */
96  const char* name, /**< name of presolver */
97  const char* desc, /**< description of presolver */
98  int priority, /**< priority of the presolver (>= 0: before, < 0: after constraint handlers) */
99  int maxrounds, /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */
100  SCIP_PRESOLTIMING timing, /**< timing mask of the presolver */
101  SCIP_DECL_PRESOLEXEC ((*presolexec)), /**< execution method of presolver */
102  SCIP_PRESOLDATA* presoldata /**< presolver data */
103  );
104 
105 /** sets copy method of presolver */
106 SCIP_EXPORT
108  SCIP* scip, /**< SCIP data structure */
109  SCIP_PRESOL* presol, /**< presolver */
110  SCIP_DECL_PRESOLCOPY ((*presolcopy)) /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */
111  );
112 
113 /** sets destructor method of presolver */
114 SCIP_EXPORT
116  SCIP* scip, /**< SCIP data structure */
117  SCIP_PRESOL* presol, /**< presolver */
118  SCIP_DECL_PRESOLFREE ((*presolfree)) /**< destructor of presolver */
119  );
120 
121 /** sets initialization method of presolver */
122 SCIP_EXPORT
124  SCIP* scip, /**< SCIP data structure */
125  SCIP_PRESOL* presol, /**< presolver */
126  SCIP_DECL_PRESOLINIT ((*presolinit)) /**< initialize presolver */
127  );
128 
129 /** sets deinitialization method of presolver */
130 SCIP_EXPORT
132  SCIP* scip, /**< SCIP data structure */
133  SCIP_PRESOL* presol, /**< presolver */
134  SCIP_DECL_PRESOLEXIT ((*presolexit)) /**< deinitialize presolver */
135  );
136 
137 /** sets solving process initialization method of presolver */
138 SCIP_EXPORT
140  SCIP* scip, /**< SCIP data structure */
141  SCIP_PRESOL* presol, /**< presolver */
142  SCIP_DECL_PRESOLINITPRE ((*presolinitpre))/**< solving process initialization method of presolver */
143  );
144 
145 /** sets solving process deinitialization method of presolver */
147  SCIP* scip, /**< SCIP data structure */
148  SCIP_PRESOL* presol, /**< presolver */
149  SCIP_DECL_PRESOLEXITPRE ((*presolexitpre))/**< solving process deinitialization method of presolver */
150  );
151 
152 /** returns the presolver of the given name, or NULL if not existing */
153 SCIP_EXPORT
155  SCIP* scip, /**< SCIP data structure */
156  const char* name /**< name of presolver */
157  );
158 
159 /** returns the array of currently available presolvers */
160 SCIP_EXPORT
162  SCIP* scip /**< SCIP data structure */
163  );
164 
165 /** returns the number of currently available presolvers */
166 SCIP_EXPORT
167 int SCIPgetNPresols(
168  SCIP* scip /**< SCIP data structure */
169  );
170 
171 /** sets the priority of a presolver */
172 SCIP_EXPORT
174  SCIP* scip, /**< SCIP data structure */
175  SCIP_PRESOL* presol, /**< presolver */
176  int priority /**< new priority of the presolver */
177  );
178 
179 /** returns the number of presolve rounds (current or last presolve) */
180 SCIP_EXPORT
182  SCIP* scip /**< SCIP data structure */
183 );
184 
185 /** @} */
186 
187 #ifdef __cplusplus
188 }
189 #endif
190 
191 #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:105
struct SCIP_PresolData SCIP_PRESOLDATA
Definition: type_presol.h:51
SCIP_RETCODE SCIPsetPresolFree(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLFREE((*presolfree)))
Definition: scip_presol.c:156
timing definitions for SCIP
SCIP_RETCODE SCIPsetPresolExit(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXIT((*presolexit)))
Definition: scip_presol.c:188
#define SCIP_DECL_PRESOLINITPRE(x)
Definition: type_presol.h:98
#define SCIP_DECL_PRESOLCOPY(x)
Definition: type_presol.h:60
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for return codes for SCIP methods
type definitions for presolvers
int SCIPgetNPresols(SCIP *scip)
Definition: scip_presol.c:262
#define SCIP_DECL_PRESOLEXEC(x)
Definition: type_presol.h:167
#define SCIP_DECL_PRESOLFREE(x)
Definition: type_presol.h:68
#define SCIP_DECL_PRESOLEXIT(x)
Definition: type_presol.h:84
type definitions for SCIP&#39;s main datastructure
SCIP_RETCODE SCIPsetPresolInit(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLINIT((*presolinit)))
Definition: scip_presol.c:172
SCIP_PRESOL * SCIPfindPresol(SCIP *scip, const char *name)
Definition: scip_presol.c:236
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:62
SCIP_RETCODE SCIPsetPresolPriority(SCIP *scip, SCIP_PRESOL *presol, int priority)
Definition: scip_presol.c:273
unsigned int SCIP_PRESOLTIMING
Definition: type_timing.h:61
SCIP_RETCODE SCIPsetPresolInitpre(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLINITPRE((*presolinitpre)))
Definition: scip_presol.c:204
#define SCIP_DECL_PRESOLEXITPRE(x)
Definition: type_presol.h:116
#define SCIP_DECL_PRESOLINIT(x)
Definition: type_presol.h:76
int SCIPgetNPresolRounds(SCIP *scip)
Definition: scip_presol.c:288
SCIP_PRESOL ** SCIPgetPresols(SCIP *scip)
Definition: scip_presol.c:249
SCIP_RETCODE SCIPsetPresolCopy(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLCOPY((*presolcopy)))
Definition: scip_presol.c:140
result codes for SCIP callback methods
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:220