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-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 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/type_benders.h"
35 #include "scip/pub_benderscut.h"
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 /** copies the given Benders' decomposition cut to a new scip */
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 */
50  SCIP_BENDERS* benders, /**< Benders' decomposition */
51  SCIP_BENDERSCUT** benderscut, /**< pointer to the Benders' decomposition cut data structure */
52  SCIP_SET* set, /**< global SCIP settings */
53  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
54  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
55  const char* name, /**< name of the Benders' decomposition cut */
56  const char* desc, /**< description of the Benders' decomposition cut */
57  int priority, /**< priority of the Benders' decomposition cut */
58  SCIP_Bool islpcut, /**< indicates whether the cut is generated from the LP solution */
59  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 */
60  SCIP_DECL_BENDERSCUTFREE((*benderscutfree)),/**< destructor of the Benders' decomposition cut */
61  SCIP_DECL_BENDERSCUTINIT((*benderscutinit)),/**< initialize Benders' decomposition cut */
62  SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)),/**< deinitialize Benders' decomposition cut */
63  SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol)),/**< solving process initialization method of the Benders' decomposition cut */
64  SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)),/**< solving process deinitialization method of the Benders' decomposition cut */
65  SCIP_DECL_BENDERSCUTEXEC((*benderscutexec)),/**< execution method of the Benders' decomposition cut */
66  SCIP_BENDERSCUTDATA* benderscutdata /**< Benders' decomposition cut data */
67  );
68 
69 /** calls destructor and frees memory of the Benders' decomposition cut */
71  SCIP_BENDERSCUT** benderscut, /**< pointer to the Benders' decomposition cut data structure */
72  SCIP_SET* set /**< global SCIP settings */
73  );
74 
75 /** initializes the Benders' decomposition cut */
77  SCIP_BENDERSCUT* benderscut, /**< the Benders' decomposition cut */
78  SCIP_SET* set /**< global SCIP settings */
79  );
80 
81 /** calls exit method of the Benders' decomposition cut */
83  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
84  SCIP_SET* set /**< global SCIP settings */
85  );
86 
87 /** informs the Benders' decomposition cut that the branch and bound process is being started */
89  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
90  SCIP_SET* set /**< global SCIP settings */
91  );
92 
93 /** informs the Benders' decomposition cut that the branch and bound process data is being freed */
95  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
96  SCIP_SET* set /**< global SCIP settings */
97  );
98 
99 /** calls execution method of the Benders' decomposition cut */
101  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
102  SCIP_SET* set, /**< global SCIP settings */
103  SCIP_BENDERS* benders, /**< Benders' decomposition */
104  SCIP_SOL* sol, /**< primal CIP solution */
105  int probnumber, /**< the number of the subproblem for which the cut is generated */
106  SCIP_BENDERSENFOTYPE type, /**< the enforcement type calling this function */
107  SCIP_RESULT* result /**< pointer to store the result of the callback method */
108  );
109 
110 /** sets priority of the Benders' decomposition cut */
112  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
113  int priority /**< new priority of the Benders' decomposition cut */
114  );
115 
116 /** sets copy callback of the Benders' decomposition cut */
118  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
119  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 */
120  );
121 
122 /** sets destructor callback of the Benders' decomposition cut */
124  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
125  SCIP_DECL_BENDERSCUTFREE((*benderscutfree))/**< destructor of the Benders' decomposition cut */
126  );
127 
128 /** sets initialization callback of the Benders' decomposition cut */
130  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
131  SCIP_DECL_BENDERSCUTINIT((*benderscutinit))/**< initialize the Benders' decomposition cut */
132  );
133 
134 /** sets deinitialization callback of the Benders' decomposition cut */
136  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
137  SCIP_DECL_BENDERSCUTEXIT((*benderscutexit))/**< deinitialize the Benders' decomposition cut */
138  );
139 
140 /** sets solving process initialization callback of the Benders' decomposition cut */
142  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
143  SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol))/**< solving process initialization callback of the Benders' decomposition cut */
144  );
145 
146 /** sets solving process deinitialization callback of the Benders' decomposition cut */
148  SCIP_BENDERSCUT* benderscut, /**< the Benders' decomposition cut */
149  SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol))/**< solving process deinitialization callback of the Benders' decomposition cut */
150  );
151 
152 /** adds the data for the generated cuts to the Benders' cut storage */
154  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
155  SCIP_SET* set, /**< global SCIP settings */
156  SCIP_VAR** vars, /**< the variables that have non-zero coefficients in the cut */
157  SCIP_Real* vals, /**< the coefficients of the variables in the cut */
158  SCIP_Real lhs, /**< the left hand side of the cut */
159  SCIP_Real rhs, /**< the right hand side of the cut */
160  int nvars /**< the number of variables with non-zero coefficients in the cut */
161  );
162 
163 #ifdef __cplusplus
164 }
165 #endif
166 
167 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
void SCIPbenderscutSetPriority(SCIP_BENDERSCUT *benderscut, int priority)
Definition: benderscut.c:538
struct SCIP_BenderscutData SCIP_BENDERSCUTDATA
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:362
#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
SCIP_RETCODE SCIPbenderscutStoreCut(SCIP_BENDERSCUT *benderscut, SCIP_SET *set, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, int nvars)
Definition: benderscut.c:637
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:486
void SCIPbenderscutSetExit(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)))
Definition: benderscut.c:475
#define SCIP_DECL_BENDERSCUTCOPY(x)
#define SCIP_DECL_BENDERSCUTINIT(x)
SCIP_RETCODE SCIPbenderscutInitsol(SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:314
#define SCIP_DECL_BENDERSCUTEXIT(x)
SCIP_RETCODE SCIPbenderscutFree(SCIP_BENDERSCUT **benderscut, SCIP_SET *set)
Definition: benderscut.c:198
#define SCIP_Bool
Definition: def.h:70
void SCIPbenderscutSetExitsol(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)))
Definition: benderscut.c:497
void SCIPbenderscutSetFree(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTFREE((*benderscutfree)))
Definition: benderscut.c:453
type definitions for Benders&#39; decomposition methods
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:224
#define SCIP_Real
Definition: def.h:164
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:165
SCIP_RETCODE SCIPbenderscutExitsol(SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:338
void SCIPbenderscutSetInit(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTINIT((*benderscutinit)))
Definition: benderscut.c:464
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:427
void SCIPbenderscutSetCopy(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy)))
Definition: benderscut.c:442
SCIP_RETCODE SCIPbenderscutExit(SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:270
#define SCIP_DECL_BENDERSCUTINITSOL(x)
memory allocation routines