Scippy

SCIP

Solving Constraint Integer Programs

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-2017 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 email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file presol.h
17  * @ingroup INTERNALAPI
18  * @brief internal methods for presolvers
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_PRESOL_H__
25 #define __SCIP_PRESOL_H__
26 
27 
28 #include "scip/def.h"
29 #include "blockmemshell/memory.h"
30 #include "scip/type_retcode.h"
31 #include "scip/type_result.h"
32 #include "scip/type_set.h"
33 #include "scip/type_presol.h"
34 #include "scip/pub_presol.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /** copies the given presolver to a new scip */
41 extern
43  SCIP_PRESOL* presol, /**< presolver */
44  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
45  );
46 
47 /** creates a presolver */
48 extern
50  SCIP_PRESOL** presol, /**< pointer to store presolver */
51  SCIP_SET* set, /**< global SCIP settings */
52  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
53  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
54  const char* name, /**< name of presolver */
55  const char* desc, /**< description of presolver */
56  int priority, /**< priority of the presolver (>= 0: before, < 0: after constraint handlers) */
57  int maxrounds, /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */
58  SCIP_PRESOLTIMING timing, /**< timing mask of the presolver */
59  SCIP_DECL_PRESOLCOPY ((*presolcopy)), /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */
60  SCIP_DECL_PRESOLFREE ((*presolfree)), /**< destructor of presolver to free user data (called when SCIP is exiting) */
61  SCIP_DECL_PRESOLINIT ((*presolinit)), /**< initialization method of presolver (called after problem was transformed) */
62  SCIP_DECL_PRESOLEXIT ((*presolexit)), /**< deinitialization method of presolver (called before transformed problem is freed) */
63  SCIP_DECL_PRESOLINITPRE((*presolinitpre)),/**< presolving initialization method of presolver (called when presolving is about to begin) */
64  SCIP_DECL_PRESOLEXITPRE((*presolexitpre)),/**< presolving deinitialization method of presolver (called after presolving has been finished) */
65  SCIP_DECL_PRESOLEXEC ((*presolexec)), /**< execution method of presolver */
66  SCIP_PRESOLDATA* presoldata /**< presolver data */
67  );
68 
69 /** frees memory of presolver */
70 extern
72  SCIP_PRESOL** presol, /**< pointer to presolver data structure */
73  SCIP_SET* set /**< global SCIP settings */
74  );
75 
76 /** initializes presolver */
77 extern
79  SCIP_PRESOL* presol, /**< presolver */
80  SCIP_SET* set /**< global SCIP settings */
81  );
82 
83 /** deinitializes presolver */
84 extern
86  SCIP_PRESOL* presol, /**< presolver */
87  SCIP_SET* set /**< global SCIP settings */
88  );
89 
90 /** informs presolver that the presolving process is being started */
91 extern
93  SCIP_PRESOL* presol, /**< presolver */
94  SCIP_SET* set /**< global SCIP settings */
95  );
96 
97 /** informs presolver that the presolving process is finished */
98 extern
100  SCIP_PRESOL* presol, /**< presolver */
101  SCIP_SET* set /**< global SCIP settings */
102  );
103 
104 /** executes presolver */
105 extern
107  SCIP_PRESOL* presol, /**< presolver */
108  SCIP_SET* set, /**< global SCIP settings */
109  SCIP_PRESOLTIMING timing, /**< current presolving timing */
110  int nrounds, /**< number of presolving rounds already done */
111  int* nfixedvars, /**< pointer to total number of variables fixed of all presolvers */
112  int* naggrvars, /**< pointer to total number of variables aggregated of all presolvers */
113  int* nchgvartypes, /**< pointer to total number of variable type changes of all presolvers */
114  int* nchgbds, /**< pointer to total number of variable bounds tightened of all presolvers */
115  int* naddholes, /**< pointer to total number of domain holes added of all presolvers */
116  int* ndelconss, /**< pointer to total number of deleted constraints of all presolvers */
117  int* naddconss, /**< pointer to total number of added constraints of all presolvers */
118  int* nupgdconss, /**< pointer to total number of upgraded constraints of all presolvers */
119  int* nchgcoefs, /**< pointer to total number of changed coefficients of all presolvers */
120  int* nchgsides, /**< pointer to total number of changed left/right hand sides of all presolvers */
121  SCIP_RESULT* result /**< pointer to store the result of the callback method */
122  );
123 
124 /** sets priority of presolver */
125 extern
127  SCIP_PRESOL* presol, /**< presolver */
128  SCIP_SET* set, /**< global SCIP settings */
129  int priority /**< new priority of the presolver */
130  );
131 
132 /** sets copy method of presolver */
133 extern
134 void SCIPpresolSetCopy(
135  SCIP_PRESOL* presol, /**< presolver */
136  SCIP_DECL_PRESOLCOPY ((*presolcopy)) /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */
137  );
138 
139 /** sets destructor method of presolver */
140 extern
141 void SCIPpresolSetFree(
142  SCIP_PRESOL* presol, /**< presolver */
143  SCIP_DECL_PRESOLFREE ((*presolfree)) /**< destructor of presolver */
144  );
145 
146 /** sets initialization method of presolver */
147 extern
148 void SCIPpresolSetInit(
149  SCIP_PRESOL* presol, /**< presolver */
150  SCIP_DECL_PRESOLINIT ((*presolinit)) /**< initialize presolver */
151  );
152 
153 /** sets deinitialization method of presolver */
154 extern
155 void SCIPpresolSetExit(
156  SCIP_PRESOL* presol, /**< presolver */
157  SCIP_DECL_PRESOLEXIT ((*presolexit)) /**< deinitialize presolver */
158  );
159 
160 /** sets solving process initialization method of presolver */
161 extern
163  SCIP_PRESOL* presol, /**< presolver */
164  SCIP_DECL_PRESOLINITPRE ((*presolinitpre))/**< solving process initialization method of presolver */
165  );
166 
167 /** sets solving process deinitialization method of presolver */
168 extern
170  SCIP_PRESOL* presol, /**< presolver */
171  SCIP_DECL_PRESOLEXITPRE ((*presolexitpre))/**< solving process deinitialization method of presolver */
172  );
173 
174 /** enables or disables all clocks of \p presol, depending on the value of the flag */
175 extern
177  SCIP_PRESOL* presol, /**< the presolver for which all clocks should be enabled or disabled */
178  SCIP_Bool enable /**< should the clocks of the presolver be enabled? */
179  );
180 
181 #ifdef __cplusplus
182 }
183 #endif
184 
185 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
void SCIPpresolSetExitpre(SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXITPRE((*presolexitpre)))
Definition: presol.c:542
struct SCIP_PresolData SCIP_PRESOLDATA
Definition: type_presol.h:37
SCIP_RETCODE SCIPpresolFree(SCIP_PRESOL **presol, SCIP_SET *set)
Definition: presol.c:167
#define SCIP_DECL_PRESOLINITPRE(x)
Definition: type_presol.h:84
void SCIPpresolSetPriority(SCIP_PRESOL *presol, SCIP_SET *set, int priority)
Definition: presol.c:593
#define SCIP_DECL_PRESOLCOPY(x)
Definition: type_presol.h:46
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
type definitions for global SCIP settings
type definitions for return codes for SCIP methods
type definitions for presolvers
SCIP_RETCODE SCIPpresolExit(SCIP_PRESOL *presol, SCIP_SET *set)
Definition: presol.c:252
#define SCIP_DECL_PRESOLEXEC(x)
Definition: type_presol.h:153
SCIP_RETCODE SCIPpresolCreate(SCIP_PRESOL **presol, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, 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: presol.c:92
SCIP_RETCODE SCIPpresolExec(SCIP_PRESOL *presol, SCIP_SET *set, SCIP_PRESOLTIMING timing, int nrounds, int *nfixedvars, int *naggrvars, int *nchgvartypes, int *nchgbds, int *naddholes, int *ndelconss, int *naddconss, int *nupgdconss, int *nchgcoefs, int *nchgsides, SCIP_RESULT *result)
Definition: presol.c:342
#define SCIP_DECL_PRESOLFREE(x)
Definition: type_presol.h:54
void SCIPpresolEnableOrDisableClocks(SCIP_PRESOL *presol, SCIP_Bool enable)
Definition: presol.c:639
#define SCIP_DECL_PRESOLEXIT(x)
Definition: type_presol.h:70
void SCIPpresolSetInitpre(SCIP_PRESOL *presol, SCIP_DECL_PRESOLINITPRE((*presolinitpre)))
Definition: presol.c:531
unsigned int SCIP_PRESOLTIMING
Definition: type_timing.h:52
void SCIPpresolSetInit(SCIP_PRESOL *presol, SCIP_DECL_PRESOLINIT((*presolinit)))
Definition: presol.c:509
#define SCIP_Bool
Definition: def.h:61
#define SCIP_DECL_PRESOLEXITPRE(x)
Definition: type_presol.h:102
#define SCIP_DECL_PRESOLINIT(x)
Definition: type_presol.h:62
public methods for presolvers
void SCIPpresolSetExit(SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXIT((*presolexit)))
Definition: presol.c:520
void SCIPpresolSetFree(SCIP_PRESOL *presol, SCIP_DECL_PRESOLFREE((*presolfree)))
Definition: presol.c:498
SCIP_RETCODE SCIPpresolCopyInclude(SCIP_PRESOL *presol, SCIP_SET *set)
Definition: presol.c:74
result codes for SCIP callback methods
SCIP_RETCODE SCIPpresolInitpre(SCIP_PRESOL *presol, SCIP_SET *set)
Definition: presol.c:283
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:392
SCIP_RETCODE SCIPpresolInit(SCIP_PRESOL *presol, SCIP_SET *set)
Definition: presol.c:193
SCIP_RETCODE SCIPpresolExitpre(SCIP_PRESOL *presol, SCIP_SET *set)
Definition: presol.c:318
void SCIPpresolSetCopy(SCIP_PRESOL *presol, SCIP_DECL_PRESOLCOPY((*presolcopy)))
Definition: presol.c:487
memory allocation routines