Generated on Sat Feb 7 2015 02:01:17 for Gecode by doxygen 1.8.9.1
var-imp.hpp
Go to the documentation of this file.
1 /*
2  * CAUTION:
3  * This file has been automatically generated. Do not edit,
4  * edit the following files instead:
5  * - ./gecode/int/var-imp/int.vis
6  * - ./gecode/int/var-imp/bool.vis
7  * - ./gecode/set/var-imp/set.vis
8  * - ./gecode/float/var-imp/float.vis
9  *
10  * This file contains generated code fragments which are
11  * copyrighted as follows:
12  *
13  * Main author:
14  * Christian Schulte <schulte@gecode.org>
15  *
16  * Copyright:
17  * Christian Schulte, 2007
18  *
19  * The generated code fragments are part of Gecode, the generic
20  * constraint development environment:
21  * http://www.gecode.org
22  *
23  * Permission is hereby granted, free of charge, to any person obtaining
24  * a copy of this software and associated documentation files (the
25  * "Software"), to deal in the Software without restriction, including
26  * without limitation the rights to use, copy, modify, merge, publish,
27  * distribute, sublicense, and/or sell copies of the Software, and to
28  * permit persons to whom the Software is furnished to do so, subject to
29  * the following conditions:
30  *
31  * The above copyright notice and this permission notice shall be
32  * included in all copies or substantial portions of the Software.
33  *
34  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
38  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
39  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
40  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41  *
42  */
43 
44 #ifdef GECODE_HAS_INT_VARS
45 namespace Gecode { namespace Int {
47  class IntVarImpBase : public Gecode::VarImp<Gecode::Int::IntVarImpConf> {
48  protected:
50  IntVarImpBase(Gecode::Space& home, bool share, IntVarImpBase& x);
51  public:
53  IntVarImpBase(void);
57 
58 
72  void subscribe(Gecode::Space& home, Gecode::Advisor& a, bool assigned);
76  };
77 }}
78 #endif
79 #ifdef GECODE_HAS_INT_VARS
80 namespace Gecode { namespace Int {
82  class BoolVarImpBase : public Gecode::VarImp<Gecode::Int::BoolVarImpConf> {
83  protected:
85  BoolVarImpBase(Gecode::Space& home, bool share, BoolVarImpBase& x);
86  public:
88  BoolVarImpBase(void);
92 
93 
107  void subscribe(Gecode::Space& home, Gecode::Advisor& a, bool assigned);
111  };
112 }}
113 #endif
114 #ifdef GECODE_HAS_SET_VARS
115 namespace Gecode { namespace Set {
117  class SetVarImpBase : public Gecode::VarImp<Gecode::Set::SetVarImpConf> {
118  protected:
120  SetVarImpBase(Gecode::Space& home, bool share, SetVarImpBase& x);
121  public:
123  SetVarImpBase(void);
127 
128 
142  void subscribe(Gecode::Space& home, Gecode::Advisor& a, bool assigned);
146  };
147 }}
148 #endif
149 #ifdef GECODE_HAS_FLOAT_VARS
150 namespace Gecode { namespace Float {
152  class FloatVarImpBase : public Gecode::VarImp<Gecode::Float::FloatVarImpConf> {
153  protected:
155  FloatVarImpBase(Gecode::Space& home, bool share, FloatVarImpBase& x);
156  public:
158  FloatVarImpBase(void);
162 
163 
177  void subscribe(Gecode::Space& home, Gecode::Advisor& a, bool assigned);
181  };
182 }}
183 #endif
184 #ifdef GECODE_HAS_INT_VARS
185 namespace Gecode { namespace Int {
186 
189 
192  : Gecode::VarImp<Gecode::Int::IntVarImpConf>(home) {}
193 
196  : Gecode::VarImp<Gecode::Int::IntVarImpConf>(home,share,x) {}
197 
198  forceinline void
201  }
202  forceinline void
205  }
206 
209  switch (me) {
210  case ME_INT_VAL:
211  // Conditions: VAL, BND, DOM
214  return ME_INT_FAILED;
215  cancel(home);
216  break;
217  case ME_INT_BND:
218  // Conditions: BND, DOM
221  return ME_INT_FAILED;
222  break;
223  case ME_INT_DOM:
224  // Conditions: DOM
227  return ME_INT_FAILED;
228  break;
229  default: GECODE_NEVER;
230  }
231  return me;
232  }
233 
234 }}
235 #endif
236 #ifdef GECODE_HAS_INT_VARS
237 namespace Gecode { namespace Int {
238 
241 
244  : Gecode::VarImp<Gecode::Int::BoolVarImpConf>(home) {}
245 
248  : Gecode::VarImp<Gecode::Int::BoolVarImpConf>(home,share,x) {}
249 
250  forceinline void
253  }
254  forceinline void
257  }
258 
263  return ME_BOOL_FAILED;
264  cancel(home);
265  return ME_BOOL_VAL;
266  }
267 
268 }}
269 #endif
270 #ifdef GECODE_HAS_SET_VARS
271 namespace Gecode { namespace Set {
272 
275 
278  : Gecode::VarImp<Gecode::Set::SetVarImpConf>(home) {}
279 
282  : Gecode::VarImp<Gecode::Set::SetVarImpConf>(home,share,x) {}
283 
284  forceinline void
287  }
288  forceinline void
291  }
292 
295  switch (me) {
296  case ME_SET_VAL:
297  // Conditions: VAL, CARD, CLUB, CGLB, ANY
300  return ME_SET_FAILED;
301  cancel(home);
302  break;
303  case ME_SET_CARD:
304  // Conditions: CARD, CLUB, CGLB, ANY
307  return ME_SET_FAILED;
308  break;
309  case ME_SET_LUB:
310  // Conditions: CLUB, ANY
314  return ME_SET_FAILED;
315  break;
316  case ME_SET_GLB:
317  // Conditions: CGLB, ANY
320  return ME_SET_FAILED;
321  break;
322  case ME_SET_BB:
323  // Conditions: CLUB, CGLB, ANY
326  return ME_SET_FAILED;
327  break;
328  case ME_SET_CLUB:
329  // Conditions: CARD, CLUB, CGLB, ANY
332  return ME_SET_FAILED;
333  break;
334  case ME_SET_CGLB:
335  // Conditions: CARD, CLUB, CGLB, ANY
338  return ME_SET_FAILED;
339  break;
340  case ME_SET_CBB:
341  // Conditions: CARD, CLUB, CGLB, ANY
344  return ME_SET_FAILED;
345  break;
346  default: GECODE_NEVER;
347  }
348  return me;
349  }
350 
351 }}
352 #endif
353 #ifdef GECODE_HAS_FLOAT_VARS
354 namespace Gecode { namespace Float {
355 
358 
361  : Gecode::VarImp<Gecode::Float::FloatVarImpConf>(home) {}
362 
365  : Gecode::VarImp<Gecode::Float::FloatVarImpConf>(home,share,x) {}
366 
367  forceinline void
370  }
371  forceinline void
374  }
375 
378  switch (me) {
379  case ME_FLOAT_VAL:
380  // Conditions: VAL, BND
383  return ME_FLOAT_FAILED;
384  cancel(home);
385  break;
386  case ME_FLOAT_BND:
387  // Conditions: BND
390  return ME_FLOAT_FAILED;
391  break;
392  default: GECODE_NEVER;
393  }
394  return me;
395  }
396 
397 }}
398 #endif
399 namespace Gecode {
400 
401  forceinline void
402  Space::update(ActorLink** sub) {
403 #ifdef GECODE_HAS_INT_VARS
405 #endif
406 #ifdef GECODE_HAS_INT_VARS
408 #endif
409 #ifdef GECODE_HAS_SET_VARS
411 #endif
412 #ifdef GECODE_HAS_FLOAT_VARS
414 #endif
415  }
416 }
417 // STATISTICS: kernel-var
const Gecode::PropCond PC_SET_CLUB
Propagate when the cardinality or the least upper bound of a view changes.
Definition: var-type.hpp:227
SetVarImpBase(void)
Constructor for creating static instance of variable.
Definition: var-imp.hpp:274
Base-class for variable implementations.
Definition: core.hpp:228
const Gecode::ModEvent ME_SET_FAILED
Domain operation has resulted in failure.
Definition: var-type.hpp:138
const Gecode::PropCond PC_SET_CARD
Propagate when the cardinality of a view changes.
Definition: var-type.hpp:216
const Gecode::ModEvent ME_SET_LUB
Domain operation has changed the least upper bound.
Definition: var-type.hpp:156
FloatVarImpBase(void)
Constructor for creating static instance of variable.
Definition: var-imp.hpp:357
const Gecode::ModEvent ME_SET_BB
Domain operation has changed both greatest lower and least upper bound.
Definition: var-type.hpp:172
int ModEvent
Type for modification events.
Definition: core.hpp:146
static void schedule(Space &home, Propagator &p, ModEvent me, bool force=false)
Schedule propagator p with modification event me.
Base-class for propagators.
Definition: core.hpp:755
const Gecode::ModEvent ME_FLOAT_FAILED
Domain operation has resulted in failure.
Definition: var-type.hpp:260
Base-class for advisors.
Definition: core.hpp:926
const Gecode::ModEvent ME_FLOAT_VAL
Domain operation has resulted in a value (assigned variable)
Definition: var-type.hpp:264
Base-class for Int-variable implementations.
Definition: var-imp.hpp:47
Computation spaces.
Definition: core.hpp:1362
void subscribe(Gecode::Space &home, Gecode::Propagator &p, Gecode::PropCond pc, bool assigned, bool schedule)
Subscribe propagator p with propagation condition pc.
Definition: var-imp.hpp:285
void cancel(Space &home)
Cancel all subscriptions when variable implementation is assigned.
Gecode::IntSet d(v, 7)
const Gecode::ModEvent ME_INT_FAILED
Domain operation has resulted in failure.
Definition: var-type.hpp:52
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
static ModEvent me(const ModEventDelta &med)
Project modification event for this variable type from med.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
Definition: var-type.hpp:91
const Gecode::ModEvent ME_SET_CGLB
Domain operation has changed the greatest lower bound and the cardinality.
Definition: var-type.hpp:186
int PropCond
Type for propagation conditions.
Definition: core.hpp:156
const Gecode::ModEvent ME_INT_VAL
Domain operation has resulted in a value (assigned variable)
Definition: var-type.hpp:56
const Gecode::ModEvent ME_SET_CBB
Domain operation has changed both the greatest lower bound and the least upper bound, as well as the cardinality.
Definition: var-type.hpp:197
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
Definition: var-type.hpp:100
const Gecode::ModEvent ME_INT_BND
Domain operation has changed the minimum or maximum of the domain.
Definition: var-type.hpp:65
Gecode::ModEvent notify(Gecode::Space &home, Gecode::ModEvent me, Gecode::Delta &d)
Notify that variable implementation has been modified with modification event me and delta informatio...
Definition: var-imp.hpp:208
const Gecode::ModEvent ME_SET_GLB
Domain operation has changed the greatest lower bound.
Definition: var-type.hpp:164
void subscribe(Gecode::Space &home, Gecode::Propagator &p, Gecode::PropCond pc, bool assigned, bool schedule)
Subscribe propagator p with propagation condition pc.
Definition: var-imp.hpp:251
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
Definition: var-type.hpp:248
Base-class for Set-variable implementations.
Definition: var-imp.hpp:117
const Gecode::PropCond PC_FLOAT_VAL
Propagate when a view becomes assigned (single value)
Definition: var-type.hpp:283
Gecode::ModEvent notify(Gecode::Space &home, Gecode::ModEvent me, Gecode::Delta &d)
Notify that variable implementation has been modified with modification event me and delta informatio...
Definition: var-imp.hpp:260
Node * x
Pointer to corresponding Boolean expression node.
Definition: bool-expr.cpp:253
Generic domain change information to be supplied to advisors.
Definition: core.hpp:275
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
Definition: var-type.hpp:72
const Gecode::PropCond PC_SET_CGLB
Propagate when the cardinality or the greatest lower bound of a view changes.
Definition: var-type.hpp:238
bool assigned(View x, int v)
Whether x is assigned to value v.
Definition: single.hpp:47
const Gecode::ModEvent ME_SET_CLUB
Domain operation has changed the least upper bound and the cardinality.
Definition: var-type.hpp:179
#define forceinline
Definition: config.hpp:132
Base-class for Bool-variable implementations.
Definition: var-imp.hpp:82
Gecode::ModEvent notify(Gecode::Space &home, Gecode::ModEvent me, Gecode::Delta &d)
Notify that variable implementation has been modified with modification event me and delta informatio...
Definition: var-imp.hpp:377
IntVarImpBase(void)
Constructor for creating static instance of variable.
Definition: var-imp.hpp:188
Configuration for Bool-variable implementations.
Definition: var-type.hpp:338
Gecode::ModEvent notify(Gecode::Space &home, Gecode::ModEvent me, Gecode::Delta &d)
Notify that variable implementation has been modified with modification event me and delta informatio...
Definition: var-imp.hpp:294
const Gecode::PropCond PC_FLOAT_BND
Propagate when minimum or maximum of a view changes.
Definition: var-type.hpp:292
const Gecode::ModEvent ME_BOOL_FAILED
Domain operation has resulted in failure.
Definition: var-type.hpp:112
Configuration for Float-variable implementations.
Definition: var-type.hpp:416
Gecode toplevel namespace
Configuration for Int-variable implementations.
Definition: var-type.hpp:299
const Gecode::PropCond PC_SET_VAL
Propagate when a view becomes assigned (single value)
Definition: var-type.hpp:207
const Gecode::ModEvent ME_FLOAT_BND
Domain operation has changed the minimum or maximum of the domain.
Definition: var-type.hpp:273
Base-class for Float-variable implementations.
Definition: var-imp.hpp:152
void subscribe(Gecode::Space &home, Gecode::Propagator &p, Gecode::PropCond pc, bool assigned, bool schedule)
Subscribe propagator p with propagation condition pc.
Definition: var-imp.hpp:368
const Gecode::ModEvent ME_SET_VAL
Domain operation has resulted in a value (assigned variable)
Definition: var-type.hpp:142
const Gecode::ModEvent ME_SET_CARD
Domain operation has changed the variable cardinality.
Definition: var-type.hpp:148
BoolVarImpBase(void)
Constructor for creating static instance of variable.
Definition: var-imp.hpp:240
#define GECODE_NEVER
Assert that this command is never executed.
Definition: macros.hpp:60
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
Configuration for Set-variable implementations.
Definition: var-type.hpp:377
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value)
Definition: var-type.hpp:82
const Gecode::PropCond PC_BOOL_VAL
Propagate when a view becomes assigned (single value)
Definition: var-type.hpp:126
void subscribe(Gecode::Space &home, Gecode::Propagator &p, Gecode::PropCond pc, bool assigned, bool schedule)
Subscribe propagator p with propagation condition pc.
Definition: var-imp.hpp:199
const Gecode::ModEvent ME_BOOL_VAL
Domain operation has resulted in a value (assigned variable)
Definition: var-type.hpp:116
void subscribe(Space &home, Propagator &p, PropCond pc, bool assigned, ModEvent me, bool schedule)
Subscribe propagator p with propagation condition pc.
Definition: core.hpp:3727