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 2002-2022 Zuse Institute Berlin */
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 scip_nodesel.h
26  * @ingroup PUBLICCOREAPI
27  * @brief public methods for node selector plugins
28  * @author Tobias Achterberg
29  * @author Timo Berthold
30  * @author Thorsten Koch
31  * @author Alexander Martin
32  * @author Marc Pfetsch
33  * @author Kati Wolter
34  * @author Gregor Hendel
35  * @author Leona Gottwald
36  */
37 
38 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
39 
40 #ifndef __SCIP_SCIP_NODESEL_H__
41 #define __SCIP_SCIP_NODESEL_H__
42 
43 
44 #include "scip/def.h"
45 #include "scip/type_nodesel.h"
46 #include "scip/type_retcode.h"
47 #include "scip/type_scip.h"
48 #include "scip/type_tree.h"
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 /**@addtogroup PublicNodeSelectorMethods
55  *
56  * @{
57  */
58 
59 /** creates a node selector and includes it in SCIP.
60  *
61  * @note method has all node selector callbacks as arguments and is thus changed every time a new
62  * callback is added in future releases; consider using SCIPincludeNodeselBasic() and setter functions
63  * if you seek for a method which is less likely to change in future releases
64  */
65 SCIP_EXPORT
67  SCIP* scip, /**< SCIP data structure */
68  const char* name, /**< name of node selector */
69  const char* desc, /**< description of node selector */
70  int stdpriority, /**< priority of the node selector in standard mode */
71  int memsavepriority, /**< priority of the node selector in memory saving mode */
72  SCIP_DECL_NODESELCOPY ((*nodeselcopy)), /**< copy method of node selector or NULL if you don't want to copy your plugin into sub-SCIPs */
73  SCIP_DECL_NODESELFREE ((*nodeselfree)), /**< destructor of node selector */
74  SCIP_DECL_NODESELINIT ((*nodeselinit)), /**< initialize node selector */
75  SCIP_DECL_NODESELEXIT ((*nodeselexit)), /**< deinitialize node selector */
76  SCIP_DECL_NODESELINITSOL((*nodeselinitsol)),/**< solving process initialization method of node selector */
77  SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)),/**< solving process deinitialization method of node selector */
78  SCIP_DECL_NODESELSELECT((*nodeselselect)),/**< node selection method */
79  SCIP_DECL_NODESELCOMP ((*nodeselcomp)), /**< node comparison method */
80  SCIP_NODESELDATA* nodeseldata /**< node selector data */
81  );
82 
83 /** Creates a node selector and includes it in SCIP with its most fundamental callbacks. All non-fundamental
84  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
85  * Optional callbacks can be set via specific setter functions, see SCIPsetNodeselCopy(), SCIPsetNodeselFree(),
86  * SCIPsetNodeselInit(), SCIPsetNodeselExit(), SCIPsetNodeselInitsol(), and SCIPsetNodeselExitsol()
87  *
88  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeNodesel() instead
89  */
90 SCIP_EXPORT
92  SCIP* scip, /**< SCIP data structure */
93  SCIP_NODESEL** nodesel, /**< reference to a node selector, or NULL */
94  const char* name, /**< name of node selector */
95  const char* desc, /**< description of node selector */
96  int stdpriority, /**< priority of the node selector in standard mode */
97  int memsavepriority, /**< priority of the node selector in memory saving mode */
98  SCIP_DECL_NODESELSELECT((*nodeselselect)),/**< node selection method */
99  SCIP_DECL_NODESELCOMP ((*nodeselcomp)), /**< node comparison method */
100  SCIP_NODESELDATA* nodeseldata /**< node selector data */
101  );
102 
103 /** sets copy method of node selector */
104 SCIP_EXPORT
106  SCIP* scip, /**< SCIP data structure */
107  SCIP_NODESEL* nodesel, /**< node selector */
108  SCIP_DECL_NODESELCOPY ((*nodeselcopy)) /**< copy method of node selector or NULL if you don't want to copy your plugin into sub-SCIPs */
109  );
110 
111 /** sets destructor method of node selector */
112 SCIP_EXPORT
114  SCIP* scip, /**< SCIP data structure */
115  SCIP_NODESEL* nodesel, /**< node selector */
116  SCIP_DECL_NODESELFREE ((*nodeselfree)) /**< destructor of node selector */
117  );
118 
119 /** sets initialization method of node selector */
120 SCIP_EXPORT
122  SCIP* scip, /**< SCIP data structure */
123  SCIP_NODESEL* nodesel, /**< node selector */
124  SCIP_DECL_NODESELINIT ((*nodeselinit)) /**< initialize node selector */
125  );
126 
127 /** sets deinitialization method of node selector */
128 SCIP_EXPORT
130  SCIP* scip, /**< SCIP data structure */
131  SCIP_NODESEL* nodesel, /**< node selector */
132  SCIP_DECL_NODESELEXIT ((*nodeselexit)) /**< deinitialize node selector */
133  );
134 
135 /** sets solving process initialization method of node selector */
136 SCIP_EXPORT
138  SCIP* scip, /**< SCIP data structure */
139  SCIP_NODESEL* nodesel, /**< node selector */
140  SCIP_DECL_NODESELINITSOL ((*nodeselinitsol))/**< solving process initialization method of node selector */
141  );
142 
143 /** sets solving process deinitialization method of node selector */
144 SCIP_EXPORT
146  SCIP* scip, /**< SCIP data structure */
147  SCIP_NODESEL* nodesel, /**< node selector */
148  SCIP_DECL_NODESELEXITSOL ((*nodeselexitsol))/**< solving process deinitialization method of node selector */
149  );
150 
151 /** returns the node selector of the given name, or NULL if not existing */
152 SCIP_EXPORT
154  SCIP* scip, /**< SCIP data structure */
155  const char* name /**< name of node selector */
156  );
157 
158 /** returns the array of currently available node selectors */
159 SCIP_EXPORT
161  SCIP* scip /**< SCIP data structure */
162  );
163 
164 /** returns the number of currently available node selectors */
165 SCIP_EXPORT
166 int SCIPgetNNodesels(
167  SCIP* scip /**< SCIP data structure */
168  );
169 
170 /** sets the priority of a node selector in standard mode */
171 SCIP_EXPORT
173  SCIP* scip, /**< SCIP data structure */
174  SCIP_NODESEL* nodesel, /**< node selector */
175  int priority /**< new standard priority of the node selector */
176  );
177 
178 /** sets the priority of a node selector in memory saving mode */
179 SCIP_EXPORT
181  SCIP* scip, /**< SCIP data structure */
182  SCIP_NODESEL* nodesel, /**< node selector */
183  int priority /**< new memory saving priority of the node selector */
184  );
185 
186 /** returns the currently used node selector */
187 SCIP_EXPORT
189  SCIP* scip /**< SCIP data structure */
190  );
191 
192 /** @} */
193 
194 #ifdef __cplusplus
195 }
196 #endif
197 
198 #endif
SCIP_RETCODE SCIPsetNodeselCopy(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELCOPY((*nodeselcopy)))
Definition: scip_nodesel.c:138
#define SCIP_DECL_NODESELCOMP(x)
Definition: type_nodesel.h:140
SCIP_NODESEL ** SCIPgetNodesels(SCIP *scip)
Definition: scip_nodesel.c:247
#define SCIP_DECL_NODESELINITSOL(x)
Definition: type_nodesel.h:97
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:103
SCIP_RETCODE SCIPsetNodeselMemsavePriority(SCIP *scip, SCIP_NODESEL *nodesel, int priority)
Definition: scip_nodesel.c:284
SCIP_RETCODE SCIPsetNodeselExit(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELEXIT((*nodeselexit)))
Definition: scip_nodesel.c:186
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for return codes for SCIP methods
#define SCIP_DECL_NODESELEXITSOL(x)
Definition: type_nodesel.h:108
#define SCIP_DECL_NODESELINIT(x)
Definition: type_nodesel.h:78
struct SCIP_NodeselData SCIP_NODESELDATA
Definition: type_nodesel.h:52
SCIP_RETCODE SCIPsetNodeselExitsol(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)))
Definition: scip_nodesel.c:218
type definitions for SCIP&#39;s main datastructure
#define SCIP_DECL_NODESELFREE(x)
Definition: type_nodesel.h:70
SCIP_NODESEL * SCIPgetNodesel(SCIP *scip)
Definition: scip_nodesel.c:299
#define SCIP_DECL_NODESELEXIT(x)
Definition: type_nodesel.h:86
type definitions for branch and bound tree
SCIP_RETCODE SCIPsetNodeselInitsol(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINITSOL((*nodeselinitsol)))
Definition: scip_nodesel.c:202
int SCIPgetNNodesels(SCIP *scip)
Definition: scip_nodesel.c:258
SCIP_RETCODE SCIPsetNodeselFree(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELFREE((*nodeselfree)))
Definition: scip_nodesel.c:154
SCIP_NODESEL * SCIPfindNodesel(SCIP *scip, const char *name)
Definition: scip_nodesel.c:234
#define SCIP_DECL_NODESELCOPY(x)
Definition: type_nodesel.h:61
SCIP_RETCODE SCIPsetNodeselInit(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINIT((*nodeselinit)))
Definition: scip_nodesel.c:170
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:123
SCIP_RETCODE SCIPsetNodeselStdPriority(SCIP *scip, SCIP_NODESEL *nodesel, int priority)
Definition: scip_nodesel.c:269
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:60