Scippy

SCIP

Solving Constraint Integer Programs

pub_event.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 pub_event.h
26  * @ingroup PUBLICCOREAPI
27  * @brief public methods for managing events
28  * @author Tobias Achterberg
29  */
30 
31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32 
33 #ifndef __SCIP_PUB_EVENT_H__
34 #define __SCIP_PUB_EVENT_H__
35 
36 
37 #include "scip/def.h"
38 #include "scip/type_event.h"
39 #include "scip/type_lp.h"
40 #include "scip/type_sol.h"
41 #include "scip/type_tree.h"
42 #include "scip/type_var.h"
43 
44 /* In optimized mode, some function calls are overwritten by defines to reduce the number of function calls and
45  * speed up the algorithms. For this, we need to include struct_event.h.
46  */
47 #ifdef NDEBUG
48 #include "scip/struct_event.h"
49 #endif
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 /*
56  * Event handler methods
57  */
58 
59 /**@addtogroup PublicEventHandlerMethods
60  *
61  * @{
62  */
63 
64 /** gets name of event handler */
65 SCIP_EXPORT
66 const char* SCIPeventhdlrGetName(
67  SCIP_EVENTHDLR* eventhdlr /**< event handler */
68  );
69 
70 /** gets user data of event handler */
71 SCIP_EXPORT
73  SCIP_EVENTHDLR* eventhdlr /**< event handler */
74  );
75 
76 /** sets user data of event handler; user has to free old data in advance! */
77 SCIP_EXPORT
79  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
80  SCIP_EVENTHDLRDATA* eventhdlrdata /**< new event handler user data */
81  );
82 
83 /** is event handler initialized? */
84 SCIP_EXPORT
86  SCIP_EVENTHDLR* eventhdlr /**< event handler */
87  );
88 
89 /** gets time in seconds used in this event handler for setting up for next stages */
90 SCIP_EXPORT
92  SCIP_EVENTHDLR* eventhdlr /**< event handler */
93  );
94 
95 /** gets time in seconds used in this event handler */
96 SCIP_EXPORT
98  SCIP_EVENTHDLR* eventhdlr /**< event handler */
99  );
100 
101 /** @} */
102 
103 /*
104  * Event methods
105  */
106 
107 /**@addtogroup PublicEventMethods
108  *
109  * @{
110  */
111 
112 /** gets type of event */
113 SCIP_EXPORT
115  SCIP_EVENT* event /**< event */
116  );
117 
118 /** gets variable for a variable event (var added, var deleted, var fixed,
119  * objective value or domain change, domain hole added or removed) */
120 SCIP_EXPORT
122  SCIP_EVENT* event /**< event */
123  );
124 
125 /** gets old objective value for an objective value change event */
126 SCIP_EXPORT
128  SCIP_EVENT* event /**< event */
129  );
130 
131 /** gets new objective value for an objective value change event */
132 SCIP_EXPORT
134  SCIP_EVENT* event /**< event */
135  );
136 
137 /** gets old bound for a bound change event */
138 SCIP_EXPORT
140  SCIP_EVENT* event /**< event */
141  );
142 
143 /** gets new bound for a bound change event */
144 SCIP_EXPORT
146  SCIP_EVENT* event /**< event */
147  );
148 
149 /** gets old variable type for a variable type change event */
150 SCIP_EXPORT
152  SCIP_EVENT* event /**< event */
153  );
154 
155 /** gets new variable type for a variable type change event */
156 SCIP_EXPORT
158  SCIP_EVENT* event /**< event */
159  );
160 
161 /** gets node for a node or LP event */
162 SCIP_EXPORT
164  SCIP_EVENT* event /**< event */
165  );
166 
167 /** gets solution for a primal solution event */
168 SCIP_EXPORT
170  SCIP_EVENT* event /**< event */
171  );
172 
173 /** gets the left bound of open interval in the hole */
174 SCIP_EXPORT
176  SCIP_EVENT* event /**< event */
177  );
178 
179 /** gets the right bound of open interval in the hole */
180 SCIP_EXPORT
182  SCIP_EVENT* event /**< event */
183  );
184 
185 /** gets row for a row event */
186 SCIP_EXPORT
188  SCIP_EVENT* event /**< event */
189  );
190 
191 /** gets column for a row change coefficient event */
192 SCIP_EXPORT
194  SCIP_EVENT* event /**< event */
195  );
196 
197 /** gets old coefficient value for a row change coefficient event */
198 SCIP_EXPORT
200  SCIP_EVENT* event /**< event */
201  );
202 
203 /** gets new coefficient value for a row change coefficient event */
204 SCIP_EXPORT
206  SCIP_EVENT* event /**< event */
207  );
208 
209 /** gets old constant value for a row change constant event */
210 SCIP_EXPORT
212  SCIP_EVENT* event /**< event */
213  );
214 
215 /** gets new constant value for a row change constant event */
216 SCIP_EXPORT
218  SCIP_EVENT* event /**< event */
219  );
220 
221 /** gets side for a row change side event */
222 SCIP_EXPORT
224  SCIP_EVENT* event /**< event */
225  );
226 
227 /** gets old side value for a row change side event */
228 SCIP_EXPORT
230  SCIP_EVENT* event /**< event */
231  );
232 
233 /** gets new side value for a row change side event */
234 SCIP_EXPORT
236  SCIP_EVENT* event /**< event */
237  );
238 
239 #ifdef NDEBUG
240 
241 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
242  * speed up the algorithms.
243  */
244 
245 #define SCIPeventGetType(event) ((event)->eventtype)
246 #define SCIPeventGetOldobj(event) ((event)->data.eventobjchg.oldobj)
247 #define SCIPeventGetNewobj(event) ((event)->data.eventobjchg.newobj)
248 #define SCIPeventGetOldbound(event) ((event)->data.eventbdchg.oldbound)
249 #define SCIPeventGetNewbound(event) ((event)->data.eventbdchg.newbound)
250 #define SCIPeventGetOldtype(event) ((event)->data.eventtypechg.oldtype)
251 #define SCIPeventGetNewtype(event) ((event)->data.eventtypechg.newtype)
252 #define SCIPeventGetNode(event) ((event)->data.node)
253 #define SCIPeventGetSol(event) ((event)->data.sol)
254 #define SCIPeventGetRowCol(event) ((event)->data.eventrowcoefchanged.col)
255 #define SCIPeventGetRowOldCoefVal(event) ((event)->data.eventrowcoefchanged.oldval)
256 #define SCIPeventGetRowNewCoefVal(event) ((event)->data.eventrowcoefchanged.newval)
257 #define SCIPeventGetRowOldConstVal(event) ((event)->data.eventrowconstchanged.oldval)
258 #define SCIPeventGetRowNewConstVal(event) ((event)->data.eventrowconstchanged.newval)
259 #define SCIPeventGetRowSide(event) ((event)->data.eventrowsidechanged.side)
260 #define SCIPeventGetRowOldSideVal(event) ((event)->data.eventrowsidechanged.oldval)
261 #define SCIPeventGetRowNewSideVal(event) ((event)->data.eventrowsidechanged.newval)
262 
263 #endif
264 
265 /** @} */
266 
267 #ifdef __cplusplus
268 }
269 #endif
270 
271 #endif
SCIP_Real SCIPeventGetRowNewSideVal(SCIP_EVENT *event)
Definition: event.c:1557
SCIP_SIDETYPE SCIPeventGetRowSide(SCIP_EVENT *event)
Definition: event.c:1523
SCIP_Real SCIPeventGetRowNewConstVal(SCIP_EVENT *event)
Definition: event.c:1506
SCIP_VARTYPE SCIPeventGetNewtype(SCIP_EVENT *event)
Definition: event.c:1283
struct SCIP_EventhdlrData SCIP_EVENTHDLRDATA
Definition: type_event.h:155
datastructures for managing events
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
Definition: event.c:324
SCIP_ROW * SCIPeventGetRow(SCIP_EVENT *event)
Definition: event.c:1408
SCIP_Real SCIPeventGetRowOldSideVal(SCIP_EVENT *event)
Definition: event.c:1540
type definitions for LP management
void SCIPeventhdlrSetData(SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTHDLRDATA *eventhdlrdata)
Definition: event.c:344
SCIP_Real SCIPeventGetHoleLeft(SCIP_EVENT *event)
Definition: event.c:1374
SCIP_Real SCIPeventGetRowOldConstVal(SCIP_EVENT *event)
Definition: event.c:1489
SCIP_Real SCIPeventhdlrGetTime(SCIP_EVENTHDLR *eventhdlr)
Definition: event.c:466
SCIP_Real SCIPeventGetNewbound(SCIP_EVENT *event)
Definition: event.c:1242
SCIP_Real SCIPeventGetOldobj(SCIP_EVENT *event)
Definition: event.c:1184
SCIP_VARTYPE SCIPeventGetOldtype(SCIP_EVENT *event)
Definition: event.c:1266
SCIP_Bool SCIPeventhdlrIsInitialized(SCIP_EVENTHDLR *eventhdlr)
Definition: event.c:432
SCIP_NODE * SCIPeventGetNode(SCIP_EVENT *event)
Definition: event.c:1300
SCIP_Real SCIPeventhdlrGetSetupTime(SCIP_EVENTHDLR *eventhdlr)
Definition: event.c:454
SCIP_Real SCIPeventGetNewobj(SCIP_EVENT *event)
Definition: event.c:1201
type definitions for problem variables
SCIP_COL * SCIPeventGetRowCol(SCIP_EVENT *event)
Definition: event.c:1438
type definitions for managing events
SCIP_VAR * SCIPeventGetVar(SCIP_EVENT *event)
Definition: event.c:1053
SCIP_Real SCIPeventGetRowNewCoefVal(SCIP_EVENT *event)
Definition: event.c:1472
#define SCIP_Bool
Definition: def.h:93
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
Definition: event.c:1030
type definitions for branch and bound tree
type definitions for storing primal CIP solutions
SCIP_Real SCIPeventGetRowOldCoefVal(SCIP_EVENT *event)
Definition: event.c:1455
SCIP_Real SCIPeventGetOldbound(SCIP_EVENT *event)
Definition: event.c:1218
SCIP_Real SCIPeventGetHoleRight(SCIP_EVENT *event)
Definition: event.c:1391
#define SCIP_Real
Definition: def.h:186
enum SCIP_Vartype SCIP_VARTYPE
Definition: type_var.h:69
common defines and data types used in all packages of SCIP
SCIP_EVENTHDLRDATA * SCIPeventhdlrGetData(SCIP_EVENTHDLR *eventhdlr)
Definition: event.c:334
SCIP_SOL * SCIPeventGetSol(SCIP_EVENT *event)
Definition: event.c:1337
uint64_t SCIP_EVENTTYPE
Definition: type_event.h:151
enum SCIP_SideType SCIP_SIDETYPE
Definition: type_lp.h:67