Generated on Thu Apr 5 2018 19:44:19 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$ by $Author$
15  * $Revision$
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 and memory management
130  *
131  */
132 
137 
138 /*
139  * Macros for checking failure
140  *
141  */
142 
143 #include <gecode/kernel/macros.hpp>
144 
145 
146 /*
147  * Gecode kernel
148  *
149  */
150 
151 #include <gecode/kernel/archive.hpp>
152 #include <gecode/kernel/gpi.hpp>
154 #include <gecode/kernel/core.hpp>
157 
158 
159 /*
160  * Variables and testing for shared variables
161  *
162  */
163 
164 #include <gecode/kernel/var.hpp>
165 
166 
167 /*
168  * Views
169  *
170  */
171 
172 #include <gecode/kernel/view.hpp>
173 
174 
175 /*
176  * Arrays and other data
177  *
178  */
179 
184 
185 
186 /*
187  * Common propagator patterns
188  *
189  */
190 
195 
196 
197 /*
198  * Abstractions for branching
199  *
200  */
201 
202 namespace Gecode {
203 
226  branch(Home home, std::function<void(Space& home)> f);
228 
229 }
230 
247 
248 
249 /*
250  * Automatically generated variable implementations
251  *
252  */
253 
254 #include <gecode/kernel/var-imp.hpp>
255 
256 
257 /*
258  * Trace support
259  *
260  */
261 
267 
268 namespace Gecode {
269 
275  trace(Home home, TraceFilter tf,
276  int te = (TE_PROPAGATE | TE_COMMIT),
277  Tracer& t = StdTracer::def);
282  void
283  trace(Home home,
284  int te = (TE_PROPAGATE | TE_COMMIT),
285  Tracer& t = StdTracer::def);
286 
287 }
288 
290 
291 /*
292  * Allocator support
293  *
294  */
295 
297 
298 
299 #endif
300 
301 // 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:1668
Trace commit operations by branchers.
Definition: recorder.hpp:55
Trace filters.
Definition: filter.hpp:137
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.
Definition: recorder.hpp:54
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:846
const double chb_qscore_init
Initial value for Q-score in CHB.
Definition: kernel.hh:114