Scippy

SCIP

Solving Constraint Integer Programs

scip_nodesel.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 scip_nodesel.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for node selector plugins
19  * @author Tobias Achterberg
20  * @author Timo Berthold
21  * @author Thorsten Koch
22  * @author Alexander Martin
23  * @author Marc Pfetsch
24  * @author Kati Wolter
25  * @author Gregor Hendel
26  * @author Robert Lion Gottwald
27  */
28 
29 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
30 
31 #ifndef __SCIP_SCIP_NODESEL_H__
32 #define __SCIP_SCIP_NODESEL_H__
33 
34 
35 #include "scip/def.h"
36 #include "scip/type_nodesel.h"
37 #include "scip/type_retcode.h"
38 #include "scip/type_scip.h"
39 #include "scip/type_tree.h"
40 
41 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
42  * this structure except the interface methods in scip.c.
43  * In optimized mode, the structure is included in scip.h, because some of the methods
44  * are implemented as defines for performance reasons (e.g. the numerical comparisons).
45  * Additionally, the internal "set.h" is included, such that the defines in set.h are
46  * available in optimized mode.
47  */
48 #ifdef NDEBUG
49 #include "scip/struct_scip.h"
50 #include "scip/struct_stat.h"
51 #include "scip/set.h"
52 #include "scip/tree.h"
53 #include "scip/misc.h"
54 #include "scip/var.h"
55 #include "scip/cons.h"
56 #include "scip/solve.h"
57 #include "scip/debug.h"
58 #endif
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
64 /**@addtogroup PublicNodeSelectorMethods
65  *
66  * @{
67  */
68 
69 /** creates a node selector and includes it in SCIP.
70  *
71  * @note method has all node selector callbacks as arguments and is thus changed every time a new
72  * callback is added in future releases; consider using SCIPincludeNodeselBasic() and setter functions
73  * if you seek for a method which is less likely to change in future releases
74  */
75 extern
77  SCIP* scip, /**< SCIP data structure */
78  const char* name, /**< name of node selector */
79  const char* desc, /**< description of node selector */
80  int stdpriority, /**< priority of the node selector in standard mode */
81  int memsavepriority, /**< priority of the node selector in memory saving mode */
82  SCIP_DECL_NODESELCOPY ((*nodeselcopy)), /**< copy method of node selector or NULL if you don't want to copy your plugin into sub-SCIPs */
83  SCIP_DECL_NODESELFREE ((*nodeselfree)), /**< destructor of node selector */
84  SCIP_DECL_NODESELINIT ((*nodeselinit)), /**< initialize node selector */
85  SCIP_DECL_NODESELEXIT ((*nodeselexit)), /**< deinitialize node selector */
86  SCIP_DECL_NODESELINITSOL((*nodeselinitsol)),/**< solving process initialization method of node selector */
87  SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)),/**< solving process deinitialization method of node selector */
88  SCIP_DECL_NODESELSELECT((*nodeselselect)),/**< node selection method */
89  SCIP_DECL_NODESELCOMP ((*nodeselcomp)), /**< node comparison method */
90  SCIP_NODESELDATA* nodeseldata /**< node selector data */
91  );
92 
93 /** Creates a node selector and includes it in SCIP with its most fundamental callbacks. All non-fundamental
94  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
95  * Optional callbacks can be set via specific setter functions, see SCIPsetNodeselCopy(), SCIPsetNodeselFree(),
96  * SCIPsetNodeselInit(), SCIPsetNodeselExit(), SCIPsetNodeselInitsol(), and SCIPsetNodeselExitsol()
97  *
98  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeNodesel() instead
99  */
100 extern
102  SCIP* scip, /**< SCIP data structure */
103  SCIP_NODESEL** nodesel, /**< reference to a node selector, or NULL */
104  const char* name, /**< name of node selector */
105  const char* desc, /**< description of node selector */
106  int stdpriority, /**< priority of the node selector in standard mode */
107  int memsavepriority, /**< priority of the node selector in memory saving mode */
108  SCIP_DECL_NODESELSELECT((*nodeselselect)),/**< node selection method */
109  SCIP_DECL_NODESELCOMP ((*nodeselcomp)), /**< node comparison method */
110  SCIP_NODESELDATA* nodeseldata /**< node selector data */
111  );
112 
113 /** sets copy method of node selector */
114 extern
116  SCIP* scip, /**< SCIP data structure */
117  SCIP_NODESEL* nodesel, /**< node selector */
118  SCIP_DECL_NODESELCOPY ((*nodeselcopy)) /**< copy method of node selector or NULL if you don't want to copy your plugin into sub-SCIPs */
119  );
120 
121 /** sets destructor method of node selector */
122 extern
124  SCIP* scip, /**< SCIP data structure */
125  SCIP_NODESEL* nodesel, /**< node selector */
126  SCIP_DECL_NODESELFREE ((*nodeselfree)) /**< destructor of node selector */
127  );
128 
129 /** sets initialization method of node selector */
130 extern
132  SCIP* scip, /**< SCIP data structure */
133  SCIP_NODESEL* nodesel, /**< node selector */
134  SCIP_DECL_NODESELINIT ((*nodeselinit)) /**< initialize node selector */
135  );
136 
137 /** sets deinitialization method of node selector */
138 extern
140  SCIP* scip, /**< SCIP data structure */
141  SCIP_NODESEL* nodesel, /**< node selector */
142  SCIP_DECL_NODESELEXIT ((*nodeselexit)) /**< deinitialize node selector */
143  );
144 
145 /** sets solving process initialization method of node selector */
146 extern
148  SCIP* scip, /**< SCIP data structure */
149  SCIP_NODESEL* nodesel, /**< node selector */
150  SCIP_DECL_NODESELINITSOL ((*nodeselinitsol))/**< solving process initialization method of node selector */
151  );
152 
153 /** sets solving process deinitialization method of node selector */
154 extern
156  SCIP* scip, /**< SCIP data structure */
157  SCIP_NODESEL* nodesel, /**< node selector */
158  SCIP_DECL_NODESELEXITSOL ((*nodeselexitsol))/**< solving process deinitialization method of node selector */
159  );
160 
161 /** returns the node selector of the given name, or NULL if not existing */
162 extern
164  SCIP* scip, /**< SCIP data structure */
165  const char* name /**< name of node selector */
166  );
167 
168 /** returns the array of currently available node selectors */
169 extern
171  SCIP* scip /**< SCIP data structure */
172  );
173 
174 /** returns the number of currently available node selectors */
175 extern
176 int SCIPgetNNodesels(
177  SCIP* scip /**< SCIP data structure */
178  );
179 
180 /** sets the priority of a node selector in standard mode */
181 extern
183  SCIP* scip, /**< SCIP data structure */
184  SCIP_NODESEL* nodesel, /**< node selector */
185  int priority /**< new standard priority of the node selector */
186  );
187 
188 /** sets the priority of a node selector in memory saving mode */
189 extern
191  SCIP* scip, /**< SCIP data structure */
192  SCIP_NODESEL* nodesel, /**< node selector */
193  int priority /**< new memory saving priority of the node selector */
194  );
195 
196 /** returns the currently used node selector */
197 extern
199  SCIP* scip /**< SCIP data structure */
200  );
201 
202 /* @} */
203 
204 #ifdef __cplusplus
205 }
206 #endif
207 
208 #endif
SCIP_RETCODE SCIPsetNodeselCopy(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELCOPY((*nodeselcopy)))
Definition: scip_nodesel.c:208
#define SCIP_DECL_NODESELCOMP(x)
Definition: type_nodesel.h:126
SCIP_NODESEL ** SCIPgetNodesels(SCIP *scip)
Definition: scip_nodesel.c:317
internal methods for branch and bound tree
#define SCIP_DECL_NODESELINITSOL(x)
Definition: type_nodesel.h:83
SCIP_RETCODE SCIPincludeNodeselBasic(SCIP *scip, SCIP_NODESEL **nodesel, const char *name, const char *desc, int stdpriority, int memsavepriority, SCIP_DECL_NODESELSELECT((*nodeselselect)), SCIP_DECL_NODESELCOMP((*nodeselcomp)), SCIP_NODESELDATA *nodeseldata)
Definition: scip_nodesel.c:173
SCIP_RETCODE SCIPsetNodeselMemsavePriority(SCIP *scip, SCIP_NODESEL *nodesel, int priority)
Definition: scip_nodesel.c:354
SCIP_RETCODE SCIPsetNodeselExit(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELEXIT((*nodeselexit)))
Definition: scip_nodesel.c:256
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
type definitions for return codes for SCIP methods
#define SCIP_DECL_NODESELEXITSOL(x)
Definition: type_nodesel.h:94
#define SCIP_DECL_NODESELINIT(x)
Definition: type_nodesel.h:64
struct SCIP_NodeselData SCIP_NODESELDATA
Definition: type_nodesel.h:38
SCIP_RETCODE SCIPsetNodeselExitsol(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)))
Definition: scip_nodesel.c:288
type definitions for SCIP&#39;s main datastructure
internal miscellaneous methods
#define SCIP_DECL_NODESELFREE(x)
Definition: type_nodesel.h:56
internal methods for global SCIP settings
SCIP main data structure.
SCIP_NODESEL * SCIPgetNodesel(SCIP *scip)
Definition: scip_nodesel.c:369
internal methods for problem variables
#define SCIP_DECL_NODESELEXIT(x)
Definition: type_nodesel.h:72
methods for debugging
type definitions for branch and bound tree
SCIP_RETCODE SCIPsetNodeselInitsol(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINITSOL((*nodeselinitsol)))
Definition: scip_nodesel.c:272
datastructures for problem statistics
int SCIPgetNNodesels(SCIP *scip)
Definition: scip_nodesel.c:328
internal methods for main solving loop and node processing
SCIP_RETCODE SCIPsetNodeselFree(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELFREE((*nodeselfree)))
Definition: scip_nodesel.c:224
SCIP_NODESEL * SCIPfindNodesel(SCIP *scip, const char *name)
Definition: scip_nodesel.c:304
#define SCIP_DECL_NODESELCOPY(x)
Definition: type_nodesel.h:47
internal methods for constraints and constraint handlers
SCIP_RETCODE SCIPsetNodeselInit(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINIT((*nodeselinit)))
Definition: scip_nodesel.c:240
common defines and data types used in all packages of SCIP
type definitions for node selectors
#define SCIP_DECL_NODESELSELECT(x)
Definition: type_nodesel.h:109
SCIP_RETCODE SCIPsetNodeselStdPriority(SCIP *scip, SCIP_NODESEL *nodesel, int priority)
Definition: scip_nodesel.c:339
SCIP_RETCODE SCIPincludeNodesel(SCIP *scip, const char *name, const char *desc, int stdpriority, int memsavepriority, SCIP_DECL_NODESELCOPY((*nodeselcopy)), SCIP_DECL_NODESELFREE((*nodeselfree)), SCIP_DECL_NODESELINIT((*nodeselinit)), SCIP_DECL_NODESELEXIT((*nodeselexit)), SCIP_DECL_NODESELINITSOL((*nodeselinitsol)), SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)), SCIP_DECL_NODESELSELECT((*nodeselselect)), SCIP_DECL_NODESELCOMP((*nodeselcomp)), SCIP_NODESELDATA *nodeseldata)
Definition: scip_nodesel.c:130