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