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_set.h"
52 #include "scip/tree.h"
53 #endif
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 /**@addtogroup PublicSeparatorMethods
60  *
61  * @{
62  */
63 
64 /** creates a separator and includes it in SCIP.
65  *
66  * @note method has all separator callbacks as arguments and is thus changed every time a new
67  * callback is added
68  * in future releases; consider using SCIPincludeSepaBasic() and setter functions
69  * if you seek for a method which is less likely to change in future releases
70  */
73  SCIP* scip, /**< SCIP data structure */
74  const char* name, /**< name of separator */
75  const char* desc, /**< description of separator */
76  int priority, /**< priority of separator (>= 0: before, < 0: after constraint handlers) */
77  int freq, /**< frequency for calling separator */
78  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound compared
79  * to best node's dual bound for applying separation */
80  SCIP_Bool usessubscip, /**< does the separator use a secondary SCIP instance? */
81  SCIP_Bool delay, /**< should separator be delayed, if other separators found cuts? */
82  SCIP_DECL_SEPACOPY ((*sepacopy)), /**< copy method of separator or NULL if you don't want to copy your plugin into sub-SCIPs */
83  SCIP_DECL_SEPAFREE ((*sepafree)), /**< destructor of separator */
84  SCIP_DECL_SEPAINIT ((*sepainit)), /**< initialize separator */
85  SCIP_DECL_SEPAEXIT ((*sepaexit)), /**< deinitialize separator */
86  SCIP_DECL_SEPAINITSOL ((*sepainitsol)), /**< solving process initialization method of separator */
87  SCIP_DECL_SEPAEXITSOL ((*sepaexitsol)), /**< solving process deinitialization method of separator */
88  SCIP_DECL_SEPAEXECLP ((*sepaexeclp)), /**< LP solution separation method of separator */
89  SCIP_DECL_SEPAEXECSOL ((*sepaexecsol)), /**< arbitrary primal solution separation method of separator */
90  SCIP_SEPADATA* sepadata /**< separator data */
91  );
92 
93 /** creates a separator and includes it in SCIP with its most fundamental callbacks. All non-fundamental
94  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
95  * Optional callbacks can be set via specific setter functions, see SCIPsetSepaInit(), SCIPsetSepaFree(),
96  * SCIPsetSepaInitsol(), SCIPsetSepaExitsol(), SCIPsetSepaCopy(), SCIPsetExit().
97  *
98  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeSepa() instead
99  */
102  SCIP* scip, /**< SCIP data structure */
103  SCIP_SEPA** sepa, /**< reference to a separator, or NULL */
104  const char* name, /**< name of separator */
105  const char* desc, /**< description of separator */
106  int priority, /**< priority of separator (>= 0: before, < 0: after constraint handlers) */
107  int freq, /**< frequency for calling separator */
108  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound compared
109  * to best node's dual bound for applying separation */
110  SCIP_Bool usessubscip, /**< does the separator use a secondary SCIP instance? */
111  SCIP_Bool delay, /**< should separator be delayed, if other separators found cuts? */
112  SCIP_DECL_SEPAEXECLP ((*sepaexeclp)), /**< LP solution separation method of separator */
113  SCIP_DECL_SEPAEXECSOL ((*sepaexecsol)), /**< arbitrary primal solution separation method of separator */
114  SCIP_SEPADATA* sepadata /**< separator data */
115  );
116 
117 /** sets copy method of separator */
120  SCIP* scip, /**< SCIP data structure */
121  SCIP_SEPA* sepa, /**< separator */
122  SCIP_DECL_SEPACOPY ((*sepacopy)) /**< copy method of separator or NULL if you don't want to copy your plugin into sub-SCIPs */
123  );
124 
125 /** sets destructor method of separator */
128  SCIP* scip, /**< SCIP data structure */
129  SCIP_SEPA* sepa, /**< separator */
130  SCIP_DECL_SEPAFREE ((*sepafree)) /**< destructor of separator */
131  );
132 
133 /** sets initialization method of separator */
136  SCIP* scip, /**< SCIP data structure */
137  SCIP_SEPA* sepa, /**< separator */
138  SCIP_DECL_SEPAINIT ((*sepainit)) /**< initialize separator */
139  );
140 
141 /** sets deinitialization method of separator */
144  SCIP* scip, /**< SCIP data structure */
145  SCIP_SEPA* sepa, /**< separator */
146  SCIP_DECL_SEPAEXIT ((*sepaexit)) /**< deinitialize separator */
147  );
148 
149 /** sets solving process initialization method of separator */
152  SCIP* scip, /**< SCIP data structure */
153  SCIP_SEPA* sepa, /**< separator */
154  SCIP_DECL_SEPAINITSOL ((*sepainitsol)) /**< solving process initialization method of separator */
155  );
156 
157 /** sets solving process deinitialization method of separator */
160  SCIP* scip, /**< SCIP data structure */
161  SCIP_SEPA* sepa, /**< separator */
162  SCIP_DECL_SEPAEXITSOL ((*sepaexitsol)) /**< solving process deinitialization method of separator */
163  );
164 
165 /** returns the separator of the given name, or NULL if not existing */
168  SCIP* scip, /**< SCIP data structure */
169  const char* name /**< name of separator */
170  );
171 
172 /** returns the array of currently available separators */
175  SCIP* scip /**< SCIP data structure */
176  );
177 
178 /** returns the number of currently available separators */
180 int SCIPgetNSepas(
181  SCIP* scip /**< SCIP data structure */
182  );
183 
184 /** sets the priority of a separator */
187  SCIP* scip, /**< SCIP data structure */
188  SCIP_SEPA* sepa, /**< separator */
189  int priority /**< new priority of the separator */
190  );
191 
192 /** gets value of minimal efficacy for a cut to enter the LP
193  *
194  * @pre This method can be called if @p scip is in one of the following stages:
195  * - \ref SCIP_STAGE_SOLVING
196  *
197  * @return value of "separating/minefficacyroot" if at root node, otherwise value of "separating/minefficacy"
198  */
201  SCIP* scip /**< SCIP data structure */
202  );
203 
204 #ifdef NDEBUG
205 #define SCIPgetSepaMinEfficacy(scip) (SCIPtreeGetCurrentDepth((scip)->tree) == 0 ? (scip)->set->sepa_minefficacyroot : (scip)->set->sepa_minefficacy)
206 #endif
207 
208 /* @} */
209 
210 #ifdef __cplusplus
211 }
212 #endif
213 
214 #endif
SCIP_EXPORT SCIP_Real SCIPgetSepaMinEfficacy(SCIP *scip)
Definition: scip_sepa.c:297
internal methods for branch and bound tree
#define SCIP_EXPORT
Definition: def.h:98
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_EXPORT SCIP_RETCODE SCIPsetSepaCopy(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPACOPY((*sepacopy)))
Definition: scip_sepa.c:141
SCIP_EXPORT SCIP_RETCODE SCIPsetSepaPriority(SCIP *scip, SCIP_SEPA *sepa, int priority)
Definition: scip_sepa.c:274
type definitions for return codes for SCIP methods
#define SCIP_DECL_SEPAEXECLP(x)
Definition: type_sepa.h:116
SCIP_EXPORT SCIP_RETCODE SCIPsetSepaInit(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAINIT((*sepainit)))
Definition: scip_sepa.c:173
#define SCIP_DECL_SEPACOPY(x)
Definition: type_sepa.h:47
SCIP_EXPORT SCIP_SEPA * SCIPfindSepa(SCIP *scip, const char *name)
Definition: scip_sepa.c:237
type definitions for SCIP&#39;s main datastructure
SCIP main data structure.
SCIP_EXPORT SCIP_RETCODE SCIPsetSepaExit(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAEXIT((*sepaexit)))
Definition: scip_sepa.c:189
SCIP_EXPORT 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:52
SCIP_EXPORT int SCIPgetNSepas(SCIP *scip)
Definition: scip_sepa.c:263
#define SCIP_Bool
Definition: def.h:70
#define SCIP_DECL_SEPAINIT(x)
Definition: type_sepa.h:63
SCIP_EXPORT 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:99
SCIP_EXPORT SCIP_SEPA ** SCIPgetSepas(SCIP *scip)
Definition: scip_sepa.c:250
SCIP_EXPORT SCIP_RETCODE SCIPsetSepaInitsol(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAINITSOL((*sepainitsol)))
Definition: scip_sepa.c:205
#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
#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:164
result codes for SCIP callback methods
SCIP_EXPORT SCIP_RETCODE SCIPsetSepaExitsol(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAEXITSOL((*sepaexitsol)))
Definition: scip_sepa.c:221
common defines and data types used in all packages of SCIP
SCIP_EXPORT SCIP_RETCODE SCIPsetSepaFree(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAFREE((*sepafree)))
Definition: scip_sepa.c:157
datastructures for global SCIP settings
#define SCIP_DECL_SEPAFREE(x)
Definition: type_sepa.h:55
struct SCIP_SepaData SCIP_SEPADATA
Definition: type_sepa.h:38