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-2020 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 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 */
42  SCIP_PRESOL* presol, /**< presolver */
43  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
44  );
45 
46 /** creates a presolver */
48  SCIP_PRESOL** presol, /**< pointer to store presolver */
49  SCIP_SET* set, /**< global SCIP settings */
50  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
51  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
52  const char* name, /**< name of presolver */
53  const char* desc, /**< description of presolver */
54  int priority, /**< priority of the presolver (>= 0: before, < 0: after constraint handlers) */
55  int maxrounds, /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */
56  SCIP_PRESOLTIMING timing, /**< timing mask of the presolver */
57  SCIP_DECL_PRESOLCOPY ((*presolcopy)), /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */
58  SCIP_DECL_PRESOLFREE ((*presolfree)), /**< destructor of presolver to free user data (called when SCIP is exiting) */
59  SCIP_DECL_PRESOLINIT ((*presolinit)), /**< initialization method of presolver (called after problem was transformed) */
60  SCIP_DECL_PRESOLEXIT ((*presolexit)), /**< deinitialization method of presolver (called before transformed problem is freed) */
61  SCIP_DECL_PRESOLINITPRE((*presolinitpre)),/**< presolving initialization method of presolver (called when presolving is about to begin) */
62  SCIP_DECL_PRESOLEXITPRE((*presolexitpre)),/**< presolving deinitialization method of presolver (called after presolving has been finished) */
63  SCIP_DECL_PRESOLEXEC ((*presolexec)), /**< execution method of presolver */
64  SCIP_PRESOLDATA* presoldata /**< presolver data */
65  );
66 
67 /** frees memory of presolver */
69  SCIP_PRESOL** presol, /**< pointer to presolver data structure */
70  SCIP_SET* set /**< global SCIP settings */
71  );
72 
73 /** initializes presolver */
75  SCIP_PRESOL* presol, /**< presolver */
76  SCIP_SET* set /**< global SCIP settings */
77  );
78 
79 /** deinitializes presolver */
81  SCIP_PRESOL* presol, /**< presolver */
82  SCIP_SET* set /**< global SCIP settings */
83  );
84 
85 /** informs presolver that the presolving process is being started */
87  SCIP_PRESOL* presol, /**< presolver */
88  SCIP_SET* set /**< global SCIP settings */
89  );
90 
91 /** informs presolver that the presolving process is finished */
93  SCIP_PRESOL* presol, /**< presolver */
94  SCIP_SET* set /**< global SCIP settings */
95  );
96 
97 /** executes presolver */
99  SCIP_PRESOL* presol, /**< presolver */
100  SCIP_SET* set, /**< global SCIP settings */
101  SCIP_PRESOLTIMING timing, /**< current presolving timing */
102  int nrounds, /**< number of presolving rounds already done */
103  int* nfixedvars, /**< pointer to total number of variables fixed of all presolvers */
104  int* naggrvars, /**< pointer to total number of variables aggregated of all presolvers */
105  int* nchgvartypes, /**< pointer to total number of variable type changes of all presolvers */
106  int* nchgbds, /**< pointer to total number of variable bounds tightened of all presolvers */
107  int* naddholes, /**< pointer to total number of domain holes added of all presolvers */
108  int* ndelconss, /**< pointer to total number of deleted constraints of all presolvers */
109  int* naddconss, /**< pointer to total number of added constraints of all presolvers */
110  int* nupgdconss, /**< pointer to total number of upgraded constraints of all presolvers */
111  int* nchgcoefs, /**< pointer to total number of changed coefficients of all presolvers */
112  int* nchgsides, /**< pointer to total number of changed left/right hand sides of all presolvers */
113  SCIP_RESULT* result /**< pointer to store the result of the callback method */
114  );
115 
116 /** sets priority of presolver */
118  SCIP_PRESOL* presol, /**< presolver */
119  SCIP_SET* set, /**< global SCIP settings */
120  int priority /**< new priority of the presolver */
121  );
122 
123 /** sets copy method of presolver */
124 void SCIPpresolSetCopy(
125  SCIP_PRESOL* presol, /**< presolver */
126  SCIP_DECL_PRESOLCOPY ((*presolcopy)) /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */
127  );
128 
129 /** sets destructor method of presolver */
130 void SCIPpresolSetFree(
131  SCIP_PRESOL* presol, /**< presolver */
132  SCIP_DECL_PRESOLFREE ((*presolfree)) /**< destructor of presolver */
133  );
134 
135 /** sets initialization method of presolver */
136 void SCIPpresolSetInit(
137  SCIP_PRESOL* presol, /**< presolver */
138  SCIP_DECL_PRESOLINIT ((*presolinit)) /**< initialize presolver */
139  );
140 
141 /** sets deinitialization method of presolver */
142 void SCIPpresolSetExit(
143  SCIP_PRESOL* presol, /**< presolver */
144  SCIP_DECL_PRESOLEXIT ((*presolexit)) /**< deinitialize presolver */
145  );
146 
147 /** sets solving process initialization method of presolver */
149  SCIP_PRESOL* presol, /**< presolver */
150  SCIP_DECL_PRESOLINITPRE ((*presolinitpre))/**< solving process initialization method of presolver */
151  );
152 
153 /** sets solving process deinitialization method of presolver */
155  SCIP_PRESOL* presol, /**< presolver */
156  SCIP_DECL_PRESOLEXITPRE ((*presolexitpre))/**< solving process deinitialization method of presolver */
157  );
158 
159 /** enables or disables all clocks of \p presol, depending on the value of the flag */
161  SCIP_PRESOL* presol, /**< the presolver for which all clocks should be enabled or disabled */
162  SCIP_Bool enable /**< should the clocks of the presolver be enabled? */
163  );
164 
165 #ifdef __cplusplus
166 }
167 #endif
168 
169 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
void SCIPpresolSetExitpre(SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXITPRE((*presolexitpre)))
Definition: presol.c:579
struct SCIP_PresolData SCIP_PRESOLDATA
Definition: type_presol.h:42
SCIP_RETCODE SCIPpresolFree(SCIP_PRESOL **presol, SCIP_SET *set)
Definition: presol.c:203
#define SCIP_DECL_PRESOLINITPRE(x)
Definition: type_presol.h:89
void SCIPpresolSetPriority(SCIP_PRESOL *presol, SCIP_SET *set, int priority)
Definition: presol.c:630
#define SCIP_DECL_PRESOLCOPY(x)
Definition: type_presol.h:51
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
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:289
#define SCIP_DECL_PRESOLEXEC(x)
Definition: type_presol.h:158
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:171
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:379
#define SCIP_DECL_PRESOLFREE(x)
Definition: type_presol.h:59
void SCIPpresolEnableOrDisableClocks(SCIP_PRESOL *presol, SCIP_Bool enable)
Definition: presol.c:676
#define SCIP_DECL_PRESOLEXIT(x)
Definition: type_presol.h:75
void SCIPpresolSetInitpre(SCIP_PRESOL *presol, SCIP_DECL_PRESOLINITPRE((*presolinitpre)))
Definition: presol.c:568
unsigned int SCIP_PRESOLTIMING
Definition: type_timing.h:52
void SCIPpresolSetInit(SCIP_PRESOL *presol, SCIP_DECL_PRESOLINIT((*presolinit)))
Definition: presol.c:546
#define SCIP_Bool
Definition: def.h:70
#define SCIP_DECL_PRESOLEXITPRE(x)
Definition: type_presol.h:107
#define SCIP_DECL_PRESOLINIT(x)
Definition: type_presol.h:67
public methods for presolvers
void SCIPpresolSetExit(SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXIT((*presolexit)))
Definition: presol.c:557
void SCIPpresolSetFree(SCIP_PRESOL *presol, SCIP_DECL_PRESOLFREE((*presolfree)))
Definition: presol.c:535
SCIP_RETCODE SCIPpresolCopyInclude(SCIP_PRESOL *presol, SCIP_SET *set)
Definition: presol.c:75
result codes for SCIP callback methods
SCIP_RETCODE SCIPpresolInitpre(SCIP_PRESOL *presol, SCIP_SET *set)
Definition: presol.c:320
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:429
SCIP_RETCODE SCIPpresolInit(SCIP_PRESOL *presol, SCIP_SET *set)
Definition: presol.c:230
SCIP_RETCODE SCIPpresolExitpre(SCIP_PRESOL *presol, SCIP_SET *set)
Definition: presol.c:355
void SCIPpresolSetCopy(SCIP_PRESOL *presol, SCIP_DECL_PRESOLCOPY((*presolcopy)))
Definition: presol.c:524
memory allocation routines