Scippy

SCIP

Solving Constraint Integer Programs

scip_sepa.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_sepa.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for separator 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_SEPA_H__
32 #define __SCIP_SCIP_SEPA_H__
33 
34 
35 #include "scip/def.h"
36 #include "scip/type_result.h"
37 #include "scip/type_retcode.h"
38 #include "scip/type_scip.h"
39 #include "scip/type_sepa.h"
40 #include "scip/type_sol.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 PublicSeparatorMethods
66  *
67  * @{
68  */
69 
70 /** creates a separator and includes it in SCIP.
71  *
72  * @note method has all separator callbacks as arguments and is thus changed every time a new
73  * callback is added
74  * in future releases; consider using SCIPincludeSepaBasic() 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 separator */
81  const char* desc, /**< description of separator */
82  int priority, /**< priority of separator (>= 0: before, < 0: after constraint handlers) */
83  int freq, /**< frequency for calling separator */
84  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound compared
85  * to best node's dual bound for applying separation */
86  SCIP_Bool usessubscip, /**< does the separator use a secondary SCIP instance? */
87  SCIP_Bool delay, /**< should separator be delayed, if other separators found cuts? */
88  SCIP_DECL_SEPACOPY ((*sepacopy)), /**< copy method of separator or NULL if you don't want to copy your plugin into sub-SCIPs */
89  SCIP_DECL_SEPAFREE ((*sepafree)), /**< destructor of separator */
90  SCIP_DECL_SEPAINIT ((*sepainit)), /**< initialize separator */
91  SCIP_DECL_SEPAEXIT ((*sepaexit)), /**< deinitialize separator */
92  SCIP_DECL_SEPAINITSOL ((*sepainitsol)), /**< solving process initialization method of separator */
93  SCIP_DECL_SEPAEXITSOL ((*sepaexitsol)), /**< solving process deinitialization method of separator */
94  SCIP_DECL_SEPAEXECLP ((*sepaexeclp)), /**< LP solution separation method of separator */
95  SCIP_DECL_SEPAEXECSOL ((*sepaexecsol)), /**< arbitrary primal solution separation method of separator */
96  SCIP_SEPADATA* sepadata /**< separator data */
97  );
98 
99 /** creates a separator and includes it in SCIP with its most fundamental callbacks. All non-fundamental
100  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
101  * Optional callbacks can be set via specific setter functions, see SCIPsetSepaInit(), SCIPsetSepaFree(),
102  * SCIPsetSepaInitsol(), SCIPsetSepaExitsol(), SCIPsetSepaCopy(), SCIPsetExit().
103  *
104  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeSepa() instead
105  */
106 extern
108  SCIP* scip, /**< SCIP data structure */
109  SCIP_SEPA** sepa, /**< reference to a separator, or NULL */
110  const char* name, /**< name of separator */
111  const char* desc, /**< description of separator */
112  int priority, /**< priority of separator (>= 0: before, < 0: after constraint handlers) */
113  int freq, /**< frequency for calling separator */
114  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound compared
115  * to best node's dual bound for applying separation */
116  SCIP_Bool usessubscip, /**< does the separator use a secondary SCIP instance? */
117  SCIP_Bool delay, /**< should separator be delayed, if other separators found cuts? */
118  SCIP_DECL_SEPAEXECLP ((*sepaexeclp)), /**< LP solution separation method of separator */
119  SCIP_DECL_SEPAEXECSOL ((*sepaexecsol)), /**< arbitrary primal solution separation method of separator */
120  SCIP_SEPADATA* sepadata /**< separator data */
121  );
122 
123 /** sets copy method of separator */
124 extern
126  SCIP* scip, /**< SCIP data structure */
127  SCIP_SEPA* sepa, /**< separator */
128  SCIP_DECL_SEPACOPY ((*sepacopy)) /**< copy method of separator or NULL if you don't want to copy your plugin into sub-SCIPs */
129  );
130 
131 /** sets destructor method of separator */
132 extern
134  SCIP* scip, /**< SCIP data structure */
135  SCIP_SEPA* sepa, /**< separator */
136  SCIP_DECL_SEPAFREE ((*sepafree)) /**< destructor of separator */
137  );
138 
139 /** sets initialization method of separator */
140 extern
142  SCIP* scip, /**< SCIP data structure */
143  SCIP_SEPA* sepa, /**< separator */
144  SCIP_DECL_SEPAINIT ((*sepainit)) /**< initialize separator */
145  );
146 
147 /** sets deinitialization method of separator */
148 extern
150  SCIP* scip, /**< SCIP data structure */
151  SCIP_SEPA* sepa, /**< separator */
152  SCIP_DECL_SEPAEXIT ((*sepaexit)) /**< deinitialize separator */
153  );
154 
155 /** sets solving process initialization method of separator */
156 extern
158  SCIP* scip, /**< SCIP data structure */
159  SCIP_SEPA* sepa, /**< separator */
160  SCIP_DECL_SEPAINITSOL ((*sepainitsol)) /**< solving process initialization method of separator */
161  );
162 
163 /** sets solving process deinitialization method of separator */
164 extern
166  SCIP* scip, /**< SCIP data structure */
167  SCIP_SEPA* sepa, /**< separator */
168  SCIP_DECL_SEPAEXITSOL ((*sepaexitsol)) /**< solving process deinitialization method of separator */
169  );
170 
171 /** returns the separator of the given name, or NULL if not existing */
172 extern
174  SCIP* scip, /**< SCIP data structure */
175  const char* name /**< name of separator */
176  );
177 
178 /** returns the array of currently available separators */
179 extern
181  SCIP* scip /**< SCIP data structure */
182  );
183 
184 /** returns the number of currently available separators */
185 extern
186 int SCIPgetNSepas(
187  SCIP* scip /**< SCIP data structure */
188  );
189 
190 /** sets the priority of a separator */
191 extern
193  SCIP* scip, /**< SCIP data structure */
194  SCIP_SEPA* sepa, /**< separator */
195  int priority /**< new priority of the separator */
196  );
197 
198 /** gets value of minimal efficacy for a cut to enter the LP
199  *
200  * @pre This method can be called if @p scip is in one of the following stages:
201  * - \ref SCIP_STAGE_SOLVING
202  *
203  * @return value of "separating/minefficacyroot" if at root node, otherwise value of "separating/minefficacy"
204  */
205 extern
207  SCIP* scip /**< SCIP data structure */
208  );
209 
210 #ifdef NDEBUG
211 #define SCIPgetSepaMinEfficacy(scip) (SCIPtreeGetCurrentDepth((scip)->tree) == 0 ? (scip)->set->sepa_minefficacyroot : (scip)->set->sepa_minefficacy)
212 #endif
213 
214 /* @} */
215 
216 #ifdef __cplusplus
217 }
218 #endif
219 
220 #endif
internal methods for branch and bound tree
SCIP_SEPA * SCIPfindSepa(SCIP *scip, const char *name)
Definition: scip_sepa.c:316
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_RETCODE SCIPsetSepaPriority(SCIP *scip, SCIP_SEPA *sepa, int priority)
Definition: scip_sepa.c:353
type definitions for return codes for SCIP methods
#define SCIP_DECL_SEPAEXECLP(x)
Definition: type_sepa.h:116
SCIP_RETCODE SCIPsetSepaCopy(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPACOPY((*sepacopy)))
Definition: scip_sepa.c:220
#define SCIP_DECL_SEPACOPY(x)
Definition: type_sepa.h:47
SCIP_RETCODE SCIPincludeSepa(SCIP *scip, const char *name, const char *desc, int priority, int freq, SCIP_Real maxbounddist, SCIP_Bool usessubscip, SCIP_Bool delay, SCIP_DECL_SEPACOPY((*sepacopy)), SCIP_DECL_SEPAFREE((*sepafree)), SCIP_DECL_SEPAINIT((*sepainit)), SCIP_DECL_SEPAEXIT((*sepaexit)), SCIP_DECL_SEPAINITSOL((*sepainitsol)), SCIP_DECL_SEPAEXITSOL((*sepaexitsol)), SCIP_DECL_SEPAEXECLP((*sepaexeclp)), SCIP_DECL_SEPAEXECSOL((*sepaexecsol)), SCIP_SEPADATA *sepadata)
Definition: scip_sepa.c:131
SCIP_RETCODE SCIPsetSepaExit(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAEXIT((*sepaexit)))
Definition: scip_sepa.c:268
type definitions for SCIP&#39;s main datastructure
internal miscellaneous methods
SCIP_RETCODE SCIPsetSepaInitsol(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAINITSOL((*sepainitsol)))
Definition: scip_sepa.c:284
SCIP_Real SCIPgetSepaMinEfficacy(SCIP *scip)
Definition: scip_sepa.c:376
internal methods for global SCIP settings
SCIP main data structure.
SCIP_RETCODE SCIPincludeSepaBasic(SCIP *scip, SCIP_SEPA **sepa, const char *name, const char *desc, int priority, int freq, SCIP_Real maxbounddist, SCIP_Bool usessubscip, SCIP_Bool delay, SCIP_DECL_SEPAEXECLP((*sepaexeclp)), SCIP_DECL_SEPAEXECSOL((*sepaexecsol)), SCIP_SEPADATA *sepadata)
Definition: scip_sepa.c:178
internal methods for problem variables
SCIP_RETCODE SCIPsetSepaExitsol(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAEXITSOL((*sepaexitsol)))
Definition: scip_sepa.c:300
#define SCIP_Bool
Definition: def.h:69
#define SCIP_DECL_SEPAINIT(x)
Definition: type_sepa.h:63
methods for debugging
datastructures for problem statistics
#define SCIP_DECL_SEPAEXITSOL(x)
Definition: type_sepa.h:93
#define SCIP_DECL_SEPAEXECSOL(x)
Definition: type_sepa.h:140
type definitions for storing primal CIP solutions
SCIP_RETCODE SCIPsetSepaFree(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAFREE((*sepafree)))
Definition: scip_sepa.c:236
SCIP_RETCODE SCIPsetSepaInit(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAINIT((*sepainit)))
Definition: scip_sepa.c:252
internal methods for main solving loop and node processing
#define SCIP_DECL_SEPAEXIT(x)
Definition: type_sepa.h:71
type definitions for separators
#define SCIP_DECL_SEPAINITSOL(x)
Definition: type_sepa.h:82
#define SCIP_Real
Definition: def.h:157
result codes for SCIP callback methods
internal methods for constraints and constraint handlers
SCIP_SEPA ** SCIPgetSepas(SCIP *scip)
Definition: scip_sepa.c:329
int SCIPgetNSepas(SCIP *scip)
Definition: scip_sepa.c:342
common defines and data types used in all packages of SCIP
#define SCIP_DECL_SEPAFREE(x)
Definition: type_sepa.h:55
struct SCIP_SepaData SCIP_SEPADATA
Definition: type_sepa.h:38