Scippy

SCIP

Solving Constraint Integer Programs

heur.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-2014 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 email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file heur.h
17  * @brief internal methods for primal heuristics
18  * @author Tobias Achterberg
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #ifndef __SCIP_HEUR_H__
24 #define __SCIP_HEUR_H__
25 
26 
27 #include "scip/def.h"
28 #include "blockmemshell/memory.h"
29 #include "scip/type_retcode.h"
30 #include "scip/type_result.h"
31 #include "scip/type_set.h"
32 #include "scip/type_primal.h"
33 #include "scip/type_heur.h"
34 #include "scip/pub_heur.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /** copies the given primal heuristic to a new scip */
41 extern
43  SCIP_HEUR* heur, /**< primal heuristic */
44  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
45  );
46 
47 /** creates a primal heuristic */
48 extern
50  SCIP_HEUR** heur, /**< pointer to primal heuristic data structure */
51  SCIP_SET* set, /**< global SCIP settings */
52  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
53  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
54  const char* name, /**< name of primal heuristic */
55  const char* desc, /**< description of primal heuristic */
56  char dispchar, /**< display character of primal heuristic */
57  int priority, /**< priority of the primal heuristic */
58  int freq, /**< frequency for calling primal heuristic */
59  int freqofs, /**< frequency offset for calling primal heuristic */
60  int maxdepth, /**< maximal depth level to call heuristic at (-1: no limit) */
61  unsigned int timingmask, /**< positions in the node solving loop where heuristic should be executed */
62  SCIP_Bool usessubscip, /**< does the separator use a secondary SCIP instance? */
63  SCIP_DECL_HEURCOPY ((*heurcopy)), /**< copy method of primal heuristic or NULL if you don't want to copy your plugin into sub-SCIPs */
64  SCIP_DECL_HEURFREE ((*heurfree)), /**< destructor of primal heuristic */
65  SCIP_DECL_HEURINIT ((*heurinit)), /**< initialize primal heuristic */
66  SCIP_DECL_HEUREXIT ((*heurexit)), /**< deinitialize primal heuristic */
67  SCIP_DECL_HEURINITSOL ((*heurinitsol)), /**< solving process initialization method of primal heuristic */
68  SCIP_DECL_HEUREXITSOL ((*heurexitsol)), /**< solving process deinitialization method of primal heuristic */
69  SCIP_DECL_HEUREXEC ((*heurexec)), /**< execution method of primal heuristic */
70  SCIP_HEURDATA* heurdata /**< primal heuristic data */
71  );
72 
73 /** calls destructor and frees memory of primal heuristic */
74 extern
76  SCIP_HEUR** heur, /**< pointer to primal heuristic data structure */
77  SCIP_SET* set /**< global SCIP settings */
78  );
79 
80 /** initializes primal heuristic */
81 extern
83  SCIP_HEUR* heur, /**< primal heuristic */
84  SCIP_SET* set /**< global SCIP settings */
85  );
86 
87 /** calls exit method of primal heuristic */
88 extern
90  SCIP_HEUR* heur, /**< primal heuristic */
91  SCIP_SET* set /**< global SCIP settings */
92  );
93 
94 /** informs primal heuristic that the branch and bound process is being started */
95 extern
97  SCIP_HEUR* heur, /**< primal heuristic */
98  SCIP_SET* set /**< global SCIP settings */
99  );
100 
101 /** informs primal heuristic that the branch and bound process data is being freed */
102 extern
104  SCIP_HEUR* heur, /**< primal heuristic */
105  SCIP_SET* set /**< global SCIP settings */
106  );
107 
108 /** should the heuristic be executed at the given depth, frequency, timing, ... */
109 extern
111  SCIP_HEUR* heur, /**< primal heuristic */
112  int depth, /**< depth of current node */
113  int lpstateforkdepth, /**< depth of the last node with solved LP */
114  SCIP_HEURTIMING heurtiming, /**< current point in the node solving process */
115  SCIP_Bool* delayed /**< pointer to store whether the heuristic should be delayed */
116  );
117 
118 /** calls execution method of primal heuristic */
119 extern
121  SCIP_HEUR* heur, /**< primal heuristic */
122  SCIP_SET* set, /**< global SCIP settings */
123  SCIP_PRIMAL* primal, /**< primal data */
124  int depth, /**< depth of current node */
125  int lpstateforkdepth, /**< depth of the last node with solved LP */
126  SCIP_HEURTIMING heurtiming, /**< current point in the node solving process */
127  SCIP_Bool nodeinfeasible, /**< was the current node already detected to be infeasible? */
128  int* ndelayedheurs, /**< pointer to count the number of delayed heuristics */
129  SCIP_RESULT* result /**< pointer to store the result of the callback method */
130  );
131 
132 /** sets priority of primal heuristic */
133 extern
135  SCIP_HEUR* heur, /**< primal heuristic */
136  SCIP_SET* set, /**< global SCIP settings */
137  int priority /**< new priority of the primal heuristic */
138  );
139 
140 /** sets copy callback of primal heuristic */
141 extern
142 void SCIPheurSetCopy(
143  SCIP_HEUR* heur, /**< primal heuristic */
144  SCIP_DECL_HEURCOPY ((*heurcopy)) /**< copy callback of primal heuristic or NULL if you don't want to copy your plugin into sub-SCIPs */
145  );
146 
147 /** sets destructor callback of primal heuristic */
148 extern
149 void SCIPheurSetFree(
150  SCIP_HEUR* heur, /**< primal heuristic */
151  SCIP_DECL_HEURFREE ((*heurfree)) /**< destructor of primal heuristic */
152  );
153 
154 /** sets initialization callback of primal heuristic */
155 extern
156 void SCIPheurSetInit(
157  SCIP_HEUR* heur, /**< primal heuristic */
158  SCIP_DECL_HEURINIT ((*heurinit)) /**< initialize primal heuristic */
159  );
160 
161 /** sets deinitialization callback of primal heuristic */
162 extern
163 void SCIPheurSetExit(
164  SCIP_HEUR* heur, /**< primal heuristic */
165  SCIP_DECL_HEUREXIT ((*heurexit)) /**< deinitialize primal heuristic */
166  );
167 
168 /** sets solving process initialization callback of primal heuristic */
169 extern
170 void SCIPheurSetInitsol(
171  SCIP_HEUR* heur, /**< primal heuristic */
172  SCIP_DECL_HEURINITSOL ((*heurinitsol)) /**< solving process initialization callback of primal heuristic */
173  );
174 
175 /** sets solving process deinitialization callback of primal heuristic */
176 extern
177 void SCIPheurSetExitsol(
178  SCIP_HEUR* heur, /**< primal heuristic */
179  SCIP_DECL_HEUREXITSOL ((*heurexitsol)) /**< solving process deinitialization callback of primal heuristic */
180  );
181 
182 #ifdef __cplusplus
183 }
184 #endif
185 
186 #endif
187