Generated on Tue Mar 24 2020 14:04:04 for Gecode by doxygen 1.8.17
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:
51  public:
53  IntVarImpBase(void);
57 
58 
72  void subscribe(Gecode::Space& home, Gecode::Advisor& a, bool assigned, bool failed);
87  };
88 }}
89 #endif
90 #ifdef GECODE_HAS_INT_VARS
91 namespace Gecode { namespace Int {
93  class BoolVarImpBase : public Gecode::VarImp<Gecode::Int::BoolVarImpConf> {
94  protected:
97  public:
99  BoolVarImpBase(void);
103 
104 
118  void subscribe(Gecode::Space& home, Gecode::Advisor& a, bool assigned, bool failed);
133  };
134 }}
135 #endif
136 #ifdef GECODE_HAS_SET_VARS
137 namespace Gecode { namespace Set {
139  class SetVarImpBase : public Gecode::VarImp<Gecode::Set::SetVarImpConf> {
140  protected:
143  public:
145  SetVarImpBase(void);
149 
150 
164  void subscribe(Gecode::Space& home, Gecode::Advisor& a, bool assigned, bool failed);
179  };
180 }}
181 #endif
182 #ifdef GECODE_HAS_FLOAT_VARS
183 namespace Gecode { namespace Float {
185  class FloatVarImpBase : public Gecode::VarImp<Gecode::Float::FloatVarImpConf> {
186  protected:
189  public:
191  FloatVarImpBase(void);
195 
196 
210  void subscribe(Gecode::Space& home, Gecode::Advisor& a, bool assigned, bool failed);
225  };
226 }}
227 #endif
228 #ifdef GECODE_HAS_INT_VARS
229 namespace Gecode { namespace Int {
230 
233 
236  : Gecode::VarImp<Gecode::Int::IntVarImpConf>(home) {}
237 
240  : Gecode::VarImp<Gecode::Int::IntVarImpConf>(home,x) {}
241 
242  forceinline void
245  }
246  forceinline void
249  }
250 
251  forceinline void
254  }
255  forceinline void
258  }
259 
262  switch (me) {
263  case ME_INT_VAL:
264  // Conditions: VAL, BND, DOM
267  return ME_INT_FAILED;
268  cancel(home);
269  break;
270  case ME_INT_BND:
271  // Conditions: BND, DOM
274  return ME_INT_FAILED;
275  break;
276  case ME_INT_DOM:
277  // Conditions: DOM
280  return ME_INT_FAILED;
281  break;
282  default: GECODE_NEVER;
283  }
284  return me;
285  }
286 
287 }}
288 #endif
289 #ifdef GECODE_HAS_INT_VARS
290 namespace Gecode { namespace Int {
291 
294 
297  : Gecode::VarImp<Gecode::Int::BoolVarImpConf>(home) {}
298 
301  : Gecode::VarImp<Gecode::Int::BoolVarImpConf>(home,x) {}
302 
303  forceinline void
306  }
307  forceinline void
310  }
311 
312  forceinline void
315  }
316  forceinline void
319  }
320 
325  return ME_BOOL_FAILED;
326  cancel(home);
327  return ME_BOOL_VAL;
328  }
329 
330 }}
331 #endif
332 #ifdef GECODE_HAS_SET_VARS
333 namespace Gecode { namespace Set {
334 
337 
340  : Gecode::VarImp<Gecode::Set::SetVarImpConf>(home) {}
341 
344  : Gecode::VarImp<Gecode::Set::SetVarImpConf>(home,x) {}
345 
346  forceinline void
349  }
350  forceinline void
353  }
354 
355  forceinline void
358  }
359  forceinline void
362  }
363 
366  switch (me) {
367  case ME_SET_VAL:
368  // Conditions: VAL, CARD, CLUB, CGLB, ANY
371  return ME_SET_FAILED;
372  cancel(home);
373  break;
374  case ME_SET_CARD:
375  // Conditions: CARD, CLUB, CGLB, ANY
378  return ME_SET_FAILED;
379  break;
380  case ME_SET_LUB:
381  // Conditions: CLUB, ANY
385  return ME_SET_FAILED;
386  break;
387  case ME_SET_GLB:
388  // Conditions: CGLB, ANY
391  return ME_SET_FAILED;
392  break;
393  case ME_SET_BB:
394  // Conditions: CLUB, CGLB, ANY
397  return ME_SET_FAILED;
398  break;
399  case ME_SET_CLUB:
400  // Conditions: CARD, CLUB, CGLB, ANY
403  return ME_SET_FAILED;
404  break;
405  case ME_SET_CGLB:
406  // Conditions: CARD, CLUB, CGLB, ANY
409  return ME_SET_FAILED;
410  break;
411  case ME_SET_CBB:
412  // Conditions: CARD, CLUB, CGLB, ANY
415  return ME_SET_FAILED;
416  break;
417  default: GECODE_NEVER;
418  }
419  return me;
420  }
421 
422 }}
423 #endif
424 #ifdef GECODE_HAS_FLOAT_VARS
425 namespace Gecode { namespace Float {
426 
429 
432  : Gecode::VarImp<Gecode::Float::FloatVarImpConf>(home) {}
433 
436  : Gecode::VarImp<Gecode::Float::FloatVarImpConf>(home,x) {}
437 
438  forceinline void
441  }
442  forceinline void
445  }
446 
447  forceinline void
450  }
451  forceinline void
454  }
455 
458  switch (me) {
459  case ME_FLOAT_VAL:
460  // Conditions: VAL, BND
463  return ME_FLOAT_FAILED;
464  cancel(home);
465  break;
466  case ME_FLOAT_BND:
467  // Conditions: BND
470  return ME_FLOAT_FAILED;
471  break;
472  default: GECODE_NEVER;
473  }
474  return me;
475  }
476 
477 }}
478 #endif
479 namespace Gecode {
480 
481  forceinline void
482  Space::update(ActorLink** sub) {
483 #ifdef GECODE_HAS_INT_VARS
485 #endif
486 #ifdef GECODE_HAS_INT_VARS
488 #endif
489 #ifdef GECODE_HAS_SET_VARS
491 #endif
492 #ifdef GECODE_HAS_FLOAT_VARS
494 #endif
495  }
496 }
497 // STATISTICS: kernel-var
const Gecode::PropCond PC_FLOAT_VAL
Propagate when a view becomes assigned (single value)
Definition: var-type.hpp:283
Post propagator for SetVar x
Definition: set.hh:767
const Gecode::PropCond PC_SET_CGLB
Propagate when the cardinality or the greatest lower bound of a view changes.
Definition: var-type.hpp:238
const Gecode::PropCond PC_BOOL_VAL
Propagate when a view becomes assigned (single value)
Definition: var-type.hpp:126
Configuration for Set-variable implementations.
Definition: var-type.hpp:377
Base-class for Bool-variable implementations.
Definition: var-imp.hpp:93
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:261
const Gecode::ModEvent ME_SET_CBB
Domain operation has changed both the greatest lower bound and the least upper bound,...
Definition: var-type.hpp:197
void reschedule(Gecode::Space &home, Gecode::Propagator &p, Gecode::PropCond pc, bool assigned)
Re-schedule propagator p.
Definition: var-imp.hpp:360
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:304
const Gecode::ModEvent ME_INT_FAILED
Domain operation has resulted in failure.
Definition: var-type.hpp:52
Configuration for Bool-variable implementations.
Definition: var-type.hpp:338
const Gecode::ModEvent ME_FLOAT_VAL
Domain operation has resulted in a value (assigned variable)
Definition: var-type.hpp:264
const Gecode::ModEvent ME_BOOL_FAILED
Domain operation has resulted in failure.
Definition: var-type.hpp:112
const Gecode::ModEvent ME_FLOAT_FAILED
Domain operation has resulted in failure.
Definition: var-type.hpp:260
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:322
const Gecode::ModEvent ME_SET_CLUB
Domain operation has changed the least upper bound and the cardinality.
Definition: var-type.hpp:179
FloatVarImpBase(void)
Constructor for creating static instance of variable.
Definition: var-imp.hpp:428
bool assigned(View x, int v)
Whether x is assigned to value v.
Definition: single.hpp:43
const Gecode::PropCond PC_FLOAT_BND
Propagate when minimum or maximum of a view changes.
Definition: var-type.hpp:292
void reschedule(Gecode::Space &home, Gecode::Propagator &p, Gecode::PropCond pc, bool assigned)
Re-schedule propagator p.
Definition: var-imp.hpp:317
const Gecode::ModEvent ME_SET_VAL
Domain operation has resulted in a value (assigned variable)
Definition: var-type.hpp:142
Computation spaces.
Definition: core.hpp:1742
const Gecode::ModEvent ME_BOOL_VAL
Domain operation has resulted in a value (assigned variable)
Definition: var-type.hpp:116
const Gecode::ModEvent ME_INT_VAL
Domain operation has resulted in a value (assigned variable)
Definition: var-type.hpp:56
IntVarImpBase(void)
Constructor for creating static instance of variable.
Definition: var-imp.hpp:232
const Gecode::ModEvent ME_FLOAT_BND
Domain operation has changed the minimum or maximum of the domain.
Definition: var-type.hpp:273
Gecode toplevel namespace
Base-class for propagators.
Definition: core.hpp:1064
const Gecode::ModEvent ME_SET_GLB
Domain operation has changed the greatest lower bound.
Definition: var-type.hpp:164
const Gecode::ModEvent ME_SET_LUB
Domain operation has changed the least upper bound.
Definition: var-type.hpp:156
Base-class for Int-variable implementations.
Definition: var-imp.hpp:47
static void schedule(Gecode::Space &home, Gecode::Propagator &p, Gecode::ModEvent me)
Schedule propagator p.
Definition: var-imp.hpp:448
static void reschedule(Space &home, Propagator &p, PropCond pc, bool assigned, ModEvent me)
Schedule propagator p.
Definition: core.hpp:4407
static void schedule(Gecode::Space &home, Gecode::Propagator &p, Gecode::ModEvent me)
Schedule propagator p.
Definition: var-imp.hpp:313
BoolVarImpBase(void)
Constructor for creating static instance of variable.
Definition: var-imp.hpp:293
Generic domain change information to be supplied to advisors.
Definition: core.hpp:204
const Gecode::PropCond PC_SET_CLUB
Propagate when the cardinality or the least upper bound of a view changes.
Definition: var-type.hpp:227
const Gecode::PropCond PC_SET_CARD
Propagate when the cardinality of a view changes.
Definition: var-type.hpp:216
const Gecode::ModEvent ME_INT_BND
Domain operation has changed the minimum or maximum of the domain.
Definition: var-type.hpp:65
const Gecode::ModEvent ME_SET_CGLB
Domain operation has changed the greatest lower bound and the cardinality.
Definition: var-type.hpp:186
static void schedule(Gecode::Space &home, Gecode::Propagator &p, Gecode::ModEvent me)
Schedule propagator p.
Definition: var-imp.hpp:356
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:243
Configuration for Float-variable implementations.
Definition: var-type.hpp:416
const Gecode::ModEvent ME_SET_FAILED
Domain operation has resulted in failure.
Definition: var-type.hpp:138
const Gecode::ModEvent ME_SET_BB
Domain operation has changed both greatest lower and least upper bound.
Definition: var-type.hpp:172
static void schedule(Gecode::Space &home, Gecode::Propagator &p, Gecode::ModEvent me)
Schedule propagator p.
Definition: var-imp.hpp:252
#define GECODE_NEVER
Assert that this command is never executed.
Definition: macros.hpp:56
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
Definition: var-type.hpp:91
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
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:457
void subscribe(Space &home, Propagator &p, PropCond pc, bool assigned, ModEvent me, bool schedule)
Subscribe propagator p with propagation condition pc.
Definition: core.hpp:4382
int ModEvent
Type for modification events.
Definition: core.hpp:62
SetVarImpBase(void)
Constructor for creating static instance of variable.
Definition: var-imp.hpp:336
int PropCond
Type for propagation conditions.
Definition: core.hpp:72
Base-class for Float-variable implementations.
Definition: var-imp.hpp:185
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:365
Base-class for Set-variable implementations.
Definition: var-imp.hpp:139
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value)
Definition: var-type.hpp:82
Gecode::IntSet d(v, 7)
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:347
Base-class for advisors.
Definition: core.hpp:1292
static void schedule(Space &home, Propagator &p, ModEvent me, bool force=false)
Schedule propagator p with modification event me.
Definition: core.hpp:4288
static ModEvent me(const ModEventDelta &med)
Project modification event for this variable type from med.
Definition: core.hpp:4270
#define forceinline
Definition: config.hpp:185
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 variable implementations.
Definition: core.hpp:157
void reschedule(Gecode::Space &home, Gecode::Propagator &p, Gecode::PropCond pc, bool assigned)
Re-schedule propagator p.
Definition: var-imp.hpp:452
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:439
void cancel(Space &home)
Cancel all subscriptions when variable implementation is assigned.
Definition: core.hpp:4487
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
Definition: var-type.hpp:100
void reschedule(Gecode::Space &home, Gecode::Propagator &p, Gecode::PropCond pc, bool assigned)
Re-schedule propagator p.
Definition: var-imp.hpp:256
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
Definition: var-type.hpp:72
const Gecode::ModEvent ME_SET_CARD
Domain operation has changed the variable cardinality.
Definition: var-type.hpp:148
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:232
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