Generated on Sat Jul 29 2017 12:41:24 for Gecode by doxygen 1.8.13
lq-le.hpp
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  * Gabor Szokoli <szokoli@gecode.org>
6  *
7  * Copyright:
8  * Christian Schulte, 2003
9  * Gabor Szokoli, 2003
10  *
11  * Last modified:
12  * $Date: 2017-02-22 03:37:18 +0100 (Wed, 22 Feb 2017) $ by $Author: schulte $
13  * $Revision: 15468 $
14  *
15  * This file is part of Gecode, the generic constraint
16  * development environment:
17  * http://www.gecode.org
18  *
19  * Permission is hereby granted, free of charge, to any person obtaining
20  * a copy of this software and associated documentation files (the
21  * "Software"), to deal in the Software without restriction, including
22  * without limitation the rights to use, copy, modify, merge, publish,
23  * distribute, sublicense, and/or sell copies of the Software, and to
24  * permit persons to whom the Software is furnished to do so, subject to
25  * the following conditions:
26  *
27  * The above copyright notice and this permission notice shall be
28  * included in all copies or substantial portions of the Software.
29  *
30  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
33  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
34  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
35  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
36  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37  *
38  */
39 
40 namespace Gecode { namespace Int { namespace Rel {
41 
42  /*
43  * Less or equal propagator
44  *
45  */
46 
47  template<class V0, class V1>
49  Lq<V0,V1>::Lq(Home home, V0 x0, V1 x1)
50  : MixBinaryPropagator<V0,PC_INT_BND,V1,PC_INT_BND>(home,x0,x1) {}
51 
52  template<class V0, class V1>
53  forceinline bool
54  Lq<V0,V1>::same(V0 x0, V1 x1) {
55  (void) x0; (void) x1;
56  return false;
57  }
58 
59  template<>
60  forceinline bool
62  return Gecode::same(x0,x1);
63  }
64 
65  template<>
66  forceinline bool
68  return Gecode::same(x0,x1);
69  }
70 
71  template<class V0, class V1>
73  Lq<V0,V1>::post(Home home, V0 x0, V1 x1) {
74  GECODE_ME_CHECK(x0.lq(home,x1.max()));
75  GECODE_ME_CHECK(x1.gq(home,x0.min()));
76  if (!same(x0,x1) && (x0.max() > x1.min()))
77  (void) new (home) Lq<V0,V1>(home,x0,x1);
78  return ES_OK;
79  }
80 
81  template<class V0, class V1>
83  Lq<V0,V1>::Lq(Space& home, bool share, Lq<V0,V1>& p)
84  : MixBinaryPropagator<V0,PC_INT_BND,V1,PC_INT_BND>(home,share,p) {}
85 
86  template<class V0, class V1>
87  Actor*
88  Lq<V0,V1>::copy(Space& home, bool share) {
89  return new (home) Lq<V0,V1>(home,share,*this);
90  }
91 
92  template<class V0, class V1>
95  GECODE_ME_CHECK(x0.lq(home,x1.max()));
96  GECODE_ME_CHECK(x1.gq(home,x0.min()));
97  return (x0.max() <= x1.min()) ? home.ES_SUBSUMED(*this) : ES_FIX;
98  }
99 
100 
101 
102 
103  /*
104  * Less propagator
105  *
106  */
107  template<class V0, class V1>
109  Le<V0,V1>::Le(Home home, V0 x0, V1 x1)
110  : MixBinaryPropagator<V0,PC_INT_BND,V1,PC_INT_BND>(home,x0,x1) {}
111 
112  template<class V0, class V1>
113  forceinline bool
115  (void) x0; (void) x1;
116  return false;
117  }
118 
119  template<>
120  forceinline bool
122  return Gecode::same(x0,x1);
123  }
124 
125  template<>
126  forceinline bool
128  return Gecode::same(x0,x1);
129  }
130 
131  template<>
132  forceinline bool
134  return Gecode::same(x0,x1);
135  }
136 
137  template<class V0, class V1>
138  ExecStatus
139  Le<V0,V1>::post(Home home, V0 x0, V1 x1) {
140  if (same(x0,x1))
141  return ES_FAILED;
142  GECODE_ME_CHECK(x0.le(home,x1.max()));
143  GECODE_ME_CHECK(x1.gr(home,x0.min()));
144  if (x0.max() >= x1.min())
145  (void) new (home) Le<V0,V1>(home,x0,x1);
146  return ES_OK;
147  }
148 
149  template<class V0, class V1>
151  Le<V0,V1>::Le(Space& home, bool share, Le<V0,V1>& p)
152  : MixBinaryPropagator<V0,PC_INT_BND,V1,PC_INT_BND>(home,share,p) {}
153 
154  template<class V0, class V1>
155  Actor*
156  Le<V0,V1>::copy(Space& home, bool share) {
157  return new (home) Le<V0,V1>(home,share,*this);
158  }
159 
160  template<class V0, class V1>
161  ExecStatus
163  GECODE_ME_CHECK(x0.le(home,x1.max()));
164  GECODE_ME_CHECK(x1.gr(home,x0.min()));
165  return (x0.max() < x1.min()) ? home.ES_SUBSUMED(*this) : ES_FIX;
166  }
167 
168 
169 
170  /*
171  * Nary less and less or equal propagator
172  *
173  */
174 
175  template<class View, int o>
178  Council<Index>& c, int i0)
179  : Advisor(home,p,c), i(i0) {}
180 
181  template<class View, int o>
184  : Advisor(home,share,a), i(a.i) {}
185 
186 
187 
188  template<class View, int o>
191  : FreeList(n), p(p0) {}
192 
193  template<class View, int o>
196  return static_cast<Pos*>(FreeList::next());
197  }
198 
199  template<class View, int o>
200  forceinline void
202 
203  template<class View, int o>
204  forceinline void
206  GECODE_NEVER;
207  }
208 
209  template<class View, int o>
210  forceinline void*
212  return home.fl_alloc<sizeof(Pos)>();
213  }
214 
215  template<class View, int o>
216  forceinline void
218  home.fl_dispose<sizeof(Pos)>(this,this);
219  }
220 
221 
222  template<class View, int o>
223  forceinline bool
225  return pos == NULL;
226  }
227  template<class View, int o>
228  forceinline void
230  // Try to avoid entering same position twice
231  if ((pos != NULL) && (pos->p == p))
232  return;
233  pos = new (home) Pos(p,pos);
234  }
235  template<class View, int o>
236  forceinline int
238  Pos* t = pos;
239  int p = t->p;
240  pos = pos->next();
241  t->dispose(home);
242  return p;
243  }
244 
245  template<class View, int o>
248  : NaryPropagator<View,PC_INT_NONE>(home,x),
249  c(home), pos(NULL), run(false), n_subsumed(0) {
250  for (int i=x.size(); i--; )
251  x[i].subscribe(home, *new (home) Index(home,*this,c,i));
252  }
253 
254  template<class View, int o>
255  ExecStatus
257  assert((o == 0) || (o == 1));
258  // Check for sharing
259  if (x.same(home)) {
260  if (o == 1)
261  return ES_FAILED;
262  /*
263  * Eliminate sharing: if a view occurs twice, all views in between
264  * must be equal.
265  */
266  int n = x.size();
267  for (int i=0; i<n; i++)
268  for (int j=n-1; j>i; j--)
269  if (same(x[i],x[j])) {
270  if (i+1 != j) {
271  // Create equality propagator for elements i+1 ... j
272  ViewArray<View> y(home,j-i);
273  for (int k=j-i; k--; )
274  y[k] = x[i+1+k];
276  }
277  for (int k=0; k<n-1-j-1+1; k++)
278  x[i+1+k]=x[j+1+k];
279  n -= j-i;
280  break;
281  }
282  x.size(n);
283  }
284 
285  // Propagate one round
286  for (int i=1; i<x.size(); i++)
287  GECODE_ME_CHECK(x[i].gq(home,x[i-1].min()+o));
288  for (int i=x.size()-1; i--;)
289  GECODE_ME_CHECK(x[i].lq(home,x[i+1].max()-o));
290  // Eliminate redundant variables
291  {
292  // Eliminate at beginning
293  {
294  int i=0;
295  while ((i+1 < x.size()) && (x[i].max()+o <= x[i+1].min()))
296  i++;
297  x.drop_fst(i);
298  }
299  // Eliminate at end
300  {
301  int i=x.size()-1;
302  while ((i > 0) && (x[i-1].max()+o <= x[i].min()))
303  i--;
304  x.drop_lst(i);
305  }
306  // Eliminate in the middle
307  if (x.size() > 1) {
308  int j=1;
309  for (int i=1; i+1<x.size(); i++)
310  if ((x[j-1].max()+o > x[i].min()) ||
311  (x[i].max()+o > x[i+1].min()))
312  x[j++]=x[i];
313  x[j++]=x[x.size()-1];
314  x.size(j);
315  }
316  }
317  if (x.size() == 2) {
318  if (o == 0)
319  return Lq<View,View>::post(home,x[0],x[1]);
320  else
321  return Le<View,View>::post(home,x[0],x[1]);
322  } else if (x.size() >= 2) {
323  (void) new (home) NaryLqLe<View,o>(home,x);
324  }
325  return ES_OK;
326  }
327 
328  template<class View, int o>
331  : NaryPropagator<View,PC_INT_NONE>(home,share,p),
332  pos(NULL), run(false), n_subsumed(p.n_subsumed) {
333  assert(p.pos == NULL);
334  c.update(home, share, p.c);
335  }
336 
337  template<class View, int o>
338  Actor*
339  NaryLqLe<View,o>::copy(Space& home, bool share) {
340  if (n_subsumed > n_threshold) {
341  Region r(home);
342  // Record for which views there is an advisor
343  Support::BitSet<Region> a(r,static_cast<unsigned int>(x.size()));
344  for (Advisors<Index> as(c); as(); ++as)
345  a.set(static_cast<unsigned int>(as.advisor().i));
346  // Compact view array and compute map for advisors
347  int* m = r.alloc<int>(x.size());
348  int j=0;
349  for (int i=0; i<x.size(); i++)
350  if (a.get(static_cast<unsigned int>(i))) {
351  m[i] = j; x[j++] = x[i];
352  }
353  x.size(j);
354  // Remap advisors
355  for (Advisors<Index> as(c); as(); ++as)
356  as.advisor().i = m[as.advisor().i];
357 
358  n_subsumed = 0;
359  }
360  return new (home) NaryLqLe<View,o>(home,share,*this);
361  }
362 
363  template<class View, int o>
364  PropCost
367  }
368 
369  template<class View, int o>
370  forceinline size_t
372  for (Advisors<Index> as(c); as(); ++as)
373  x[as.advisor().i].cancel(home,as.advisor());
374  c.dispose(home);
375  while (!empty())
376  (void) pop(home);
378  return sizeof(*this);
379  }
380 
381 
382  template<class View, int o>
383  ExecStatus
385  Index& a = static_cast<Index&>(_a);
386  const int i = a.i;
387  switch (View::modevent(d)) {
388  case ME_INT_VAL:
389  a.dispose(home,c);
390  n_subsumed++;
391  break;
392  case ME_INT_BND:
393  if (((i == 0) || (x[i-1].max()+o <= x[i].min())) &&
394  ((i == x.size()-1) || (x[i].max()+o <= x[i+1].min()))) {
395  x[i].cancel(home,a);
396  a.dispose(home,c);
397  n_subsumed++;
398  return (run || (n_subsumed + 1 < x.size())) ? ES_FIX : ES_NOFIX;
399  }
400  break;
401  default:
402  return ES_FIX;
403  }
404  if (run)
405  return ES_FIX;
406  if (((i < x.size()-1) && (x[i+1].min() < x[i].min()+o)) ||
407  ((i > 0) && (x[i-1].max() > x[i].max()-o))) {
408  push(home,i);
409  return ES_NOFIX;
410  }
411  return (n_subsumed+1 >= x.size()) ? ES_NOFIX : ES_FIX;
412  }
413 
414  template<class View, int o>
415  void
417  View::schedule(home, *this, ME_INT_BND);
418  }
419 
420  template<class View, int o>
421  ExecStatus
423  run = true;
424  int n = x.size();
425  while (!empty()) {
426  int p = pop(home);
427  for (int i=p; i<n-1; i++) {
428  ModEvent me = x[i+1].gq(home,x[i].min()+o);
429  if (me_failed(me))
430  return ES_FAILED;
431  if (!me_modified(me))
432  break;
433  }
434  for (int i=p; i>0; i--) {
435  ModEvent me = x[i-1].lq(home,x[i].max()-o);
436  if (me_failed(me))
437  return ES_FAILED;
438  if (!me_modified(me))
439  break;
440  }
441  }
442 #ifdef GECODE_AUDIT
443  for (int i=0; i<n-1; i++)
444  assert(!me_modified(x[i+1].gq(home,x[i].min()+o)));
445  for (int i=n-1; i>0; i--)
446  assert(!me_modified(x[i-1].lq(home,x[i].max()-o)));
447 #endif
448  if (n_subsumed+1 >= n)
449  return home.ES_SUBSUMED(*this);
450  run = false;
451  return ES_FIX;
452  }
453 
454 
455 
456  /*
457  * Reified less or equal propagator
458  *
459  */
460 
461  template<class View, class CtrlView, ReifyMode rm>
463  ReLq<View,CtrlView,rm>::ReLq(Home home, View x0, View x1, CtrlView b)
464  : ReBinaryPropagator<View,PC_INT_BND,CtrlView>(home,x0,x1,b) {}
465 
466  template<class View, class CtrlView, ReifyMode rm>
467  ExecStatus
468  ReLq<View,CtrlView,rm>::post(Home home, View x0, View x1, CtrlView b) {
469  if (b.one()) {
470  if (rm == RM_PMI)
471  return ES_OK;
472  return Lq<View,View>::post(home,x0,x1);
473  }
474  if (b.zero()) {
475  if (rm == RM_IMP)
476  return ES_OK;
477  return Le<View,View>::post(home,x1,x0);
478  }
479  if (!same(x0,x1)) {
480  switch (rtest_lq(x0,x1)) {
481  case RT_TRUE:
482  if (rm != RM_IMP)
483  GECODE_ME_CHECK(b.one_none(home));
484  break;
485  case RT_FALSE:
486  if (rm != RM_PMI)
487  GECODE_ME_CHECK(b.zero_none(home));
488  break;
489  case RT_MAYBE:
490  (void) new (home) ReLq<View,CtrlView,rm>(home,x0,x1,b);
491  break;
492  default: GECODE_NEVER;
493  }
494  } else if (rm != RM_IMP) {
495  GECODE_ME_CHECK(b.one_none(home));
496  }
497  return ES_OK;
498  }
499 
500  template<class View, class CtrlView, ReifyMode rm>
503  : ReBinaryPropagator<View,PC_INT_BND,CtrlView>(home,share,p) {}
504 
505  template<class View, class CtrlView, ReifyMode rm>
506  Actor*
507  ReLq<View,CtrlView,rm>::copy(Space& home, bool share) {
508  return new (home) ReLq<View,CtrlView,rm>(home,share,*this);
509  }
510 
511  template<class View, class CtrlView, ReifyMode rm>
512  ExecStatus
514  if (b.one()) {
515  if (rm != RM_PMI)
516  GECODE_REWRITE(*this,(Lq<View,View>::post(home(*this),x0,x1)));
517  } else if (b.zero()) {
518  if (rm != RM_IMP)
519  GECODE_REWRITE(*this,(Le<View,View>::post(home(*this),x1,x0)));
520  } else {
521  switch (rtest_lq(x0,x1)) {
522  case RT_TRUE:
523  if (rm != RM_IMP)
524  GECODE_ME_CHECK(b.one_none(home));
525  break;
526  case RT_FALSE:
527  if (rm != RM_PMI)
528  GECODE_ME_CHECK(b.zero_none(home));
529  break;
530  case RT_MAYBE:
531  return ES_FIX;
532  default: GECODE_NEVER;
533  }
534  }
535  return home.ES_SUBSUMED(*this);
536  }
537 
538  /*
539  * Reified less or equal propagator involving one variable
540  *
541  */
542 
543  template<class View, class CtrlView, ReifyMode rm>
545  ReLqInt<View,CtrlView,rm>::ReLqInt(Home home, View x, int c0, CtrlView b)
546  : ReUnaryPropagator<View,PC_INT_BND,CtrlView>(home,x,b), c(c0) {}
547 
548  template<class View, class CtrlView, ReifyMode rm>
549  ExecStatus
550  ReLqInt<View,CtrlView,rm>::post(Home home, View x, int c, CtrlView b) {
551  if (b.one()) {
552  if (rm != RM_PMI)
553  GECODE_ME_CHECK(x.lq(home,c));
554  } else if (b.zero()) {
555  if (rm != RM_IMP)
556  GECODE_ME_CHECK(x.gr(home,c));
557  } else {
558  switch (rtest_lq(x,c)) {
559  case RT_TRUE:
560  if (rm != RM_IMP)
561  GECODE_ME_CHECK(b.one_none(home));
562  break;
563  case RT_FALSE:
564  if (rm != RM_PMI)
565  GECODE_ME_CHECK(b.zero_none(home));
566  break;
567  case RT_MAYBE:
568  (void) new (home) ReLqInt<View,CtrlView,rm>(home,x,c,b);
569  break;
570  default: GECODE_NEVER;
571  }
572  }
573  return ES_OK;
574  }
575 
576 
577  template<class View, class CtrlView, ReifyMode rm>
580  : ReUnaryPropagator<View,PC_INT_BND,CtrlView>(home,share,p), c(p.c) {}
581 
582  template<class View, class CtrlView, ReifyMode rm>
583  Actor*
585  return new (home) ReLqInt<View,CtrlView,rm>(home,share,*this);
586  }
587 
588  template<class View, class CtrlView, ReifyMode rm>
589  ExecStatus
591  if (b.one()) {
592  if (rm != RM_PMI)
593  GECODE_ME_CHECK(x0.lq(home,c));
594  } else if (b.zero()) {
595  if (rm != RM_IMP)
596  GECODE_ME_CHECK(x0.gr(home,c));
597  } else {
598  switch (rtest_lq(x0,c)) {
599  case RT_TRUE:
600  if (rm != RM_IMP)
601  GECODE_ME_CHECK(b.one_none(home));
602  break;
603  case RT_FALSE:
604  if (rm != RM_PMI)
605  GECODE_ME_CHECK(b.zero_none(home));
606  break;
607  case RT_MAYBE:
608  return ES_FIX;
609  default: GECODE_NEVER;
610  }
611  }
612  return home.ES_SUBSUMED(*this);
613  }
614 
615 }}}
616 
617 // STATISTICS: int-prop
618 
bool get(unsigned int i) const
Access value at bit i.
bool empty(void) const
Whether no more positions must be propagated.
Definition: lq-le.hpp:224
Council of advisors
Definition: core.hpp:232
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
Definition: macros.hpp:120
Le(Space &home, bool share, Le &p)
Constructor for cloning p.
Definition: lq-le.hpp:151
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: lq-le.hpp:339
Relation may hold or not.
Definition: view.hpp:1616
NodeType t
Type of node.
Definition: bool-expr.cpp:234
Inverse implication for reification.
Definition: int.hh:850
ExecStatus ES_SUBSUMED(Propagator &p)
Definition: core.hpp:3614
Reified unary propagator.
Definition: propagator.hpp:58
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: lq-le.hpp:507
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
Definition: region.hpp:326
static ExecStatus post(Home home, ViewArray< View > &x)
Post propagator for .
Definition: lq-le.hpp:256
static ExecStatus post(Home home, V0 x0, V1 x1)
Post propagator .
Definition: lq-le.hpp:73
FreeList * next(void) const
Return next freelist object.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:53
int n_subsumed
Number of already subsumed advisors (or views)
Definition: rel.hh:291
Reified binary propagator.
Definition: propagator.hpp:91
int c
Integer constant to check.
Definition: rel.hh:589
void push(Space &home, int p)
Push a new position p to be propagated.
Definition: lq-le.hpp:229
int ModEvent
Type for modification events.
Definition: core.hpp:142
int p
Position of view in view array.
Definition: rel.hh:253
ViewArray< View > x
Array of views.
Definition: propagator.hpp:152
Reified less or equal with integer propagator.
Definition: rel.hh:583
bool same(const Space &home) const
Test whether array has multiple occurence of the same view.
Definition: array.hpp:1475
Base-class for propagators.
Definition: core.hpp:1092
Base-class for advisors.
Definition: core.hpp:1294
Class to iterate over advisors of a council.
Definition: core.hpp:233
Handle to region.
Definition: region.hpp:61
Propagation has computed fixpoint.
Definition: core.hpp:545
Computation spaces.
Definition: core.hpp:1748
ReLq(Space &home, bool share, ReLq &p)
Constructor for cloning p.
Definition: lq-le.hpp:502
Base-class for both propagators and branchers.
Definition: core.hpp:696
Gecode::IntSet d(v, 7)
bool run
Whether the propagator is currently running.
Definition: rel.hh:289
Reified less or equal propagator.
Definition: rel.hh:556
Index(Space &home, Propagator &p, Council< Index > &c, int i)
Create index advisor.
Definition: lq-le.hpp:177
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Definition: macros.hpp:95
RelTest rtest_lq(VX x, VY y)
Test whether view x is less or equal than view y.
Definition: rel-test.hpp:168
bool same(const CachedView< View > &x, const CachedView< View > &y)
Definition: cached.hpp:389
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Gecode::FloatVal c(-8, 8)
Single _a(2, 3)
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
bool same(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether two views are the same.
Definition: view.hpp:643
Gecode::IntArgs i(4, 1, 2, 3, 4)
void drop_lst(int i)
Drop views from positions i+1 to size()-1 from array.
Definition: array.hpp:1308
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: lq-le.hpp:94
const Gecode::PropCond PC_INT_NONE
Propagation condition to be ignored (convenience)
Definition: var-type.hpp:74
Execution has resulted in failure.
Definition: core.hpp:542
Council< Index > c
The advisor council.
Definition: rel.hh:248
Relation does not hold.
Definition: view.hpp:1615
Pos * next(void) const
Return next position.
Definition: lq-le.hpp:195
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
Definition: var-type.hpp:91
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: lq-le.hpp:88
const Gecode::ModEvent ME_INT_VAL
Domain operation has resulted in a value (assigned variable)
Definition: var-type.hpp:56
void subscribe(Space &home, Propagator &p, IntSet &y)
Definition: rel.hpp:75
int pop(Space &home)
Pop a position to be propagated and return it.
Definition: lq-le.hpp:237
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: lq-le.hpp:422
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
Less or equal propagator.
Definition: rel.hh:497
static ExecStatus post(Home home, View x, int c, CtrlView b)
Post propagator for .
Definition: lq-le.hpp:550
const Gecode::ModEvent ME_INT_BND
Domain operation has changed the minimum or maximum of the domain.
Definition: var-type.hpp:65
n-ary propagator
Definition: propagator.hpp:149
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: lq-le.hpp:365
void set(unsigned int i)
Set bit i.
Expensive.
Definition: core.hpp:582
virtual void reschedule(Space &home)
Schedule function.
Definition: lq-le.hpp:416
Lq(Space &home, bool share, Lq &p)
Constructor for cloning p.
Definition: lq-le.hpp:83
View arrays.
Definition: array.hpp:234
void drop_fst(int i)
Drop views from positions 0 to i-1 from array.
Definition: array.hpp:1301
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: lq-le.hpp:584
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
Definition: macros.hpp:56
n-ary less and less or equal propagator
Definition: rel.hh:234
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition: set.hh:784
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:71
static ExecStatus post(Home home, View x0, View x1, CtrlView b)
Post propagator for .
Definition: lq-le.hpp:468
Integer view for integer variables.
Definition: view.hpp:129
Post propagator for SetVar SetOpType SetVar y
Definition: set.hh:784
Generic domain change information to be supplied to advisors.
Definition: core.hpp:281
Mixed binary propagator.
Definition: propagator.hpp:213
void dispose(Space &home)
Free memory for this position.
Definition: lq-le.hpp:217
ReLqInt(Space &home, bool share, ReLqInt &p)
Constructor for cloning p.
Definition: lq-le.hpp:579
static ExecStatus post(Home home, V0 x0, V1 x1)
Post propagator .
Definition: lq-le.hpp:139
void dispose(Space &home, Council< A > &c)
Dispose the advisor.
Definition: core.hpp:3915
Propagation cost.
Definition: core.hpp:554
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition: lq-le.hpp:371
ExecStatus
Definition: core.hpp:540
Minus integer view.
Definition: view.hpp:276
#define forceinline
Definition: config.hpp:173
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: lq-le.hpp:156
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
Definition: modevent.hpp:63
Base-class for freelist-managed objects.
void fl_dispose(FreeList *f, FreeList *l)
Return freelist-managed memory to freelist.
Definition: core.hpp:2858
Post propagator for SetVar x
Definition: set.hh:784
Execution is okay.
Definition: core.hpp:544
Propagation has not computed fixpoint.
Definition: core.hpp:543
NaryLqLe(Space &home, bool share, NaryLqLe< View, o > &p)
Constructor for cloning p.
Definition: lq-le.hpp:330
Positions in view array that have to be propagated.
Definition: rel.hh:250
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition: lq-le.hpp:384
n-ary bounds consistent equality propagator
Definition: rel.hh:200
static const int n_threshold
Compact during cloning when more advisors than that are subsumed.
Definition: rel.hh:293
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: lq-le.hpp:590
static bool same(V0 x0, V1 x1)
Whether views refer to same variable.
Definition: lq-le.hpp:114
int i
The position of the view in the view array.
Definition: rel.hh:241
Gecode toplevel namespace
Pos(int p, Pos *n)
Initialize with position p and next position n.
Definition: lq-le.hpp:190
Implication for reification.
Definition: int.hh:843
Advisors for views (by position in array)
Definition: rel.hh:238
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: lq-le.hpp:513
Less propagator.
Definition: rel.hh:523
int size(void) const
Return size of array (number of elements)
Definition: array.hpp:1215
int ModEventDelta
Modification event deltas.
Definition: core.hpp:169
Home class for posting propagators
Definition: core.hpp:922
static PropCost binary(PropCost::Mod m)
Two variables for modifier pcm.
Definition: core.hpp:4854
#define GECODE_NEVER
Assert that this command is never executed.
Definition: macros.hpp:60
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: lq-le.hpp:162
Relation does hold.
Definition: view.hpp:1617
Pos * pos
Stack of positions.
Definition: rel.hh:281
bool me_failed(ModEvent me)
Check whether modification event me is failed.
Definition: modevent.hpp:58
static bool same(V0 x0, V1 x1)
Whether views refer to same variable.
Definition: lq-le.hpp:54
Boolean view for Boolean variables.
Definition: view.hpp:1315