Scippy

SCIP

Solving Constraint Integer Programs

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-2023 Zuse Institute Berlin (ZIB) */
7 /* */
8 /* Licensed under the Apache License, Version 2.0 (the "License"); */
9 /* you may not use this file except in compliance with the License. */
10 /* You may obtain a copy of the License at */
11 /* */
12 /* http://www.apache.org/licenses/LICENSE-2.0 */
13 /* */
14 /* Unless required by applicable law or agreed to in writing, software */
15 /* distributed under the License is distributed on an "AS IS" BASIS, */
16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17 /* See the License for the specific language governing permissions and */
18 /* limitations under the License. */
19 /* */
20 /* You should have received a copy of the Apache-2.0 license */
21 /* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22 /* */
23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24 
25 /**@file sepa.h
26  * @ingroup INTERNALAPI
27  * @brief internal methods for separators
28  * @author Tobias Achterberg
29  */
30 
31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32 
33 #ifndef __SCIP_SEPA_H__
34 #define __SCIP_SEPA_H__
35 
36 
37 #include "scip/def.h"
38 #include "blockmemshell/memory.h"
39 #include "scip/type_retcode.h"
40 #include "scip/type_result.h"
41 #include "scip/type_set.h"
42 #include "scip/type_stat.h"
43 #include "scip/type_sepastore.h"
44 #include "scip/type_sepa.h"
45 #include "scip/pub_sepa.h"
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 /** copies the given separator to a new scip */
53  SCIP_SEPA* sepa, /**< separator */
54  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
55  );
56 
57 /** creates a separator */
59  SCIP_SEPA** sepa, /**< pointer to separator data structure */
60  SCIP_SET* set, /**< global SCIP settings */
61  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
62  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
63  const char* name, /**< name of separator */
64  const char* desc, /**< description of separator */
65  int priority, /**< priority of separator (>= 0: before, < 0: after constraint handlers) */
66  int freq, /**< frequency for calling separator */
67  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound compared
68  * to best node's dual bound for applying separation */
69  SCIP_Bool usessubscip, /**< does the separator use a secondary SCIP instance? */
70  SCIP_Bool delay, /**< should separator be delayed, if other separators found cuts? */
71  SCIP_DECL_SEPACOPY ((*sepacopy)), /**< copy method of separator or NULL if you don't want to copy your plugin into sub-SCIPs */
72  SCIP_DECL_SEPAFREE ((*sepafree)), /**< destructor of separator */
73  SCIP_DECL_SEPAINIT ((*sepainit)), /**< initialize separator */
74  SCIP_DECL_SEPAEXIT ((*sepaexit)), /**< deinitialize separator */
75  SCIP_DECL_SEPAINITSOL ((*sepainitsol)), /**< solving process initialization method of separator */
76  SCIP_DECL_SEPAEXITSOL ((*sepaexitsol)), /**< solving process deinitialization method of separator */
77  SCIP_DECL_SEPAEXECLP ((*sepaexeclp)), /**< LP solution separation method of separator */
78  SCIP_DECL_SEPAEXECSOL ((*sepaexecsol)), /**< arbitrary primal solution separation method of separator */
79  SCIP_SEPADATA* sepadata /**< separator data */
80  );
81 
82 /** calls destructor and frees memory of separator */
84  SCIP_SEPA** sepa, /**< pointer to separator data structure */
85  SCIP_SET* set /**< global SCIP settings */
86  );
87 
88 /** initializes separator */
90  SCIP_SEPA* sepa, /**< separator */
91  SCIP_SET* set /**< global SCIP settings */
92  );
93 
94 /** calls exit method of separator */
96  SCIP_SEPA* sepa, /**< separator */
97  SCIP_SET* set /**< global SCIP settings */
98  );
99 
100 /** informs separator that the branch and bound process is being started */
102  SCIP_SEPA* sepa, /**< separator */
103  SCIP_SET* set /**< global SCIP settings */
104  );
105 
106 /** informs separator that the branch and bound process data is being freed */
108  SCIP_SEPA* sepa, /**< separator */
109  SCIP_SET* set /**< global SCIP settings */
110  );
111 
112 /** calls LP separation method of separator */
114  SCIP_SEPA* sepa, /**< separator */
115  SCIP_SET* set, /**< global SCIP settings */
116  SCIP_STAT* stat, /**< dynamic problem statistics */
117  SCIP_SEPASTORE* sepastore, /**< separation storage */
118  int depth, /**< depth of current node */
119  SCIP_Real bounddist, /**< current relative distance of local dual bound to global dual bound */
120  SCIP_Bool allowlocal, /**< should the separator be asked to separate local cuts */
121  SCIP_Bool execdelayed, /**< execute separator even if it is marked to be delayed */
122  SCIP_RESULT* result /**< pointer to store the result of the callback method */
123  );
124 
125 /** calls primal solution separation method of separator */
127  SCIP_SEPA* sepa, /**< separator */
128  SCIP_SET* set, /**< global SCIP settings */
129  SCIP_STAT* stat, /**< dynamic problem statistics */
130  SCIP_SEPASTORE* sepastore, /**< separation storage */
131  SCIP_SOL* sol, /**< primal solution that should be separated */
132  int depth, /**< depth of current node */
133  SCIP_Bool allowlocal, /**< should the separator be asked to separate local cuts */
134  SCIP_Bool execdelayed, /**< execute separator even if it is marked to be delayed */
135  SCIP_RESULT* result /**< pointer to store the result of the callback method */
136  );
137 
138 /** sets priority of separator */
140  SCIP_SEPA* sepa, /**< separator */
141  SCIP_SET* set, /**< global SCIP settings */
142  int priority /**< new priority of the separator */
143  );
144 
145 /** sets copy method of separator */
146 void SCIPsepaSetCopy(
147  SCIP_SEPA* sepa, /**< separator */
148  SCIP_DECL_SEPACOPY ((*sepacopy)) /**< copy method of separator or NULL if you don't want to copy your plugin into sub-SCIPs */
149  );
150 
151 /** sets destructor method of separator */
152 void SCIPsepaSetFree(
153  SCIP_SEPA* sepa, /**< separator */
154  SCIP_DECL_SEPAFREE ((*sepafree)) /**< destructor of separator */
155  );
156 
157 /** sets initialization method of separator */
158 void SCIPsepaSetInit(
159  SCIP_SEPA* sepa, /**< separator */
160  SCIP_DECL_SEPAINIT ((*sepainit)) /**< initialize separator */
161  );
162 
163 /** sets deinitialization method of separator */
164 void SCIPsepaSetExit(
165  SCIP_SEPA* sepa, /**< separator */
166  SCIP_DECL_SEPAEXIT ((*sepaexit)) /**< deinitialize separator */
167  );
168 
169 /** sets solving process initialization method of separator */
170 void SCIPsepaSetInitsol(
171  SCIP_SEPA* sepa, /**< separator */
172  SCIP_DECL_SEPAINITSOL ((*sepainitsol)) /**< solving process initialization method of separator */
173  );
174 
175 /** sets solving process deinitialization method of separator */
176 void SCIPsepaSetExitsol(
177  SCIP_SEPA* sepa, /**< separator */
178  SCIP_DECL_SEPAEXITSOL ((*sepaexitsol)) /**< solving process deinitialization method of separator */
179  );
180 
181 /** declares separator to be a parent separator */
183  SCIP_SEPA* sepa /**< separator */
184  );
185 
186 /** sets the parent separator */
188  SCIP_SEPA* sepa, /**< separator */
189  SCIP_SEPA* parentsepa /**< parent separator */
190  );
191 
192 /** enables or disables all clocks of \p sepa, depending on the value of the flag */
194  SCIP_SEPA* sepa, /**< the separator for which all clocks should be enabled or disabled */
195  SCIP_Bool enable /**< should the clocks of the separator be enabled? */
196  );
197 
198 /** increase count of applied cuts by one */
200  SCIP_SEPA* sepa, /**< separator */
201  SCIP_Bool fromcutpool /**< whether the cuts were added from the cutpool to sepastore */
202  );
203 
204 /** increase count of found cuts by one */
206  SCIP_SEPA* sepa, /**< separator */
207  SCIP_Bool fromcutpool /**< whether the cuts were added from the cutpool to sepastore */
208  );
209 
210 /** decrease the count of added cuts by one */
212  SCIP_SEPA* sepa, /**< separator */
213  SCIP_Bool fromcutpool /**< whether the cuts were added from the cutpool to sepastore */
214  );
215 
216 /** increase count of found cuts by one */
218  SCIP_SEPA* sepa /**< separator */
219  );
220 
221 /** increase count of found cuts at current node by one */
223  SCIP_SEPA* sepa /**< separator */
224  );
225 
226 #ifdef __cplusplus
227 }
228 #endif
229 
230 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:61
SCIP_RETCODE SCIPsepaCopyInclude(SCIP_SEPA *sepa, SCIP_SET *set)
Definition: sepa.c:79
void SCIPsepaIncNCutsFound(SCIP_SEPA *sepa)
Definition: sepa.c:1039
SCIP_RETCODE SCIPsepaCreate(SCIP_SEPA **sepa, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, 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: sepa.c:203
SCIP_RETCODE SCIPsepaFree(SCIP_SEPA **sepa, SCIP_SET *set)
Definition: sepa.c:242
void SCIPsepaDecNCutsAdded(SCIP_SEPA *sepa, SCIP_Bool fromcutpool)
Definition: sepa.c:1016
void SCIPsepaEnableOrDisableClocks(SCIP_SEPA *sepa, SCIP_Bool enable)
Definition: sepa.c:828
void SCIPsepaSetExit(SCIP_SEPA *sepa, SCIP_DECL_SEPAEXIT((*sepaexit)))
Definition: sepa.c:689
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for global SCIP settings
SCIP_RETCODE SCIPsepaInitsol(SCIP_SEPA *sepa, SCIP_SET *set)
Definition: sepa.c:352
type definitions for return codes for SCIP methods
#define SCIP_DECL_SEPAEXECLP(x)
Definition: type_sepa.h:136
SCIP_RETCODE SCIPsepaExecSol(SCIP_SEPA *sepa, SCIP_SET *set, SCIP_STAT *stat, SCIP_SEPASTORE *sepastore, SCIP_SOL *sol, int depth, SCIP_Bool allowlocal, SCIP_Bool execdelayed, SCIP_RESULT *result)
Definition: sepa.c:521
type definitions for problem statistics
#define SCIP_DECL_SEPACOPY(x)
Definition: type_sepa.h:61
SCIP_RETCODE SCIPsepaInit(SCIP_SEPA *sepa, SCIP_SET *set)
Definition: sepa.c:269
SCIP_RETCODE SCIPsepaExecLP(SCIP_SEPA *sepa, SCIP_SET *set, SCIP_STAT *stat, SCIP_SEPASTORE *sepastore, int depth, SCIP_Real bounddist, SCIP_Bool allowlocal, SCIP_Bool execdelayed, SCIP_RESULT *result)
Definition: sepa.c:403
void SCIPsepaSetCopy(SCIP_SEPA *sepa, SCIP_DECL_SEPACOPY((*sepacopy)))
Definition: sepa.c:656
void SCIPsepaIncNCutsFoundAtNode(SCIP_SEPA *sepa)
Definition: sepa.c:1049
void SCIPsepaSetExitsol(SCIP_SEPA *sepa, SCIP_DECL_SEPAEXITSOL((*sepaexitsol)))
Definition: sepa.c:711
void SCIPsepaSetInitsol(SCIP_SEPA *sepa, SCIP_DECL_SEPAINITSOL((*sepainitsol)))
Definition: sepa.c:700
type definitions for storing separated cuts
#define SCIP_Bool
Definition: def.h:93
#define SCIP_DECL_SEPAINIT(x)
Definition: type_sepa.h:77
void SCIPsepaIncNCutsAdded(SCIP_SEPA *sepa, SCIP_Bool fromcutpool)
Definition: sepa.c:993
void SCIPsepaIncNCutsApplied(SCIP_SEPA *sepa, SCIP_Bool fromcutpool)
Definition: sepa.c:971
#define SCIP_DECL_SEPAEXITSOL(x)
Definition: type_sepa.h:107
#define SCIP_DECL_SEPAEXECSOL(x)
Definition: type_sepa.h:166
SCIP_RETCODE SCIPsepaExitsol(SCIP_SEPA *sepa, SCIP_SET *set)
Definition: sepa.c:379
void SCIPsepaSetParentsepa(SCIP_SEPA *sepa, SCIP_SEPA *parentsepa)
Definition: sepa.c:732
void SCIPsepaSetPriority(SCIP_SEPA *sepa, SCIP_SET *set, int priority)
Definition: sepa.c:773
#define SCIP_DECL_SEPAEXIT(x)
Definition: type_sepa.h:85
type definitions for separators
#define SCIP_DECL_SEPAINITSOL(x)
Definition: type_sepa.h:96
SCIP_RETCODE SCIPsepaExit(SCIP_SEPA *sepa, SCIP_SET *set)
Definition: sepa.c:322
#define SCIP_Real
Definition: def.h:186
result codes for SCIP callback methods
void SCIPsepaSetFree(SCIP_SEPA *sepa, SCIP_DECL_SEPAFREE((*sepafree)))
Definition: sepa.c:667
public methods for separators
void SCIPsepaSetInit(SCIP_SEPA *sepa, SCIP_DECL_SEPAINIT((*sepainit)))
Definition: sepa.c:678
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:439
#define SCIP_DECL_SEPAFREE(x)
Definition: type_sepa.h:69
struct SCIP_SepaData SCIP_SEPADATA
Definition: type_sepa.h:52
void SCIPsepaSetIsParentsepa(SCIP_SEPA *sepa)
Definition: sepa.c:722
memory allocation routines