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-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 benderscut.h
26  * @ingroup INTERNALAPI
27  * @brief internal methods for Benders' decomposition cuts
28  * @author Stephen J. Maher
29  */
30 
31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32 
33 #ifndef __SCIP_BENDERSCUT_H__
34 #define __SCIP_BENDERSCUT_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_benderscut.h"
43 #include "scip/type_benders.h"
44 #include "scip/pub_benderscut.h"
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 /** copies the given Benders' decomposition cut to a new scip */
52  SCIP_BENDERS* benders, /**< the Benders' decomposition that the cuts are copied to */
53  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
54  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
55  );
56 
57 /** creates a Benders' decomposition cut */
59  SCIP_BENDERS* benders, /**< Benders' decomposition */
60  SCIP_BENDERSCUT** benderscut, /**< pointer to the Benders' decomposition cut data structure */
61  SCIP_SET* set, /**< global SCIP settings */
62  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
63  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
64  const char* name, /**< name of the Benders' decomposition cut */
65  const char* desc, /**< description of the Benders' decomposition cut */
66  int priority, /**< priority of the Benders' decomposition cut */
67  SCIP_Bool islpcut, /**< indicates whether the cut is generated from the LP solution */
68  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 */
69  SCIP_DECL_BENDERSCUTFREE((*benderscutfree)),/**< destructor of the Benders' decomposition cut */
70  SCIP_DECL_BENDERSCUTINIT((*benderscutinit)),/**< initialize Benders' decomposition cut */
71  SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)),/**< deinitialize Benders' decomposition cut */
72  SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol)),/**< solving process initialization method of the Benders' decomposition cut */
73  SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)),/**< solving process deinitialization method of the Benders' decomposition cut */
74  SCIP_DECL_BENDERSCUTEXEC((*benderscutexec)),/**< execution method of the Benders' decomposition cut */
75  SCIP_BENDERSCUTDATA* benderscutdata /**< Benders' decomposition cut data */
76  );
77 
78 /** calls destructor and frees memory of the Benders' decomposition cut */
80  SCIP_BENDERSCUT** benderscut, /**< pointer to the Benders' decomposition cut data structure */
81  SCIP_SET* set /**< global SCIP settings */
82  );
83 
84 /** initializes the Benders' decomposition cut */
86  SCIP_BENDERSCUT* benderscut, /**< the Benders' decomposition cut */
87  SCIP_SET* set /**< global SCIP settings */
88  );
89 
90 /** calls exit method of the Benders' decomposition cut */
92  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
93  SCIP_SET* set /**< global SCIP settings */
94  );
95 
96 /** informs the Benders' decomposition cut that the branch and bound process is being started */
98  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
99  SCIP_SET* set /**< global SCIP settings */
100  );
101 
102 /** informs the Benders' decomposition cut that the branch and bound process data is being freed */
104  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
105  SCIP_SET* set /**< global SCIP settings */
106  );
107 
108 /** calls execution method of the Benders' decomposition cut */
110  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
111  SCIP_SET* set, /**< global SCIP settings */
112  SCIP_BENDERS* benders, /**< Benders' decomposition */
113  SCIP_SOL* sol, /**< primal CIP solution */
114  int probnumber, /**< the number of the subproblem for which the cut is generated */
115  SCIP_BENDERSENFOTYPE type, /**< the enforcement type calling this function */
116  SCIP_RESULT* result /**< pointer to store the result of the callback method */
117  );
118 
119 /** sets priority of the Benders' decomposition cut */
121  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
122  int priority /**< new priority of the Benders' decomposition cut */
123  );
124 
125 /** sets copy callback of the Benders' decomposition cut */
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 */
133  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
134  SCIP_DECL_BENDERSCUTFREE((*benderscutfree))/**< destructor of the Benders' decomposition cut */
135  );
136 
137 /** sets initialization callback of the Benders' decomposition cut */
139  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
140  SCIP_DECL_BENDERSCUTINIT((*benderscutinit))/**< initialize the Benders' decomposition cut */
141  );
142 
143 /** sets deinitialization callback of the Benders' decomposition cut */
145  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
146  SCIP_DECL_BENDERSCUTEXIT((*benderscutexit))/**< deinitialize the Benders' decomposition cut */
147  );
148 
149 /** sets solving process initialization callback of the Benders' decomposition cut */
151  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
152  SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol))/**< solving process initialization callback of the Benders' decomposition cut */
153  );
154 
155 /** sets solving process deinitialization callback of the Benders' decomposition cut */
157  SCIP_BENDERSCUT* benderscut, /**< the Benders' decomposition cut */
158  SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol))/**< solving process deinitialization callback of the Benders' decomposition cut */
159  );
160 
161 #ifdef __cplusplus
162 }
163 #endif
164 
165 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:61
void SCIPbenderscutSetPriority(SCIP_BENDERSCUT *benderscut, int priority)
Definition: benderscut.c:522
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:346
#define SCIP_DECL_BENDERSCUTFREE(x)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
enum SCIP_BendersEnfoType SCIP_BENDERSENFOTYPE
Definition: type_benders.h:51
type definitions for global SCIP settings
SCIP_RETCODE SCIPbenderscutCopyInclude(SCIP_BENDERS *benders, SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:86
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:470
void SCIPbenderscutSetExit(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)))
Definition: benderscut.c:459
#define SCIP_DECL_BENDERSCUTCOPY(x)
#define SCIP_DECL_BENDERSCUTINIT(x)
SCIP_RETCODE SCIPbenderscutInitsol(SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:298
#define SCIP_DECL_BENDERSCUTEXIT(x)
SCIP_RETCODE SCIPbenderscutFree(SCIP_BENDERSCUT **benderscut, SCIP_SET *set)
Definition: benderscut.c:203
#define SCIP_Bool
Definition: def.h:93
void SCIPbenderscutSetExitsol(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)))
Definition: benderscut.c:481
void SCIPbenderscutSetFree(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTFREE((*benderscutfree)))
Definition: benderscut.c:437
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:229
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:170
SCIP_RETCODE SCIPbenderscutExitsol(SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:322
void SCIPbenderscutSetInit(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTINIT((*benderscutinit)))
Definition: benderscut.c:448
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:439
void SCIPbenderscutSetCopy(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy)))
Definition: benderscut.c:426
SCIP_RETCODE SCIPbenderscutExit(SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:268
#define SCIP_DECL_BENDERSCUTINITSOL(x)
memory allocation routines