Generated on Sat Jun 2 2018 07:17:44 for Gecode by doxygen 1.8.13
compact.hpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Linnea Ingmar <linnea.ingmar@hotmail.com>
5  *
6  * Contributing authors:
7  * Christian Schulte <schulte@gecode.org>
8  *
9  * Copyright:
10  * Linnea Ingmar, 2017
11  * Christian Schulte, 2017
12  *
13  * This file is part of Gecode, the generic constraint
14  * development environment:
15  * http://www.gecode.org
16  *
17  * Permission is hereby granted, free of charge, to any person obtaining
18  * a copy of this software and associated documentation files (the
19  * "Software"), to deal in the Software without restriction, including
20  * without limitation the rights to use, copy, modify, merge, publish,
21  * distribute, sublicense, and/or sell copies of the Software, and to
22  * permit persons to whom the Software is furnished to do so, subject to
23  * the following conditions:
24  *
25  * The above copyright notice and this permission notice shall be
26  * included in all copies or substantial portions of the Software.
27  *
28  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35  *
36  */
37 
38 #include <algorithm>
39 #include <type_traits>
40 
41 namespace Gecode { namespace Int { namespace Extensional {
42 
43  /*
44  * Advisor
45  *
46  */
47  template<class View>
48  forceinline void
50  {
51  int n = view().min();
52  assert((_fst->min <= n) && (n <= _lst->max));
53  while (n > _fst->max)
54  _fst++;
55  assert((_fst->min <= n) && (n <= _lst->max));
56  }
57  {
58  int n = view().max();
59  assert((_fst->min <= n) && (n <= _lst->max));
60  while (n < _lst->min)
61  _lst--;
62  assert((_fst->min <= n) && (n <= _lst->max));
63  }
64  }
65 
66  template<class View>
69  (Space& home, Propagator& p,
70  Council<CTAdvisor>& c, const TupleSet& ts, View x0, int i)
71  : ViewAdvisor<View>(home,p,c,x0), _fst(ts.fst(i)), _lst(ts.lst(i)) {
72  adjust();
73  }
74 
75  template<class View>
78  : ViewAdvisor<View>(home,a), _fst(a._fst), _lst(a._lst) {}
79 
80  template<class View>
81  forceinline const typename Compact<View>::Range*
83  return _fst;
84  }
85 
86  template<class View>
87  forceinline const typename Compact<View>::Range*
89  return _lst;
90  }
91 
92  template<class View>
93  forceinline void
95  (void) ViewAdvisor<View>::dispose(home,c);
96  }
97 
98 
99  /*
100  * Status
101  *
102  */
103  template<class View>
106  : s(t) {}
107  template<class View>
110  : s(s.s) {}
111  template<class View>
114  return static_cast<StatusType>(s & 3);
115  }
116  template<class View>
117  forceinline bool
119  if (type() != SINGLE)
120  return false;
121  assert(type() == 0);
122  return reinterpret_cast<CTAdvisor*>(s) == &a;
123  }
124  template<class View>
125  forceinline void
127  if (!single(a))
128  s = MULTIPLE;
129  }
130  template<class View>
131  forceinline void
133  s = NONE;
134  }
135  template<class View>
136  forceinline void
138  s = PROPAGATING;
139  }
140 
141 
142 
143  /*
144  * The propagator base class
145  *
146  */
147  template<class View>
148  const typename Compact<View>::Range*
150  assert((n > a.fst()->max) && (n < a.lst()->min));
151  const Range* f=a.fst()+1;
152  const Range* l=a.lst()-1;
153  assert(f<=l);
154  while (f < l) {
155  const Range* m = f + ((l-f) >> 1);
156  if (n < m->min) {
157  l=m-1;
158  } else if (n > m->max) {
159  f=m+1;
160  } else {
161  f=m; break;
162  }
163  }
164  assert((f->min <= n) && (n <= f->max));
165  return f;
166  }
167 
168  template<class View>
169  forceinline const BitSetData*
171  const Range* fnd;
172  const Range* fst=a.fst();
173  const Range* lst=a.lst();
174  if (n <= fst->max) {
175  fnd=fst; goto found;
176  } else if (n >= lst->min) {
177  fnd=lst; goto found;
178  } else {
179  fnd=range(a,n);
180  }
181  found:
182  assert((fnd->min <= n) && (n <= fnd->max));
183  return fnd->supports(n_words,n);
184  }
185 
186  template<class View>
189  CTAdvisor& a)
190  : n_words(p.n_words), max(a.view().max()),
191  xr(a.view()), sr(a.fst()), n(xr.min()) {
192  while (n > sr->max)
193  sr++;
194  s=sr->supports(n_words,n);
195  }
196  template<class View>
199  int i, View x)
200  : n_words(ts.words()), max(x.max()), xr(x), sr(ts.fst(i)), n(xr.min()) {
201  while (n > sr->max)
202  sr++;
203  s=sr->supports(n_words,n);
204  }
205  template<class View>
206  forceinline void
208  n++;
209  if (n <= xr.max()) {
210  assert(n <= sr->max);
211  s += n_words;
212  } else if (n <= max) {
213  while (n > xr.max())
214  ++xr;
215  n = xr.min();
216  while (n > sr->max)
217  sr++;
218  s = sr->supports(n_words,n);
219  assert((xr.min() <= n) && (n <= xr.max()));
220  assert((sr->min <= n) && (n <= sr->max));
221  assert(sr->min <= xr.min());
222  }
223  }
224  template<class View>
225  forceinline bool
227  return n <= max;
228  }
229  template<class View>
230  forceinline const BitSetData*
232  assert(s == sr->supports(n_words,n));
233  return s;
234  }
235  template<class View>
236  forceinline int
238  return n;
239  }
240 
241  /*
242  * Lost supports iterator
243  *
244  */
245  template<class View>
248  (const Compact<View>& p, CTAdvisor& a, int l0, int h0)
249  : n_words(p.n_words), r(a.fst()), l(l0), h(h0) {
250  // Move to first value for which there is support
251  while (l > r->max)
252  r++;
253  l=std::max(l,r->min);
254  s=r->supports(n_words,l);
255  }
256  template<class View>
257  forceinline void
259  l++; s += n_words;
260  while ((l <= h) && (l > r->max)) {
261  r++; l=r->min; s=r->s;
262  }
263  }
264  template<class View>
265  forceinline bool
267  return l<=h;
268  }
269  template<class View>
272  assert((l >= r->min) && (l <= r->max));
273  assert(s == r->supports(n_words,l));
274  return s;
275  }
276 
277  template<class View>
280  : Propagator(home,p), unassigned(p.unassigned), n_words(p.n_words),
281  status(NONE), ts(p.ts) {
282  c.update(home,p.c);
283  }
284 
285  template<class View>
288  const TupleSet& ts0)
289  : Propagator(home), unassigned(x.size()), n_words(ts0.words()),
290  status(MULTIPLE), ts(ts0), c(home) {
291  home.notice(*this, AP_DISPOSE);
292  }
293 
294  template<class View>
295  forceinline size_t
297  home.ignore(*this,AP_DISPOSE);
298  c.dispose(home);
299  ts.~TupleSet();
300  (void) Propagator::dispose(home);
301  return sizeof(*this);
302  }
303 
304 
305  /*
306  * The propagator proper
307  *
308  */
309  template<class View, class Table>
310  template<class TableProp>
313  : Compact<View>(home,p), table(home,p.table) {
314  assert(!table.empty());
315  }
316 
317  template<class View, class Table>
318  Actor*
320  assert((table.words() > 0U) && (table.width() >= table.words()));
321  if (table.words() <= 4U) {
322  switch (table.width()) {
323  case 0U:
324  GECODE_NEVER; break;
325  case 1U:
326  return new (home) CompactTable<View,TinyBitSet<1U>>(home,*this);
327  case 2U:
328  return new (home) CompactTable<View,TinyBitSet<2U>>(home,*this);
329  case 3U:
330  return new (home) CompactTable<View,TinyBitSet<3U>>(home,*this);
331  case 4U:
332  return new (home) CompactTable<View,TinyBitSet<4U>>(home,*this);
333  default:
334  break;
335  }
336  }
337  if (std::is_same<Table,BitSet<unsigned char>>::value) {
338  goto copy_char;
339  } else if (std::is_same<Table,BitSet<unsigned short int>>::value) {
340  switch (Gecode::Support::u_type(table.width())) {
342  goto copy_char;
344  goto copy_short;
346  default:
347  GECODE_NEVER;
348  }
349  } else {
350  switch (Gecode::Support::u_type(table.width())) {
352  goto copy_char;
354  goto copy_short;
356  return new (home) CompactTable<View,BitSet<unsigned int>>(home,*this);
357  default: GECODE_NEVER;
358  }
359  GECODE_NEVER;
360  return nullptr;
361  }
362  copy_char:
363  return new (home) CompactTable<View,BitSet<unsigned char>>(home,*this);
364  copy_short:
365  return new (home) CompactTable<View,BitSet<unsigned short int>>(home,*this);
366  }
367 
368  template<class View,class Table>
371  const TupleSet& ts)
372  : Compact<View>(home,x,ts), table(home,ts.words()) {
373  Region r;
374  BitSetData* mask = r.alloc<BitSetData>(table.size());
375  // Invalidate tuples
376  for (int i = x.size(); i--; ) {
377  table.clear_mask(mask);
378  for (ValidSupports vs(ts,i,x[i]); vs(); ++vs)
379  table.add_to_mask(vs.supports(),mask);
380  table.template intersect_with_mask<false>(mask);
381  if (table.empty())
382  return;
383  }
384  // Post advisors
385  for (int i = x.size(); i--; ) {
386  if (!x[i].assigned())
387  (void) new (home) CTAdvisor(home,*this,c,ts,x[i],i);
388  else
389  unassigned--;
390  }
391  // Schedule propagator
392  if (unassigned < x.size())
393  View::schedule(home,*this,ME_INT_VAL);
394  else
395  View::schedule(home,*this,ME_INT_BND);
396  }
397 
398  template<class View, class Table>
399  forceinline size_t
401  (void) Compact<View>::dispose(home);
402  return sizeof(*this);
403  }
404 
405  template<class View, class Table>
406  PropCost
409  }
410 
411  template<class View, class Table>
412  void
414  // Modified variable, subsumption, or failure
415  if ((status.type() != StatusType::NONE) || (unassigned == 0) || table.empty())
416  View::schedule(home,*this,ME_INT_DOM);
417  }
418 
419  template<class View, class Table>
420  ExecStatus
422  if (table.empty())
423  return ES_FAILED;
424  if (unassigned == 0)
425  return home.ES_SUBSUMED(*this);
426 
427  Status touched(status);
428  // Mark as performing propagation
430 
431  Region r;
432  // Scan all values of all unassigned variables to see if they
433  // are still supported.
434  for (Advisors<CTAdvisor> as(c); as(); ++as) {
435  CTAdvisor& a = as.advisor();
436  View x = a.view();
437 
438  // No point filtering variable if it was the only modified variable
439  if (touched.single(a) || x.assigned())
440  continue;
441 
442  if (x.size() == 2) { // Consider min and max values only
443  if (!table.intersects(supports(a,x.min())))
444  GECODE_ME_CHECK(x.eq(home,x.max()));
445  else if (!table.intersects(supports(a,x.max())))
446  GECODE_ME_CHECK(x.eq(home,x.min()));
447  if (x.assigned())
448  unassigned--;
449  else
450  a.adjust();
451  } else { // x.size() > 2
452  // How many values to remove
453  int* nq = r.alloc<int>(x.size());
454  unsigned int n_nq = 0U;
455  // The initialization is here just to avoid warnings...
456  int last_support = 0;
457  for (ValidSupports vs(*this,a); vs(); ++vs)
458  if (!table.intersects(vs.supports()))
459  nq[n_nq++] = vs.val();
460  else
461  last_support = vs.val();
462  // Remove collected values
463  if (n_nq > 0U) {
464  if (n_nq == 1U) {
465  ModEvent me = x.nq(home,nq[0]);
466  if (me_failed(me)) return ES_FAILED;
467  assert(me != ME_INT_VAL);
468  } else if (n_nq == x.size() - 1U) {
469  GECODE_ME_CHECK(x.eq(home,last_support));
470  unassigned--;
471  goto noadjust;
472  } else {
473  Iter::Values::Array rnq(nq,n_nq);
474  GECODE_ASSUME(n_nq >= 2U);
475  ModEvent me = x.minus_v(home,rnq,false);
476  if (me_failed(me)) return ES_FAILED;
477  assert(me != ME_INT_VAL);
478  }
479  a.adjust();
480  noadjust: ;
481  }
482  r.free();
483  }
484  }
485 
486  // Mark as no touched variable
487  status.none();
488  // Should not be in a failed state
489  assert(!table.empty());
490  // Subsume if there is at most one non-assigned variable
491  return (unassigned <= 1) ? home.ES_SUBSUMED(*this) : ES_FIX;
492  }
493 
494  template<class View, class Table>
497  const TupleSet& ts) {
498  // All variables pruned to correct domain
499  for (int i=x.size(); i--; ) {
500  TupleSet::Ranges r(ts,i);
501  GECODE_ME_CHECK(x[i].inter_r(home, r, false));
502  }
503  if ((x.size() > 1) && (ts.tuples() > 1)) {
504  CompactTable<View,Table>* ct = new (home) CompactTable(home,x,ts);
505  if (ct->table.empty())
506  return ES_FAILED;
507  }
508  return ES_OK;
509  }
510 
511  template<class View, class Table>
512  ExecStatus
514  CTAdvisor& a = static_cast<CTAdvisor&>(a0);
515 
516  // Do not fail a disabled propagator
517  if (table.empty())
518  return Compact<View>::disabled() ? home.ES_NOFIX_DISPOSE(c,a) : ES_FAILED;
519 
520  View x = a.view();
521 
522  /*
523  * Do not schedule if propagator is performing propagation,
524  * and dispose if assigned.
525  */
526  if (status.type() == StatusType::PROPAGATING)
527  return x.assigned() ? home.ES_FIX_DISPOSE(c,a) : ES_FIX;
528 
529  // Update status
530  status.touched(a);
531 
532  if (x.assigned()) {
533  // Variable is assigned -- intersect with its value
534  table.template intersect_with_mask<true>(supports(a,x.val()));
535  unassigned--;
536  return home.ES_NOFIX_DISPOSE(c,a);
537  }
538 
539  if (!x.any(d) && (x.min(d) == x.max(d))) {
540  table.nand_with_mask(supports(a,x.min(d)));
541  a.adjust();
542  } else if (!x.any(d) && (x.width(d) <= x.size())) {
543  // Incremental update, using the removed values
544  for (LostSupports ls(*this,a,x.min(d),x.max(d)); ls(); ++ls) {
545  table.nand_with_mask(ls.supports());
546  if (table.empty())
547  return Compact<View>::disabled() ? home.ES_NOFIX_DISPOSE(c,a) : ES_FAILED;
548  }
549  a.adjust();
550  } else {
551  a.adjust();
552  // Reset-based update, using the values that are left
553  if (x.size() == 2) {
554  table.intersect_with_masks(supports(a,x.min()),
555  supports(a,x.max()));
556  } else {
557  Region r;
558  BitSetData* mask = r.alloc<BitSetData>(table.size());
559  // Collect all tuples to be kept in a temporary mask
560  table.clear_mask(mask);
561  for (ValidSupports vs(*this,a); vs(); ++vs)
562  table.add_to_mask(vs.supports(),mask);
563  table.template intersect_with_mask<false>(mask);
564  }
565  }
566 
567  // Do not fail a disabled propagator
568  if (table.empty())
569  return Compact<View>::disabled() ? home.ES_NOFIX_DISPOSE(c,a) : ES_FAILED;
570 
571  // Schedule propagator
572  return ES_NOFIX;
573  }
574 
575 
576  /*
577  * Post function
578  */
579  template<class View>
580  inline ExecStatus
582  assert(ts.words() > 0U);
583  // All variables pruned to correct domain
584  for (int i=x.size(); i--; ) {
585  TupleSet::Ranges r(ts,i);
586  GECODE_ME_CHECK(x[i].inter_r(home, r, false));
587  }
588  // Choose the right bit set implementation
589  switch (ts.words()) {
590  case 0U:
591  GECODE_NEVER; return ES_OK;
592  case 1U:
593  return CompactTable<View,TinyBitSet<1U>>::post(home,x,ts);
594  case 2U:
595  return CompactTable<View,TinyBitSet<2U>>::post(home,x,ts);
596  case 3U:
597  return CompactTable<View,TinyBitSet<3U>>::post(home,x,ts);
598  case 4U:
599  return CompactTable<View,TinyBitSet<4U>>::post(home,x,ts);
600  default:
601  switch (Gecode::Support::u_type(ts.words())) {
608  default: GECODE_NEVER;
609  }
610  }
611  GECODE_NEVER;
612  return ES_OK;
613  }
614 
615 }}}
616 
617 
618 // STATISTICS: int-prop
void free(void)
Free allocate memory.
Definition: region.hpp:350
CompactTable(Space &home, TableProp &p)
Constructor for cloning p.
Definition: compact.hpp:312
const BitSetData * supports(void) const
Provide access to corresponding supports.
Definition: compact.hpp:271
void dispose(Space &home, Council< A > &c)
Delete advisor.
Definition: advisor.hpp:90
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition: compact.hpp:319
Council of advisors
Definition: core.hpp:154
Status(StatusType t)
Initialize with type t (either NONE or SEVERAL)
Definition: compact.hpp:105
const Range * lst(void) const
Return lasst range of support data structure.
Definition: compact.hpp:88
NodeType t
Type of node.
Definition: bool-expr.cpp:230
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
Definition: core.hpp:4706
TupleSet ts
The tuple set.
Definition: extensional.hh:473
StatusType type(void) const
Return status type.
Definition: compact.hpp:113
NNF * l
Left subtree.
Definition: bool-expr.cpp:240
const Range * range(CTAdvisor &a, int n)
Find range for n.
Definition: compact.hpp:149
ExecStatus ES_SUBSUMED(Propagator &p)
Definition: core.hpp:3482
#define GECODE_ASSUME(p)
Assert certain property.
Definition: macros.hpp:114
const FloatNum max
Largest allowed float value.
Definition: float.hh:844
Actor must always be disposed.
Definition: core.hpp:561
const Range * fst(void) const
Return first range of support data structure.
Definition: compact.hpp:82
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
Definition: region.hpp:380
Value iterator for array of integers
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:49
const unsigned int n_words
Number of words in supports.
Definition: extensional.hh:469
IntType u_type(unsigned int n)
Return type required to represent n.
Definition: int-type.hpp:147
void operator++(void)
Move to next supports.
Definition: compact.hpp:207
int ModEvent
Type for modification events.
Definition: core.hpp:62
Base-class for propagators.
Definition: core.hpp:1023
Compact< View >::CTAdvisor CTAdvisor
Definition: extensional.hh:507
Base-class for advisors.
Definition: core.hpp:1251
ExecStatus ES_NOFIX_DISPOSE(Council< A > &c, A &a)
Advisor a must be disposed and its propagator must be run
Definition: core.hpp:3806
int val(void) const
Return supported value.
Definition: compact.hpp:237
Class to iterate over advisors of a council.
Definition: core.hpp:155
Handle to region.
Definition: region.hpp:53
const BitSetData * supports(void) const
Return supports.
Definition: compact.hpp:231
#define forceinline
Definition: config.hpp:185
Propagation has computed fixpoint.
Definition: core.hpp:476
Computation spaces.
Definition: core.hpp:1701
ViewRanges< View > xr
Range iterator.
Definition: extensional.hh:419
Advisor storing a single view
Definition: advisor.hpp:43
const BitSetData * supports(CTAdvisor &a, int n)
Return supports for value n.
Definition: compact.hpp:170
Base-class for both propagators and branchers.
Definition: core.hpp:627
Iterator over ranges.
Definition: int.hh:2311
Status status
Propagator status.
Definition: extensional.hh:471
Gecode::IntSet d(v, 7)
CTAdvisor(Space &home, Propagator &p, Council< CTAdvisor > &c, const TupleSet &ts, View x0, int i)
Initialise from parameters.
Definition: compact.hpp:69
int tuples(void) const
Number of tuples.
Definition: tuple-set.hpp:185
char integer type
Definition: int-type.hpp:40
View view(void) const
Access view.
Definition: advisor.hpp:79
size_t dispose(Space &home)
Delete propagator and return its size.
Definition: compact.hpp:400
Multiple view have been touched.
Definition: extensional.hh:383
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:232
Gecode::IntArgs i(4, 1, 2, 3, 4)
Domain consistent extensional propagator.
Definition: extensional.hh:503
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:234
ExecStatus postcompact(Home home, ViewArray< View > &x, const TupleSet &ts)
Post function for compact table propagator.
Definition: compact.hpp:581
Execution has resulted in failure.
Definition: core.hpp:473
A single view has been touched.
Definition: extensional.hh:382
void none(void)
Set status to NONE.
Definition: compact.hpp:132
const Gecode::ModEvent ME_INT_VAL
Domain operation has resulted in a value (assigned variable)
Definition: var-type.hpp:56
const Range * lst(int i) const
Return last range for position i.
Definition: tuple-set.hpp:209
LostSupports(const Compact< View > &p, CTAdvisor &a, int l, int h)
Initialize iterator for values between l and h.
Definition: compact.hpp:248
const BitSetData * supports(unsigned int n_words, int n) const
Return the supports for value n.
Definition: tuple-set.hpp:50
int max
Maximum value.
Definition: int.hh:2155
const Gecode::ModEvent ME_INT_BND
Domain operation has changed the minimum or maximum of the domain.
Definition: var-type.hpp:65
size_t size
The size of the propagator (used during subsumption)
Definition: core.hpp:1036
Expensive.
Definition: core.hpp:513
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts)
Post propagator for views x and table t.
Definition: compact.hpp:496
ExecStatus ES_FIX_DISPOSE(Council< A > &c, A &a)
Advisor a must be disposed
Definition: core.hpp:3799
View arrays.
Definition: array.hpp:224
const Range * _lst
Last range of support data structure.
Definition: extensional.hh:359
bool single(CTAdvisor &a) const
Check whether status is single and equal to a.
Definition: compact.hpp:118
Council< CTAdvisor > c
The advisor council.
Definition: extensional.hh:475
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
Definition: macros.hpp:52
size_t dispose(Space &home)
Delete propagator and return its size.
Definition: compact.hpp:296
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Definition: core.hpp:3176
const Range * fst(int i) const
Return first range for position i.
Definition: tuple-set.hpp:205
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: compact.hpp:421
const BitSetData * s
The value&#39;s support.
Definition: extensional.hh:425
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition: set.hh:765
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: compact.hpp:407
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:67
Class represeting a set of tuples.
Definition: int.hh:2140
virtual void reschedule(Space &home)
Schedule function.
Definition: compact.hpp:413
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
Generic domain change information to be supplied to advisors.
Definition: core.hpp:203
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
Definition: core.hpp:3993
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Definition: core.hpp:3209
Propagation cost.
Definition: core.hpp:485
const Range * _fst
First range of support data structure.
Definition: extensional.hh:357
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
Definition: var-type.hpp:72
void dispose(Space &home, Council< CTAdvisor > &c)
Dispose advisor.
Definition: compact.hpp:94
void touched(CTAdvisor &a)
Set status to SINGLE or MULTIPLE depending on a.
Definition: compact.hpp:126
ExecStatus
Definition: core.hpp:471
bool assigned(View x, int v)
Whether x is assigned to value v.
Definition: single.hpp:43
bool operator()(void) const
Whether there are still supports left.
Definition: compact.hpp:226
Compact(Space &home, Compact &p)
Constructor for cloning p.
Definition: compact.hpp:279
Date item for bitsets.
Definition: bitset-base.hpp:65
Advisor for updating current table.
Definition: extensional.hh:352
void adjust(void)
Adjust supports.
Definition: compact.hpp:49
Post propagator for SetVar x
Definition: set.hh:765
Execution is okay.
Definition: core.hpp:475
Propagation has not computed fixpoint.
Definition: core.hpp:474
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition: compact.hpp:513
ptrdiff_t s
A tagged pointer for storing the status.
Definition: extensional.hh:391
Gecode toplevel namespace
const unsigned int n_words
Number of words.
Definition: extensional.hh:415
Base class for compact table propagator.
Definition: extensional.hh:347
int unassigned
Number of unassigned views.
Definition: extensional.hh:467
int min
Minimum value.
Definition: int.hh:2153
void operator++(void)
Move iterator to next value.
Definition: compact.hpp:258
bool operator()(void) const
Whether iterator is done.
Definition: compact.hpp:266
int ModEventDelta
Modification event deltas.
Definition: core.hpp:89
int size(void) const
Return size of array (number of elements)
Definition: array.hpp:1199
short integer type
Definition: int-type.hpp:41
void propagating(void)
Set status to PROPAGATING.
Definition: compact.hpp:137
Home class for posting propagators
Definition: core.hpp:853
ValidSupports(const Compact< View > &p, CTAdvisor &a)
Initialize from initialized propagator.
Definition: compact.hpp:188
No view has been touched.
Definition: extensional.hh:384
#define GECODE_NEVER
Assert that this command is never executed.
Definition: macros.hpp:56
The propagator is currently running.
Definition: extensional.hh:385
Range information.
Definition: int.hh:2150
bool me_failed(ModEvent me)
Check whether modification event me is failed.
Definition: modevent.hpp:54
unsigned int words(void) const
Return number of required bit set words.
Definition: tuple-set.hpp:189