Generated on Thu Apr 5 2018 19:44:19 for Gecode by doxygen 1.8.13
pow.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  *
6  * Copyright:
7  * Christian Schulte, 2012
8  *
9  * Last modified:
10  * $Date$ by $Author$
11  * $Revision$
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 <gecode/int/rel.hh>
39 
40 #include <climits>
41 #include <algorithm>
42 
43 namespace Gecode { namespace Int { namespace Arithmetic {
44 
45  /*
46  * Positive bounds consistent power
47  *
48  */
49  template<class VA, class VB, class Ops>
50  inline ExecStatus
51  prop_pow_plus_bnd(Space& home, VA x0, VB x1, const Ops& ops) {
52  bool mod;
53  do {
54  mod = false;
55  {
56  ModEvent me = x0.lq(home,ops.fnroot(x1.max()));
57  if (me_failed(me)) return ES_FAILED;
58  mod |= me_modified(me);
59  }
60  {
61  ModEvent me = x0.gq(home,ops.cnroot(x1.min()));
62  if (me_failed(me)) return ES_FAILED;
63  mod |= me_modified(me);
64  }
65  {
66  ModEvent me = x1.lq(home,ops.pow(x0.max()));
67  if (me_failed(me)) return ES_FAILED;
68  mod |= me_modified(me);
69  }
70  {
71  ModEvent me = x1.gq(home,ops.pow(x0.min()));
72  if (me_failed(me)) return ES_FAILED;
73  mod |= me_modified(me);
74  }
75  } while (mod);
76  return ES_OK;
77  }
78 
79  template<class VA, class VB, class Ops>
81  PowPlusBnd<VA,VB,Ops>::PowPlusBnd(Home home, VA x0, VB x1, const Ops& o)
82  : MixBinaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND>(home,x0,x1),
83  ops(o) {}
84 
85  template<class VA, class VB, class Ops>
87  PowPlusBnd<VA,VB,Ops>::post(Home home, VA x0, VB x1, Ops ops) {
88  GECODE_ME_CHECK(x0.gq(home,0));
89  GECODE_ME_CHECK(x1.gq(home,0));
90  GECODE_ES_CHECK(prop_pow_plus_bnd(home,x0,x1,ops));
91  if (!x0.assigned()) {
92  assert(!x1.assigned());
93  (void) new (home) PowPlusBnd<VA,VB,Ops>(home,x0,x1,ops);
94  }
95  return ES_OK;
96  }
97 
98  template<class VA, class VB, class Ops>
101  : MixBinaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND>(home,p),
102  ops(p.ops) {}
103 
104  template<class VA, class VB, class Ops>
105  Actor*
107  return new (home) PowPlusBnd<VA,VB,Ops>(home,*this);
108  }
109 
110  template<class VA, class VB, class Ops>
111  ExecStatus
114  return x0.assigned() ? home.ES_SUBSUMED(*this) : ES_FIX;
115  }
116 
117 
118 
119  /*
120  * Bounds consistent power
121  *
122  */
123 
124  template<class Ops>
125  inline ExecStatus
126  prop_pow_bnd(Space& home, IntView x0, IntView x1, const Ops& ops) {
127  assert((x0.min() < 0) && (0 < x0.max()));
128  if (ops.even()) {
129  assert(x1.min() >= 0);
130  int u = ops.fnroot(x1.max());
131  GECODE_ME_CHECK(x0.lq(home,u));
132  GECODE_ME_CHECK(x0.gq(home,-u));
133  GECODE_ME_CHECK(x1.lq(home,std::max(ops.pow(x0.max()),
134  ops.pow(-x0.min()))));
135  } else {
136  assert((x1.min() < 0) && (0 < x1.max()));
137  GECODE_ME_CHECK(x0.lq(home,ops.fnroot(x1.max())));
138  GECODE_ME_CHECK(x0.gq(home,-ops.fnroot(-x1.min())));
139  GECODE_ME_CHECK(x1.lq(home,ops.pow(x0.max())));
140  GECODE_ME_CHECK(x1.gq(home,ops.pow(x0.min())));
141  }
142  return ES_OK;
143  }
144 
145  template<class Ops>
147  PowBnd<Ops>::PowBnd(Home home, IntView x0, IntView x1, const Ops& o)
148  : BinaryPropagator<IntView,PC_INT_BND>(home,x0,x1),
149  ops(o) {}
150 
151  template<class Ops>
152  inline ExecStatus
154  if (static_cast<unsigned int>(ops.exp()) >= sizeof(int) * CHAR_BIT) {
155  // The integer limits allow only -1, 0, 1 for x0
156  GECODE_ME_CHECK(x0.lq(home,1));
157  GECODE_ME_CHECK(x0.gq(home,-1));
158  // Just rewrite to values that can be handeled without overflow
159  ops.exp(ops.even() ? 2 : 1);
160  }
161 
162  if (ops.exp() == 0) {
163  GECODE_ME_CHECK(x1.eq(home,1));
164  return ES_OK;
165  } else if (ops.exp() == 1) {
166  return Rel::EqBnd<IntView,IntView>::post(home,x0,x1);
167  }
168 
169  if (same(x0,x1)) {
170  assert(ops.exp() != 0);
171  GECODE_ME_CHECK(x0.lq(home,1));
172  GECODE_ME_CHECK(x0.gq(home,ops.even() ? 0 : -1));
173  return ES_OK;
174  }
175 
176  // Limits values such that no overflow can occur
177  assert(Limits::max == -Limits::min);
178  {
179  int l = ops.fnroot(Limits::max);
180  GECODE_ME_CHECK(x0.lq(home,l));
181  GECODE_ME_CHECK(x0.gq(home,-l));
182  }
183 
184  if ((x0.min() >= 0) || ((x1.min() >= 0) && !ops.even()))
185  return PowPlusBnd<IntView,IntView,Ops>::post(home,x0,x1,ops);
186 
187  if (ops.even() && (x0.max() <= 0))
189  ::post(home,MinusView(x0),x1,ops);
190 
191  if (!ops.even() && ((x0.max() <= 0) || (x1.max() <= 0)))
193  ::post(home,MinusView(x0),MinusView(x1),ops);
194 
195  if (ops.even())
196  GECODE_ME_CHECK(x1.gq(home,0));
197 
198  assert((x0.min() < 0) && (x0.max() > 0));
199 
200  if (ops.even()) {
201  GECODE_ME_CHECK(x1.lq(home,std::max(ops.pow(x0.min()),
202  ops.pow(x0.max()))));
203  } else {
204  GECODE_ME_CHECK(x1.lq(home,ops.pow(x0.max())));
205  GECODE_ME_CHECK(x1.gq(home,ops.pow(x0.min())));
206  }
207 
208  (void) new (home) PowBnd<Ops>(home,x0,x1,ops);
209  return ES_OK;
210  }
211 
212  template<class Ops>
216  ops(p.ops) {}
217 
218  template<class Ops>
219  Actor*
221  return new (home) PowBnd<Ops>(home,*this);
222  }
223 
224  template<class Ops>
225  ExecStatus
227  if ((x0.min() >= 0) || ((x1.min() >= 0) && !ops.even()))
229  ::post(home(*this),x0,x1,ops)));
230 
231  if (ops.even() && (x0.max() <= 0))
233  ::post(home(*this),MinusView(x0),x1,ops)));
234 
235  if (!ops.even() && ((x0.max() <= 0) || (x1.max() <= 0)))
237  ::post(home(*this),MinusView(x0),
238  MinusView(x1),ops)));
239 
240  GECODE_ES_CHECK(prop_pow_bnd<Ops>(home,x0,x1,ops));
241 
242  if (x0.assigned() && x1.assigned())
243  return (ops.pow(x0.val()) == x1.val()) ?
244  home.ES_SUBSUMED(*this) : ES_FAILED;
245 
246  return ES_NOFIX;
247  }
248 
249 
250  /*
251  * Value mappings for power and nroot
252  *
253  */
254 
256  template<class Ops>
257  class ValuesMapPow {
258  protected:
260  Ops ops;
261  public:
263  forceinline ValuesMapPow(const Ops& o) : ops(o) {}
265  forceinline int val(int x) const {
266  return ops.pow(x);
267  }
268  };
269 
271  template<class Ops>
273  protected:
275  Ops ops;
276  public:
278  forceinline ValuesMapNroot(const Ops& o) : ops(o) {}
280  forceinline int val(int x) const {
281  return ops.fnroot(x);
282  }
283  };
284 
286  template<class Ops>
288  protected:
290  Ops ops;
291  public:
293  forceinline ValuesMapNrootSigned(const Ops& o) : ops(o) {}
295  forceinline int val(int x) const {
296  if (x < 0)
297  return -ops.fnroot(-x);
298  else
299  return ops.fnroot(x);
300  }
301  };
302 
303 
304  /*
305  * Positive domain consistent power
306  *
307  */
308  template<class VA, class VB, class Ops>
310  PowPlusDom<VA,VB,Ops>::PowPlusDom(Home home, VA x0, VB x1, const Ops& o)
311  : MixBinaryPropagator<VA,PC_INT_DOM,VB,PC_INT_DOM>(home,x0,x1),
312  ops(o) {}
313 
314  template<class VA, class VB, class Ops>
316  PowPlusDom<VA,VB,Ops>::post(Home home, VA x0, VB x1, Ops ops) {
317  GECODE_ME_CHECK(x0.gq(home,0));
318  GECODE_ME_CHECK(x1.gq(home,0));
319  GECODE_ES_CHECK(prop_pow_plus_bnd(home,x0,x1,ops));
320  if (!x0.assigned()) {
321  assert(!x1.assigned());
322  (void) new (home) PowPlusDom<VA,VB,Ops>(home,x0,x1,ops);
323  }
324  return ES_OK;
325  }
326 
327  template<class VA, class VB, class Ops>
330  : MixBinaryPropagator<VA,PC_INT_DOM,VB,PC_INT_DOM>(home,p),
331  ops(p.ops) {}
332 
333  template<class VA, class VB, class Ops>
334  Actor*
336  return new (home) PowPlusDom<VA,VB,Ops>(home,*this);
337  }
338 
339  template<class VA, class VB, class Ops>
340  PropCost
342  if (VA::me(med) == ME_INT_VAL)
344  else if (VA::me(med) == ME_INT_DOM)
346  else
348  }
349 
350  template<class VA, class VB, class Ops>
351  ExecStatus
353  if (VA::me(med) != ME_INT_DOM) {
355  return x0.assigned() ?
356  home.ES_SUBSUMED(*this)
357  : home.ES_NOFIX_PARTIAL(*this,VA::med(ME_INT_DOM));
358  }
359 
360  {
361  ViewValues<VA> v0(x0);
362  ValuesMapPow<Ops> vmp(ops);
364  GECODE_ME_CHECK(x1.inter_v(home,s0,false));
365  }
366 
367  {
371  GECODE_ME_CHECK(x0.inter_v(home,s1,false));
372  }
373 
374  return x0.assigned() ? home.ES_SUBSUMED(*this) : ES_FIX;
375  }
376 
377 
378  /*
379  * Domain consistent power
380  *
381  */
382 
383  template<class Ops>
385  PowDom<Ops>::PowDom(Home home, IntView x0, IntView x1, const Ops& o)
386  : BinaryPropagator<IntView,PC_INT_DOM>(home,x0,x1), ops(o) {}
387 
388  template<class Ops>
389  inline ExecStatus
391  if (static_cast<unsigned int>(ops.exp()) >= sizeof(int) * CHAR_BIT) {
392  // The integer limits allow only -1, 0, 1 for x0
393  GECODE_ME_CHECK(x0.lq(home,1));
394  GECODE_ME_CHECK(x0.gq(home,-1));
395  // Just rewrite to values that can be handeled without overflow
396  ops.exp(ops.even() ? 2 : 1);
397  }
398 
399  if (ops.exp() == 0) {
400  GECODE_ME_CHECK(x1.eq(home,1));
401  return ES_OK;
402  } else if (ops.exp() == 1) {
403  return Rel::EqDom<IntView,IntView>::post(home,x0,x1);
404  }
405 
406  if (same(x0,x1)) {
407  assert(ops.exp() != 0);
408  GECODE_ME_CHECK(x0.lq(home,1));
409  GECODE_ME_CHECK(x0.gq(home,ops.even() ? 0 : -1));
410  return ES_OK;
411  }
412 
413  // Limits values such that no overflow can occur
414  assert(Limits::max == -Limits::min);
415  {
416  int l = ops.fnroot(Limits::max);
417  GECODE_ME_CHECK(x0.lq(home,l));
418  GECODE_ME_CHECK(x0.gq(home,-l));
419  }
420 
421  if ((x0.min() >= 0) || ((x1.min() >= 0) && !ops.even()))
422  return PowPlusDom<IntView,IntView,Ops>::post(home,x0,x1,ops);
423 
424  if (ops.even() && (x0.max() <= 0))
426  ::post(home,MinusView(x0),x1,ops);
427 
428  if (!ops.even() && ((x0.max() <= 0) || (x1.max() <= 0)))
430  ::post(home,MinusView(x0),MinusView(x1),ops);
431 
432  if (ops.even())
433  GECODE_ME_CHECK(x1.gq(home,0));
434 
435  assert((x0.min() < 0) && (x0.max() > 0));
436 
437  if (ops.even()) {
438  GECODE_ME_CHECK(x1.lq(home,std::max(ops.pow(x0.min()),
439  ops.pow(x0.max()))));
440  } else {
441  GECODE_ME_CHECK(x1.lq(home,ops.pow(x0.max())));
442  GECODE_ME_CHECK(x1.gq(home,ops.pow(x0.min())));
443  }
444 
445  (void) new (home) PowDom<Ops>(home,x0,x1,ops);
446  return ES_OK;
447  }
448 
449  template<class Ops>
453  ops(p.ops) {}
454 
455  template<class Ops>
456  Actor*
458  return new (home) PowDom<Ops>(home,*this);
459  }
460 
461  template<class Ops>
462  PropCost
463  PowDom<Ops>::cost(const Space&, const ModEventDelta& med) const {
464  if (IntView::me(med) == ME_INT_VAL)
466  else if (IntView::me(med) == ME_INT_DOM)
468  else
470  }
471 
472  template<class Ops>
473  ExecStatus
475  if ((x0.min() >= 0) || ((x1.min() >= 0) && !ops.even()))
477  ::post(home(*this),x0,x1,ops)));
478 
479  if (ops.even() && (x0.max() <= 0))
481  ::post(home(*this),MinusView(x0),x1,ops)));
482 
483  if (!ops.even() && ((x0.max() <= 0) || (x1.max() <= 0)))
485  ::post(home(*this),MinusView(x0),
486  MinusView(x1),ops)));
487 
488  if (IntView::me(med) != ME_INT_DOM) {
489  GECODE_ES_CHECK(prop_pow_bnd<Ops>(home,x0,x1,ops));
490  if (x0.assigned() && x1.assigned())
491  return (ops.pow(x0.val()) == x1.val()) ?
492  home.ES_SUBSUMED(*this) : ES_FAILED;
493 
494  return home.ES_NOFIX_PARTIAL(*this,IntView::med(ME_INT_DOM));
495  }
496 
497  Region r;
498  if (ops.even()) {
499  ViewValues<IntView> i(x0), j(x0);
500  using namespace Iter::Values;
501  Positive<ViewValues<IntView> > pos(i);
502  Negative<ViewValues<IntView> > neg(j);
503  Minus m(r,neg);
504 
505  ValuesMapPow<Ops> vmp(ops);
506  Map<Positive<ViewValues<IntView> >,ValuesMapPow<Ops>,true> sp(pos,vmp);
507  Map<Minus,ValuesMapPow<Ops>,true> sm(m,vmp);
508  Union<Map<Positive<ViewValues<IntView> >,ValuesMapPow<Ops>,true>,
509  Map<Minus,ValuesMapPow<Ops>,true> > u(sp,sm);
510  GECODE_ME_CHECK(x1.inter_v(home,u,false));
511  } else {
513  ValuesMapPow<Ops> vmp(ops);
515  GECODE_ME_CHECK(x1.inter_v(home,s0,false));
516  }
517 
518  if (ops.even()) {
519  ViewValues<IntView> i(x1), j(x1);
520  using namespace Iter::Values;
522  Map<ViewValues<IntView>,ValuesMapNroot<Ops>,true> si(i,vmn), sj(j,vmn);
523  Minus mi(r,si);
524  Union<Minus,
525  Map<ViewValues<IntView>,ValuesMapNroot<Ops>,true> > u(mi,sj);
526  GECODE_ME_CHECK(x0.inter_v(home,u,false));
527  } else {
531  s1(v1,vmn);
532  GECODE_ME_CHECK(x0.inter_v(home,s1,false));
533  }
534 
535  return x0.assigned() ? home.ES_SUBSUMED(*this) : ES_FIX;
536  }
537 
538 }}}
539 
540 // STATISTICS: int-prop
541 
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntPropLevel ipl)
Post propagator for .
Definition: arithmetic.cpp:267
int val(void) const
Return assigned value (only if assigned)
Definition: int.hpp:70
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
Definition: macros.hpp:120
const SetInstr * si[]
Definition: mm-set.cpp:4340
NNF * l
Left subtree.
Definition: bool-expr.cpp:244
ExecStatus ES_SUBSUMED(Propagator &p)
Definition: core.hpp:3433
const FloatNum max
Largest allowed float value.
Definition: float.hh:848
ModEvent eq(Space &home, int n)
Restrict domain values to be equal to n.
Definition: int.hpp:160
Propagator for ternary union
Definition: rel-op.hh:156
Mapping integer (must be an n-th power) to n-th root.
Definition: pow.hpp:272
ExecStatus ES_NOFIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has not computed partial fixpoint
Definition: core.hpp:3446
static ExecStatus post(Home home, View0 x0, View1 x1)
Post domain consistent propagator .
Definition: eq.hpp:180
int ModEvent
Type for modification events.
Definition: core.hpp:64
static ExecStatus post(Home home, VA x0, VB x1, Ops ops)
Post propagator.
Definition: pow.hpp:87
Bounds consistent power propagator.
Definition: arithmetic.hh:399
ValuesMapNroot(const Ops &o)
Initialize with operations o.
Definition: pow.hpp:278
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: pow.hpp:474
Handle to region.
Definition: region.hpp:57
Value iterator for integer views.
Definition: view.hpp:94
#define forceinline
Definition: config.hpp:182
Propagation has computed fixpoint.
Definition: core.hpp:469
static PropCost unary(PropCost::Mod m)
Single variable for modifier pcm.
Definition: core.hpp:4660
const int max
Largest allowed integer value.
Definition: int.hh:116
PowPlusBnd(Home home, VA x0, VB x1, const Ops &ops)
Constructor for posting.
Definition: pow.hpp:81
Computation spaces.
Definition: core.hpp:1668
const int min
Smallest allowed integer value.
Definition: int.hh:118
Base-class for both propagators and branchers.
Definition: core.hpp:620
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition: pow.hpp:220
static ExecStatus post(Home home, View0 x0, View1 x1)
Post bounds consistent propagator .
Definition: eq.hpp:112
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Definition: macros.hpp:95
bool same(const CachedView< View > &x, const CachedView< View > &y)
Definition: cached.hpp:394
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
Mapping integer (must be an n-th power) to n-th root (signed)
Definition: pow.hpp:287
Gecode::IntArgs i(4, 1, 2, 3, 4)
static ExecStatus post(Home home, VA x0, VB x1, Ops ops)
Post propagator.
Definition: pow.hpp:316
Execution has resulted in failure.
Definition: core.hpp:466
ModEvent lq(Space &home, int n)
Restrict domain values to be less or equal than n.
Definition: int.hpp:115
Binary propagator.
Definition: pattern.hpp:88
int med(void) const
Return median of domain (greatest element not greater than the median)
Definition: int.hpp:66
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
ModEventDelta med
A set of modification events (used during propagation)
Definition: core.hpp:1027
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: pow.hpp:341
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition: pow.hpp:153
Bounds consistent positive power propagator.
Definition: arithmetic.hh:373
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: pow.hpp:112
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition: pow.hpp:335
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
Definition: var-type.hpp:100
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: pow.hpp:352
int min(void) const
Return minimum of domain.
Definition: int.hpp:58
Value iterator for mapping values of a value iterator.
Definition: values-map.hpp:49
union Gecode::@585::NNF::@62 u
Union depending on nodetype t.
Expensive.
Definition: core.hpp:506
ValuesMapNrootSigned(const Ops &o)
Initialize with operations o.
Definition: pow.hpp:293
ExecStatus prop_pow_plus_bnd(Space &home, VA x0, VB x1, const Ops &ops)
Definition: pow.hpp:51
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
Definition: macros.hpp:56
Mapping integer to power.
Definition: pow.hpp:257
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: pow.hpp:463
Domain consistent power propagator.
Definition: arithmetic.hh:458
ModEvent inter_v(Space &home, I &i, bool depends=true)
Intersect domain with values described by i.
Definition: int.hpp:195
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition: set.hh:769
Domain consistent positive power propagator.
Definition: arithmetic.hh:424
Gecode::IntArgs v1(4, Gecode::Int::Limits::min+4, 0, 1, Gecode::Int::Limits::max)
Integer view for integer variables.
Definition: view.hpp:129
bool assigned(void) const
Test whether view is assigned.
Definition: view.hpp:478
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition: pow.hpp:106
Mixed binary propagator.
Definition: pattern.hpp:208
PowDom(Space &home, PowDom< Ops > &p)
Constructor for cloning p.
Definition: pow.hpp:451
Propagation cost.
Definition: core.hpp:478
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
Definition: var-type.hpp:72
PowPlusDom(Home home, VA x0, VB x1, const Ops &ops)
Constructor for posting.
Definition: pow.hpp:310
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition: pow.hpp:457
ExecStatus
Definition: core.hpp:464
Minus integer view.
Definition: view.hpp:278
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: pow.hpp:226
static ModEvent me(const ModEventDelta &med)
Return modification event for view type in med.
Definition: view.hpp:514
bool pos(const View &x)
Test whether x is postive.
Definition: mult.hpp:74
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
Definition: modevent.hpp:63
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition: pow.hpp:390
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
Definition: int.hpp:133
Post propagator for SetVar x
Definition: set.hh:769
Execution is okay.
Definition: core.hpp:468
Propagation has not computed fixpoint.
Definition: core.hpp:467
int val(int x) const
Perform mapping.
Definition: pow.hpp:265
Gecode toplevel namespace
int max(void) const
Return maximum of domain.
Definition: int.hpp:62
int val(int x) const
Perform mapping.
Definition: pow.hpp:295
ValuesMapPow(const Ops &o)
Initialize with operations o.
Definition: pow.hpp:263
ExecStatus prop_pow_bnd(Space &home, IntView x0, IntView x1, const Ops &ops)
Definition: pow.hpp:126
int val(int x) const
Perform mapping.
Definition: pow.hpp:280
PowBnd(Space &home, PowBnd &p)
Constructor for cloning p.
Definition: pow.hpp:214
int ModEventDelta
Modification event deltas.
Definition: core.hpp:91
Home class for posting propagators
Definition: core.hpp:846
static PropCost binary(PropCost::Mod m)
Two variables for modifier pcm.
Definition: core.hpp:4656
bool me_failed(ModEvent me)
Check whether modification event me is failed.
Definition: modevent.hpp:58
bool neg(const View &x)
Test whether x is negative.
Definition: mult.hpp:80