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 */
51   	SCIP_RETCODE SCIPbenderscutCopyInclude(
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 */
58   	SCIP_RETCODE SCIPbenderscutCreate(
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 */
79   	SCIP_RETCODE SCIPbenderscutFree(
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 */
85   	SCIP_RETCODE SCIPbenderscutInit(
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 */
91   	SCIP_RETCODE SCIPbenderscutExit(
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 */
97   	SCIP_RETCODE SCIPbenderscutInitsol(
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 */
103  	SCIP_RETCODE SCIPbenderscutExitsol(
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 */
109  	SCIP_RETCODE SCIPbenderscutExec(
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 */
120  	void SCIPbenderscutSetPriority(
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 */
126  	void SCIPbenderscutSetCopy(
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  	void SCIPbenderscutSetFree(
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 */
138  	void SCIPbenderscutSetInit(
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 */
144  	void SCIPbenderscutSetExit(
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 */
150  	void SCIPbenderscutSetInitsol(
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 */
156  	void SCIPbenderscutSetExitsol(
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
166