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