Generated on Sat Jan 20 2018 22:21:16 for Gecode by doxygen 1.8.13
kernel.hh
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Christian Schulte <schulte@gecode.org>
5  *
6  * Contributing authors:
7  * Guido Tack <tack@gecode.org>
8  *
9  * Copyright:
10  * Christian Schulte, 2004
11  * Guido Tack, 2004
12  *
13  * Last modified:
14  * $Date: 2017-04-01 20:27:10 +0200 (Sat, 01 Apr 2017) $ by $Author: schulte $
15  * $Revision: 15623 $
16  *
17  * This file is part of Gecode, the generic constraint
18  * development environment:
19  * http://www.gecode.org
20  *
21  * Permission is hereby granted, free of charge, to any person obtaining
22  * a copy of this software and associated documentation files (the
23  * "Software"), to deal in the Software without restriction, including
24  * without limitation the rights to use, copy, modify, merge, publish,
25  * distribute, sublicense, and/or sell copies of the Software, and to
26  * permit persons to whom the Software is furnished to do so, subject to
27  * the following conditions:
28  *
29  * The above copyright notice and this permission notice shall be
30  * included in all copies or substantial portions of the Software.
31  *
32  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
33  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
35  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
36  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
37  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
38  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39  *
40  */
41 
42 #ifndef __GECODE_KERNEL_HH__
43 #define __GECODE_KERNEL_HH__
44 
45 #include <cstddef>
46 #include <cstdlib>
47 #include <cstring>
48 #include <cassert>
49 
50 #include <cfloat>
51 
52 #include <functional>
53 
54 #include <gecode/support.hh>
55 
56 /*
57  * Configure linking
58  *
59  */
60 #if !defined(GECODE_STATIC_LIBS) && \
61  (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
62 
63 #ifdef GECODE_BUILD_KERNEL
64 #define GECODE_KERNEL_EXPORT __declspec( dllexport )
65 #else
66 #define GECODE_KERNEL_EXPORT __declspec( dllimport )
67 #endif
68 
69 #else
70 
71 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
72 #define GECODE_KERNEL_EXPORT __attribute__ ((visibility("default")))
73 #else
74 #define GECODE_KERNEL_EXPORT
75 #endif
76 
77 #endif
78 
79 // Configure auto-linking
80 #ifndef GECODE_BUILD_KERNEL
81 #define GECODE_LIBRARY_NAME "Kernel"
83 #endif
84 
98 namespace Gecode {
99 
101  namespace Kernel { namespace Config {
103  const double rescale = 1e-50;
105  const double rescale_limit = DBL_MAX * rescale;
106 
108  const double chb_alpha_init = 0.4;
110  const double chb_alpha_limit = 0.06;
112  const double chb_alpha_decrement = 1e-6;
114  const double chb_qscore_init = 0.05;
115  }}
116 
117 }
118 
119 /*
120  * General exceptions and kernel exceptions
121  *
122  */
123 
125 
126 
127 
128 /*
129  * Basic kernel services
130  *
131  */
132 
135 
136 
137 /*
138  * Macros for checking failure
139  *
140  */
141 
142 #include <gecode/kernel/macros.hpp>
143 
144 
145 /*
146  * Gecode kernel
147  *
148  */
149 
150 #include <gecode/kernel/archive.hpp>
151 #include <gecode/kernel/gpi.hpp>
152 #include <gecode/kernel/core.hpp>
155 
156 /*
157  * Region memory management
158  *
159  */
160 
161 #include <gecode/kernel/region.hpp>
162 
163 
164 /*
165  * Variables and testing for shared variables
166  *
167  */
168 
169 #include <gecode/kernel/var.hpp>
170 
171 
172 /*
173  * Views
174  *
175  */
176 
177 #include <gecode/kernel/view.hpp>
178 
179 
180 /*
181  * Arrays and other data
182  *
183  */
184 
185 #include <gecode/kernel/array.hpp>
188 
189 
190 /*
191  * Random number generator (for branching)
192  *
193  */
194 
195 #include <gecode/kernel/rnd.hpp>
196 
197 
198 /*
199  * Common propagator and branching patterns
200  *
201  */
202 
203 namespace Gecode {
204 
227  branch(Home home, std::function<void(Space& home)> f);
229 
230 }
231 
234 #include <gecode/kernel/advisor.hpp>
235 #include <gecode/kernel/afc.hpp>
237 #include <gecode/kernel/chb.hpp>
238 #include <gecode/kernel/action.hpp>
251 
252 
253 /*
254  * Automatically generated variable implementations
255  *
256  */
257 
258 #include <gecode/kernel/var-imp.hpp>
259 
260 
261 /*
262  * Trace support
263  *
264  */
265 
268 #include <gecode/kernel/tracer.hpp>
271 
272 namespace Gecode {
273 
279  trace(Home home, TraceFilter tf,
280  int te = (TE_PROPAGATE | TE_COMMIT),
281  Tracer& t = StdTracer::def);
286  void
287  trace(Home home,
288  int te = (TE_PROPAGATE | TE_COMMIT),
289  Tracer& t = StdTracer::def);
290 
291 }
292 
293 #include <gecode/kernel/trace.hpp>
294 
295 /*
296  * Allocator support
297  *
298  */
299 
301 
302 
303 #endif
304 
305 // STATISTICS: kernel-other
NodeType t
Type of node.
Definition: bool-expr.cpp:234
void branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf, FloatVarValPrint vvp)
Branch over x with variable selection vars and value selection vals.
Definition: branch.cpp:43
const double rescale_limit
Rescale action and afc values when larger than this.
Definition: kernel.hh:105
static StdTracer def
Default tracer (printing to std::cerr)
Definition: tracer.hpp:222
Computation spaces.
Definition: core.hpp:1748
Trace commit operations by branchers.
Trace filters.
const double chb_alpha_init
Initial value for alpha in CHB.
Definition: kernel.hh:108
#define GECODE_KERNEL_EXPORT
Definition: kernel.hh:74
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
const double rescale
Rescale factor for action and afc values.
Definition: kernel.hh:103
const double chb_alpha_limit
Limit for decreasing alpha in CHB.
Definition: kernel.hh:110
Trace propagator executions.
Tracer.
Definition: tracer.hpp:153
void trace(Home home, const FloatVarArgs &x, TraceFilter tf, int te, FloatTracer &t)
Create a tracer for float variables.
Definition: trace.cpp:43
const double chb_alpha_decrement
Alpha decrement in CHB.
Definition: kernel.hh:112
Gecode toplevel namespace
Home class for posting propagators
Definition: core.hpp:922
const double chb_qscore_init
Initial value for Q-score in CHB.
Definition: kernel.hh:114