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-2022 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 sepa.h
17  * @ingroup INTERNALAPI
18  * @brief internal methods for separators
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_SEPA_H__
25 #define __SCIP_SEPA_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_stat.h"
34 #include "scip/type_sepastore.h"
35 #include "scip/type_sepa.h"
36 #include "scip/pub_sepa.h"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /** copies the given separator to a new scip */
44  SCIP_SEPA* sepa, /**< separator */
45  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
46  );
47 
48 /** creates a separator */
50  SCIP_SEPA** sepa, /**< pointer to separator data structure */
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 separator */
55  const char* desc, /**< description of separator */
56  int priority, /**< priority of separator (>= 0: before, < 0: after constraint handlers) */
57  int freq, /**< frequency for calling separator */
58  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound compared
59  * to best node's dual bound for applying separation */
60  SCIP_Bool usessubscip, /**< does the separator use a secondary SCIP instance? */
61  SCIP_Bool delay, /**< should separator be delayed, if other separators found cuts? */
62  SCIP_DECL_SEPACOPY ((*sepacopy)), /**< copy method of separator or NULL if you don't want to copy your plugin into sub-SCIPs */
63  SCIP_DECL_SEPAFREE ((*sepafree)), /**< destructor of separator */
64  SCIP_DECL_SEPAINIT ((*sepainit)), /**< initialize separator */
65  SCIP_DECL_SEPAEXIT ((*sepaexit)), /**< deinitialize separator */
66  SCIP_DECL_SEPAINITSOL ((*sepainitsol)), /**< solving process initialization method of separator */
67  SCIP_DECL_SEPAEXITSOL ((*sepaexitsol)), /**< solving process deinitialization method of separator */
68  SCIP_DECL_SEPAEXECLP ((*sepaexeclp)), /**< LP solution separation method of separator */
69  SCIP_DECL_SEPAEXECSOL ((*sepaexecsol)), /**< arbitrary primal solution separation method of separator */
70  SCIP_SEPADATA* sepadata /**< separator data */
71  );
72 
73 /** calls destructor and frees memory of separator */
75  SCIP_SEPA** sepa, /**< pointer to separator data structure */
76  SCIP_SET* set /**< global SCIP settings */
77  );
78 
79 /** initializes separator */
81  SCIP_SEPA* sepa, /**< separator */
82  SCIP_SET* set /**< global SCIP settings */
83  );
84 
85 /** calls exit method of separator */
87  SCIP_SEPA* sepa, /**< separator */
88  SCIP_SET* set /**< global SCIP settings */
89  );
90 
91 /** informs separator that the branch and bound process is being started */
93  SCIP_SEPA* sepa, /**< separator */
94  SCIP_SET* set /**< global SCIP settings */
95  );
96 
97 /** informs separator that the branch and bound process data is being freed */
99  SCIP_SEPA* sepa, /**< separator */
100  SCIP_SET* set /**< global SCIP settings */
101  );
102 
103 /** calls LP separation method of separator */
105  SCIP_SEPA* sepa, /**< separator */
106  SCIP_SET* set, /**< global SCIP settings */
107  SCIP_STAT* stat, /**< dynamic problem statistics */
108  SCIP_SEPASTORE* sepastore, /**< separation storage */
109  int depth, /**< depth of current node */
110  SCIP_Real bounddist, /**< current relative distance of local dual bound to global dual bound */
111  SCIP_Bool allowlocal, /**< should the separator be asked to separate local cuts */
112  SCIP_Bool execdelayed, /**< execute separator even if it is marked to be delayed */
113  SCIP_RESULT* result /**< pointer to store the result of the callback method */
114  );
115 
116 /** calls primal solution separation method of separator */
118  SCIP_SEPA* sepa, /**< separator */
119  SCIP_SET* set, /**< global SCIP settings */
120  SCIP_STAT* stat, /**< dynamic problem statistics */
121  SCIP_SEPASTORE* sepastore, /**< separation storage */
122  SCIP_SOL* sol, /**< primal solution that should be separated */
123  int depth, /**< depth of current node */
124  SCIP_Bool allowlocal, /**< should the separator be asked to separate local cuts */
125  SCIP_Bool execdelayed, /**< execute separator even if it is marked to be delayed */
126  SCIP_RESULT* result /**< pointer to store the result of the callback method */
127  );
128 
129 /** sets priority of separator */
131  SCIP_SEPA* sepa, /**< separator */
132  SCIP_SET* set, /**< global SCIP settings */
133  int priority /**< new priority of the separator */
134  );
135 
136 /** sets copy method of separator */
137 void SCIPsepaSetCopy(
138  SCIP_SEPA* sepa, /**< separator */
139  SCIP_DECL_SEPACOPY ((*sepacopy)) /**< copy method of separator or NULL if you don't want to copy your plugin into sub-SCIPs */
140  );
141 
142 /** sets destructor method of separator */
143 void SCIPsepaSetFree(
144  SCIP_SEPA* sepa, /**< separator */
145  SCIP_DECL_SEPAFREE ((*sepafree)) /**< destructor of separator */
146  );
147 
148 /** sets initialization method of separator */
149 void SCIPsepaSetInit(
150  SCIP_SEPA* sepa, /**< separator */
151  SCIP_DECL_SEPAINIT ((*sepainit)) /**< initialize separator */
152  );
153 
154 /** sets deinitialization method of separator */
155 void SCIPsepaSetExit(
156  SCIP_SEPA* sepa, /**< separator */
157  SCIP_DECL_SEPAEXIT ((*sepaexit)) /**< deinitialize separator */
158  );
159 
160 /** sets solving process initialization method of separator */
161 void SCIPsepaSetInitsol(
162  SCIP_SEPA* sepa, /**< separator */
163  SCIP_DECL_SEPAINITSOL ((*sepainitsol)) /**< solving process initialization method of separator */
164  );
165 
166 /** sets solving process deinitialization method of separator */
167 void SCIPsepaSetExitsol(
168  SCIP_SEPA* sepa, /**< separator */
169  SCIP_DECL_SEPAEXITSOL ((*sepaexitsol)) /**< solving process deinitialization method of separator */
170  );
171 
172 /** declares separator to be a parent separator */
174  SCIP_SEPA* sepa /**< separator */
175  );
176 
177 /** sets the parent separator */
179  SCIP_SEPA* sepa, /**< separator */
180  SCIP_SEPA* parentsepa /**< parent separator */
181  );
182 
183 /** enables or disables all clocks of \p sepa, depending on the value of the flag */
185  SCIP_SEPA* sepa, /**< the separator for which all clocks should be enabled or disabled */
186  SCIP_Bool enable /**< should the clocks of the separator be enabled? */
187  );
188 
189 /** increase count of applied cuts by one */
191  SCIP_SEPA* sepa, /**< separator */
192  SCIP_Bool fromcutpool /**< whether the cuts were added from the cutpool to sepastore */
193  );
194 
195 /** increase count of found cuts by one */
197  SCIP_SEPA* sepa, /**< separator */
198  SCIP_Bool fromcutpool /**< whether the cuts were added from the cutpool to sepastore */
199  );
200 
201 /** decrease the count of added cuts by one */
203  SCIP_SEPA* sepa, /**< separator */
204  SCIP_Bool fromcutpool /**< whether the cuts were added from the cutpool to sepastore */
205  );
206 
207 /** increase count of found cuts by one */
209  SCIP_SEPA* sepa /**< separator */
210  );
211 
212 /** increase count of found cuts at current node by one */
214  SCIP_SEPA* sepa /**< separator */
215  );
216 
217 #ifdef __cplusplus
218 }
219 #endif
220 
221 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
SCIP_RETCODE SCIPsepaCopyInclude(SCIP_SEPA *sepa, SCIP_SET *set)
Definition: sepa.c:70
void SCIPsepaIncNCutsFound(SCIP_SEPA *sepa)
Definition: sepa.c:1030
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:194
SCIP_RETCODE SCIPsepaFree(SCIP_SEPA **sepa, SCIP_SET *set)
Definition: sepa.c:233
void SCIPsepaDecNCutsAdded(SCIP_SEPA *sepa, SCIP_Bool fromcutpool)
Definition: sepa.c:1007
void SCIPsepaEnableOrDisableClocks(SCIP_SEPA *sepa, SCIP_Bool enable)
Definition: sepa.c:819
void SCIPsepaSetExit(SCIP_SEPA *sepa, SCIP_DECL_SEPAEXIT((*sepaexit)))
Definition: sepa.c:680
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
type definitions for global SCIP settings
SCIP_RETCODE SCIPsepaInitsol(SCIP_SEPA *sepa, SCIP_SET *set)
Definition: sepa.c:343
type definitions for return codes for SCIP methods
#define SCIP_DECL_SEPAEXECLP(x)
Definition: type_sepa.h:127
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:512
type definitions for problem statistics
#define SCIP_DECL_SEPACOPY(x)
Definition: type_sepa.h:52
SCIP_RETCODE SCIPsepaInit(SCIP_SEPA *sepa, SCIP_SET *set)
Definition: sepa.c:260
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:394
void SCIPsepaSetCopy(SCIP_SEPA *sepa, SCIP_DECL_SEPACOPY((*sepacopy)))
Definition: sepa.c:647
void SCIPsepaIncNCutsFoundAtNode(SCIP_SEPA *sepa)
Definition: sepa.c:1040
void SCIPsepaSetExitsol(SCIP_SEPA *sepa, SCIP_DECL_SEPAEXITSOL((*sepaexitsol)))
Definition: sepa.c:702
void SCIPsepaSetInitsol(SCIP_SEPA *sepa, SCIP_DECL_SEPAINITSOL((*sepainitsol)))
Definition: sepa.c:691
type definitions for storing separated cuts
#define SCIP_Bool
Definition: def.h:84
#define SCIP_DECL_SEPAINIT(x)
Definition: type_sepa.h:68
void SCIPsepaIncNCutsAdded(SCIP_SEPA *sepa, SCIP_Bool fromcutpool)
Definition: sepa.c:984
void SCIPsepaIncNCutsApplied(SCIP_SEPA *sepa, SCIP_Bool fromcutpool)
Definition: sepa.c:962
#define SCIP_DECL_SEPAEXITSOL(x)
Definition: type_sepa.h:98
#define SCIP_DECL_SEPAEXECSOL(x)
Definition: type_sepa.h:157
SCIP_RETCODE SCIPsepaExitsol(SCIP_SEPA *sepa, SCIP_SET *set)
Definition: sepa.c:370
void SCIPsepaSetParentsepa(SCIP_SEPA *sepa, SCIP_SEPA *parentsepa)
Definition: sepa.c:723
void SCIPsepaSetPriority(SCIP_SEPA *sepa, SCIP_SET *set, int priority)
Definition: sepa.c:764
#define SCIP_DECL_SEPAEXIT(x)
Definition: type_sepa.h:76
type definitions for separators
#define SCIP_DECL_SEPAINITSOL(x)
Definition: type_sepa.h:87
SCIP_RETCODE SCIPsepaExit(SCIP_SEPA *sepa, SCIP_SET *set)
Definition: sepa.c:313
#define SCIP_Real
Definition: def.h:177
result codes for SCIP callback methods
void SCIPsepaSetFree(SCIP_SEPA *sepa, SCIP_DECL_SEPAFREE((*sepafree)))
Definition: sepa.c:658
public methods for separators
void SCIPsepaSetInit(SCIP_SEPA *sepa, SCIP_DECL_SEPAINIT((*sepainit)))
Definition: sepa.c:669
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:430
#define SCIP_DECL_SEPAFREE(x)
Definition: type_sepa.h:60
struct SCIP_SepaData SCIP_SEPADATA
Definition: type_sepa.h:43
void SCIPsepaSetIsParentsepa(SCIP_SEPA *sepa)
Definition: sepa.c:713
memory allocation routines