Scippy

SCIP

Solving Constraint Integer Programs

benderscut.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-2018 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 benderscut.h
17  * @ingroup INTERNALAPI
18  * @brief internal methods for Benders' decomposition cuts
19  * @author Stephen J. Maher
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_BENDERSCUT_H__
25 #define __SCIP_BENDERSCUT_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_benderscut.h"
34 #include "scip/pub_benderscut.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /** copies the given Benders' decomposition cut to a new scip */
41 extern
43  SCIP_BENDERS* benders, /**< the Benders' decomposition that the cuts are copied to */
44  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
45  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
46  );
47 
48 /** creates a Benders' decomposition cut */
49 extern
51  SCIP_BENDERS* benders, /**< Benders' decomposition */
52  SCIP_BENDERSCUT** benderscut, /**< pointer to the Benders' decomposition cut data structure */
53  SCIP_SET* set, /**< global SCIP settings */
54  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
55  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
56  const char* name, /**< name of the Benders' decomposition cut */
57  const char* desc, /**< description of the Benders' decomposition cut */
58  int priority, /**< priority of the Benders' decomposition cut */
59  SCIP_Bool islpcut, /**< indicates whether the cut is generated from the LP solution */
60  SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy)),/**< copy method of the Benders' decomposition cut or NULL if you don't want to copy your plugin into sub-SCIPs */
61  SCIP_DECL_BENDERSCUTFREE((*benderscutfree)),/**< destructor of the Benders' decomposition cut */
62  SCIP_DECL_BENDERSCUTINIT((*benderscutinit)),/**< initialize Benders' decomposition cut */
63  SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)),/**< deinitialize Benders' decomposition cut */
64  SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol)),/**< solving process initialization method of the Benders' decomposition cut */
65  SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)),/**< solving process deinitialization method of the Benders' decomposition cut */
66  SCIP_DECL_BENDERSCUTEXEC((*benderscutexec)),/**< execution method of the Benders' decomposition cut */
67  SCIP_BENDERSCUTDATA* benderscutdata /**< Benders' decomposition cut data */
68  );
69 
70 /** calls destructor and frees memory of the Benders' decomposition cut */
71 extern
73  SCIP_BENDERSCUT** benderscut, /**< pointer to the Benders' decomposition cut data structure */
74  SCIP_SET* set /**< global SCIP settings */
75  );
76 
77 /** initializes the Benders' decomposition cut */
78 extern
80  SCIP_BENDERSCUT* benderscut, /**< the Benders' decomposition cut */
81  SCIP_SET* set /**< global SCIP settings */
82  );
83 
84 /** calls exit method of the Benders' decomposition cut */
85 extern
87  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
88  SCIP_SET* set /**< global SCIP settings */
89  );
90 
91 /** informs the Benders' decomposition cut that the branch and bound process is being started */
92 extern
94  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
95  SCIP_SET* set /**< global SCIP settings */
96  );
97 
98 /** informs the Benders' decomposition cut that the branch and bound process data is being freed */
99 extern
101  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
102  SCIP_SET* set /**< global SCIP settings */
103  );
104 
105 /** calls execution method of the Benders' decomposition cut */
106 extern
108  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
109  SCIP_SET* set, /**< global SCIP settings */
110  SCIP_BENDERS* benders, /**< Benders' decomposition */
111  SCIP_SOL* sol, /**< primal CIP solution */
112  int probnumber, /**< the number of the subproblem for which the cut is generated */
113  SCIP_BENDERSENFOTYPE type, /**< the enforcement type calling this function */
114  SCIP_RESULT* result /**< pointer to store the result of the callback method */
115  );
116 
117 /** sets priority of the Benders' decomposition cut */
118 extern
120  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
121  int priority /**< new priority of the Benders' decomposition cut */
122  );
123 
124 /** sets copy callback of the Benders' decomposition cut */
125 extern
127  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
128  SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy))/**< copy callback of the Benders' decomposition cut or NULL if you don't want to copy your plugin into sub-SCIPs */
129  );
130 
131 /** sets destructor callback of the Benders' decomposition cut */
132 extern
134  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
135  SCIP_DECL_BENDERSCUTFREE((*benderscutfree))/**< destructor of the Benders' decomposition cut */
136  );
137 
138 /** sets initialization callback of the Benders' decomposition cut */
139 extern
141  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
142  SCIP_DECL_BENDERSCUTINIT((*benderscutinit))/**< initialize the Benders' decomposition cut */
143  );
144 
145 /** sets deinitialization callback of the Benders' decomposition cut */
146 extern
148  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
149  SCIP_DECL_BENDERSCUTEXIT((*benderscutexit))/**< deinitialize the Benders' decomposition cut */
150  );
151 
152 /** sets solving process initialization callback of the Benders' decomposition cut */
153 extern
155  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
156  SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol))/**< solving process initialization callback of the Benders' decomposition cut */
157  );
158 
159 /** sets solving process deinitialization callback of the Benders' decomposition cut */
160 extern
162  SCIP_BENDERSCUT* benderscut, /**< the Benders' decomposition cut */
163  SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol))/**< solving process deinitialization callback of the Benders' decomposition cut */
164  );
165 
166 /** adds the generated constraint to the Benders cut storage */
167 extern
169  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
170  SCIP_SET* set, /**< global SCIP settings */
171  SCIP_CONS* cons /**< the constraint to be added to the Benders' cut storage */
172  );
173 
174 /** adds the generated cuts to the Benders' cut storage */
175 extern
177  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
178  SCIP_SET* set, /**< global SCIP settings */
179  SCIP_ROW* cut /**< the cut to be added to the Benders' cut storage */
180  );
181 
182 #ifdef __cplusplus
183 }
184 #endif
185 
186 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
void SCIPbenderscutSetPriority(SCIP_BENDERSCUT *benderscut, int priority)
Definition: benderscut.c:519
struct SCIP_BenderscutData SCIP_BENDERSCUTDATA
SCIP_RETCODE SCIPbenderscutStoreCut(SCIP_BENDERSCUT *benderscut, SCIP_SET *set, SCIP_ROW *cut)
Definition: benderscut.c:646
SCIP_RETCODE SCIPbenderscutExec(SCIP_BENDERSCUT *benderscut, SCIP_SET *set, SCIP_BENDERS *benders, SCIP_SOL *sol, int probnumber, SCIP_BENDERSENFOTYPE type, SCIP_RESULT *result)
Definition: benderscut.c:343
#define SCIP_DECL_BENDERSCUTFREE(x)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
enum SCIP_BendersEnfoType SCIP_BENDERSENFOTYPE
Definition: type_benders.h:42
type definitions for global SCIP settings
SCIP_RETCODE SCIPbenderscutCopyInclude(SCIP_BENDERS *benders, SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:78
type definitions for return codes for SCIP methods
#define SCIP_DECL_BENDERSCUTEXEC(x)
void SCIPbenderscutSetInitsol(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol)))
Definition: benderscut.c:467
void SCIPbenderscutSetExit(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)))
Definition: benderscut.c:456
#define SCIP_DECL_BENDERSCUTCOPY(x)
#define SCIP_DECL_BENDERSCUTINIT(x)
SCIP_RETCODE SCIPbenderscutStoreCons(SCIP_BENDERSCUT *benderscut, SCIP_SET *set, SCIP_CONS *cons)
Definition: benderscut.c:616
SCIP_RETCODE SCIPbenderscutInitsol(SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:295
#define SCIP_DECL_BENDERSCUTEXIT(x)
SCIP_RETCODE SCIPbenderscutFree(SCIP_BENDERSCUT **benderscut, SCIP_SET *set)
Definition: benderscut.c:167
#define SCIP_Bool
Definition: def.h:62
void SCIPbenderscutSetExitsol(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)))
Definition: benderscut.c:478
void SCIPbenderscutSetFree(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTFREE((*benderscutfree)))
Definition: benderscut.c:434
type definitions for Benders&#39; decomposition cut
public methods for Benders&#39; decomposition cuts
SCIP_RETCODE SCIPbenderscutInit(SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:193
result codes for SCIP callback methods
#define SCIP_DECL_BENDERSCUTEXITSOL(x)
SCIP_RETCODE SCIPbenderscutCreate(SCIP_BENDERS *benders, SCIP_BENDERSCUT **benderscut, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, SCIP_Bool islpcut, SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy)), SCIP_DECL_BENDERSCUTFREE((*benderscutfree)), SCIP_DECL_BENDERSCUTINIT((*benderscutinit)), SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)), SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol)), SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)), SCIP_DECL_BENDERSCUTEXEC((*benderscutexec)), SCIP_BENDERSCUTDATA *benderscutdata)
Definition: benderscut.c:98
SCIP_RETCODE SCIPbenderscutExitsol(SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:319
void SCIPbenderscutSetInit(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTINIT((*benderscutinit)))
Definition: benderscut.c:445
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:419
void SCIPbenderscutSetCopy(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy)))
Definition: benderscut.c:423
SCIP_RETCODE SCIPbenderscutExit(SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:245
#define SCIP_DECL_BENDERSCUTINITSOL(x)
memory allocation routines