Generated on Sat Aug 16 2014 17:18:28 for Gecode by doxygen 1.8.7
arithmetic.hh
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  * Guido Tack <tack@gecode.org>
6  *
7  * Copyright:
8  * Christian Schulte, 2002
9  * Guido Tack, 2004
10  *
11  * Last modified:
12  * $Date: 2013-08-29 16:05:54 +0200 (Thu, 29 Aug 2013) $ by $Author: schulte $
13  * $Revision: 13993 $
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 #ifndef __GECODE_INT_ARITHMETIC_HH__
41 #define __GECODE_INT_ARITHMETIC_HH__
42 
43 #include <gecode/int.hh>
44 
45 #include <gecode/int/rel.hh>
46 #include <gecode/int/linear.hh>
47 
53 namespace Gecode { namespace Int { namespace Arithmetic {
54 
61  template<class View>
62  class AbsBnd : public BinaryPropagator<View,PC_INT_BND> {
63  protected:
66 
68  AbsBnd(Space& home, bool share, AbsBnd& p);
70  AbsBnd(Home home, View x0, View x1);
71  public:
72 
74  virtual Actor* copy(Space& home, bool share);
81  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
83  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
85  static ExecStatus post(Home home, View x0, View x1);
86  };
87 
94  template<class View>
95  class AbsDom : public BinaryPropagator<View,PC_INT_DOM> {
96  protected:
99 
101  AbsDom(Space& home, bool share, AbsDom& p);
103  AbsDom(Home home, View x0, View x1);
104  public:
106  virtual Actor* copy(Space& home, bool share);
114  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
116  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
118  static ExecStatus post(Home home, View x0, View x1);
119  };
120 
121 }}}
122 
124 
125 namespace Gecode { namespace Int { namespace Arithmetic {
126 
133  template<class View>
134  class MaxBnd : public TernaryPropagator<View,PC_INT_BND> {
135  protected:
139 
141  MaxBnd(Space& home, bool share, MaxBnd& p);
143  MaxBnd(Home home, View x0, View x1, View x2);
144  public:
146  MaxBnd(Space& home, bool share, Propagator& p, View x0, View x1, View x2);
148  virtual Actor* copy(Space& home, bool share);
150  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
152  static ExecStatus post(Home home, View x0, View x1, View x2);
153  };
154 
161  template<class View>
162  class NaryMaxBnd : public NaryOnePropagator<View,PC_INT_BND> {
163  protected:
166 
168  NaryMaxBnd(Space& home, bool share, NaryMaxBnd& p);
170  NaryMaxBnd(Home home, ViewArray<View>& x, View y);
171  public:
173  virtual Actor* copy(Space& home, bool share);
175  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
177  static ExecStatus post(Home home, ViewArray<View>& x, View y);
178  };
179 
186  template<class View>
187  class MaxDom : public TernaryPropagator<View,PC_INT_DOM> {
188  protected:
192 
194  MaxDom(Space& home, bool share, MaxDom& p);
196  MaxDom(Home home, View x0, View x1, View x2);
197  public:
199  MaxDom(Space& home, bool share, Propagator& p, View x0, View x1, View x2);
201  virtual Actor* copy(Space& home, bool share);
208  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
210  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
212  static ExecStatus post(Home home, View x0, View x1, View x2);
213  };
214 
221  template<class View>
222  class NaryMaxDom : public NaryOnePropagator<View,PC_INT_DOM> {
223  protected:
226 
228  NaryMaxDom(Space& home, bool share, NaryMaxDom& p);
230  NaryMaxDom(Home home, ViewArray<View>& x, View y);
231  public:
233  virtual Actor* copy(Space& home, bool share);
240  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
242  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
244  static ExecStatus post(Home home, ViewArray<View>& x, View y);
245  };
246 
247 }}}
248 
250 
251 namespace Gecode { namespace Int { namespace Arithmetic {
252 
259  class SqrOps {
260  public:
262  bool even(void) const;
264  int exp(void) const;
266  void exp(int m);
268  template<class IntType>
269  IntType pow(IntType x) const;
271  int tpow(int x) const;
273  int fnroot(int x) const;
275  int cnroot(int x) const;
276  };
277 
284  class PowOps {
285  protected:
287  int n;
289  static bool even(int m);
291  bool powgr(long long int r, int x) const;
293  bool powle(long long int r, int x) const;
294  public:
296  PowOps(int n);
298  bool even(void) const;
300  int exp(void) const;
302  void exp(int m);
304  template<class IntType>
305  IntType pow(IntType x) const;
307  int tpow(int x) const;
309  int fnroot(int x) const;
311  int cnroot(int x) const;
312  };
313 
314 }}}
315 
317 
318 namespace Gecode { namespace Int { namespace Arithmetic {
319 
325  template<class VA, class VB, class Ops>
326  class PowPlusBnd : public MixBinaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND> {
327  protected:
331  Ops ops;
333  PowPlusBnd(Home home, VA x0, VB x1, const Ops& ops);
335  PowPlusBnd(Space& home, bool share, PowPlusBnd<VA,VB,Ops>& p);
336  public:
338  virtual Actor* copy(Space& home, bool share);
340  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
342  static ExecStatus post(Home home, VA x0, VB x1, Ops ops);
343  };
344 
351  template<class Ops>
352  class PowBnd : public BinaryPropagator<IntView,PC_INT_BND> {
353  protected:
357  Ops ops;
359  PowBnd(Space& home, bool share, PowBnd& p);
361  PowBnd(Home home, IntView x0, IntView x1, const Ops& ops);
362  public:
364  virtual Actor* copy(Space& home, bool share);
366  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
368  static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
369  };
370 
376  template<class VA, class VB, class Ops>
377  class PowPlusDom : public MixBinaryPropagator<VA,PC_INT_DOM,VB,PC_INT_DOM> {
378  protected:
382  Ops ops;
384  PowPlusDom(Home home, VA x0, VB x1, const Ops& ops);
386  PowPlusDom(Space& home, bool share, PowPlusDom<VA,VB,Ops>& p);
387  public:
389  virtual Actor* copy(Space& home, bool share);
397  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
399  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
401  static ExecStatus post(Home home, VA x0, VB x1, Ops ops);
402  };
403 
410  template<class Ops>
411  class PowDom : public BinaryPropagator<IntView,PC_INT_DOM> {
412  protected:
416  Ops ops;
418  PowDom(Space& home, bool share, PowDom<Ops>& p);
420  PowDom(Home home, IntView x0, IntView x1, const Ops& ops);
421  public:
423  virtual Actor* copy(Space& home, bool share);
425  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
433  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
435  static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
436  };
437 
438 }}}
439 
441 
442 namespace Gecode { namespace Int { namespace Arithmetic {
443 
450  template<class Ops, bool minus>
451  class NrootPlusBnd : public BinaryPropagator<IntView,PC_INT_BND> {
452  protected:
456  Ops ops;
458  NrootPlusBnd(Space& home, bool share, NrootPlusBnd<Ops,minus>& p);
460  NrootPlusBnd(Home home, IntView x0, IntView x1, const Ops& ops);
461  public:
463  virtual Actor* copy(Space& home, bool share);
465  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
467  static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
468  };
469 
476  template<class Ops>
477  class NrootBnd : public BinaryPropagator<IntView,PC_INT_BND> {
478  protected:
482  Ops ops;
484  NrootBnd(Space& home, bool share, NrootBnd<Ops>& p);
486  NrootBnd(Home home, IntView x0, IntView x1, const Ops& ops);
487  public:
489  virtual Actor* copy(Space& home, bool share);
491  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
493  static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
494  };
495 
502  template<class Ops, bool minus>
503  class NrootPlusDom : public BinaryPropagator<IntView,PC_INT_DOM> {
504  protected:
508  Ops ops;
510  NrootPlusDom(Space& home, bool share, NrootPlusDom<Ops,minus>& p);
512  NrootPlusDom(Home home, IntView x0, IntView x1, const Ops& ops);
513  public:
515  virtual Actor* copy(Space& home, bool share);
517  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
525  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
527  static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
528  };
529 
536  template<class Ops>
537  class NrootDom : public BinaryPropagator<IntView,PC_INT_DOM> {
538  protected:
542  Ops ops;
544  NrootDom(Space& home, bool share, NrootDom<Ops>& p);
546  NrootDom(Home home, IntView x0, IntView x1, const Ops& ops);
547  public:
549  virtual Actor* copy(Space& home, bool share);
551  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
559  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
561  static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
562  };
563 
564 }}}
565 
567 
568 namespace Gecode { namespace Int { namespace Arithmetic {
569 
576  template<class View, PropCond pc>
577  class MultZeroOne : public BinaryPropagator<View,pc> {
578  protected:
581 
583  MultZeroOne(Space& home, bool share, MultZeroOne<View,pc>& p);
585  MultZeroOne(Home home, View x0, View x1);
587  static RelTest equal(View x, int n);
588  public:
590  virtual Actor* copy(Space& home, bool share);
592  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
594  static ExecStatus post(Home home, View x0, View x1);
595  };
596 
597 
598 
604  template<class VA, class VB, class VC>
605  class MultPlusBnd :
606  public MixTernaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND,VC,PC_INT_BND> {
607  protected:
611  public:
613  MultPlusBnd(Home home, VA x0, VB x1, VC x2);
615  MultPlusBnd(Space& home, bool share, MultPlusBnd<VA,VB,VC>& p);
617  static ExecStatus post(Home home, VA x0, VB x1, VC x2);
619  virtual Actor* copy(Space& home, bool share);
621  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
622  };
623 
631  class MultBnd : public TernaryPropagator<IntView,PC_INT_BND> {
632  protected:
637  MultBnd(Space& home, bool share, MultBnd& p);
638  public:
643  static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2);
646  virtual Actor* copy(Space& home, bool share);
649  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
650  };
651 
652 
653 
659  template<class VA, class VB, class VC>
660  class MultPlusDom :
661  public MixTernaryPropagator<VA,PC_INT_DOM,VB,PC_INT_DOM,VC,PC_INT_DOM> {
662  protected:
666  public:
668  MultPlusDom(Home home, VA x0, VB x1, VC x2);
670  MultPlusDom(Space& home, bool share, MultPlusDom<VA,VB,VC>& p);
672  static ExecStatus post(Home home, VA x0, VB x1, VC x2);
674  virtual Actor* copy(Space& home, bool share);
681  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
683  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
684  };
685 
693  class MultDom : public TernaryPropagator<IntView,PC_INT_DOM> {
694  protected:
699  MultDom(Space& home, bool share, MultDom& p);
700  public:
705  static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2);
708  virtual Actor* copy(Space& home, bool share);
716  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
719  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
720  };
721 
722 }}}
723 
725 
726 namespace Gecode { namespace Int { namespace Arithmetic {
727 
733  template<class VA, class VB, class VC>
734  class DivPlusBnd :
735  public MixTernaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND,VC,PC_INT_BND> {
736  protected:
740  public:
742  DivPlusBnd(Home home, VA x0, VB x1, VC x2);
744  DivPlusBnd(Space& home, bool share, DivPlusBnd<VA,VB,VC>& p);
746  static ExecStatus post(Home home, VA x0, VB x1, VC x2);
748  virtual Actor* copy(Space& home, bool share);
750  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
751  };
752 
760  template<class View>
761  class DivBnd : public TernaryPropagator<View,PC_INT_BND> {
762  protected:
766 
768  DivBnd(Space& home, bool share, DivBnd<View>& p);
769  public:
771  DivBnd(Home home, View x0, View x1, View x2);
773  static ExecStatus post(Home home, View x0, View x1, View x2);
775  virtual Actor* copy(Space& home, bool share);
777  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
778  };
779 
790  template<class View>
791  class DivMod : public TernaryPropagator<View,PC_INT_BND> {
792  protected:
796 
798  DivMod(Space& home, bool share, DivMod<View>& p);
799  public:
801  DivMod(Home home, View x0, View x1, View x2);
803  static ExecStatus post(Home home, View x0, View x1, View x2);
805  virtual Actor* copy(Space& home, bool share);
807  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
808  };
809 
810 }}}
811 
813 
814 #endif
815 
816 // STATISTICS: int-prop
817 
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: max.hpp:354
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: pow.hpp:337
Bounds consistent positive division propagator.
Definition: arithmetic.hh:734
Integer division/modulo propagator.
Definition: arithmetic.hh:791
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: abs.hpp:185
static ExecStatus post(Home home, View x0, View x1)
Post propagator .
Definition: mult.hpp:113
int tpow(int x) const
Return truncated to integer limits.
Definition: pow-ops.hpp:197
ViewArray< View > x
Array of views.
Definition: propagator.hpp:175
Domain consistent ternary maximum propagator.
Definition: arithmetic.hh:187
Domain consistent n-th root propagator.
Definition: arithmetic.hh:537
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: mult.hpp:146
MultZeroOne(Space &home, bool share, MultZeroOne< View, pc > &p)
Constructor for cloning p.
Definition: mult.hpp:140
DivPlusBnd(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
Definition: divmod.hpp:49
Positive bounds consistent n-th root propagator.
Definition: arithmetic.hh:451
Domain consistent n-ary maximum propagator.
Definition: arithmetic.hh:222
NaryMaxBnd(Space &home, bool share, NaryMaxBnd &p)
Constructor for cloning p.
Definition: max.hpp:165
NrootDom(Space &home, bool share, NrootDom< Ops > &p)
Constructor for cloning p.
Definition: nroot.hpp:422
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator .
Definition: mult.hpp:338
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: max.hpp:364
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: pow.hpp:221
static ExecStatus post(Home home, VA x0, VB x1, Ops ops)
Post propagator.
Definition: pow.hpp:87
int tpow(int x) const
Return where truncated to integer limits.
Definition: pow-ops.hpp:79
Base-class for propagators.
Definition: core.hpp:755
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition: nroot.hpp:375
int cnroot(int x) const
Return where x must be non-negative and .
Definition: pow-ops.hpp:157
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: divmod.hpp:62
Bounds consistent power propagator.
Definition: arithmetic.hh:352
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition: nroot.hpp:176
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: pow.hpp:476
bool powle(long long int r, int x) const
Test whether .
Definition: pow-ops.hpp:136
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition: nroot.hpp:116
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: pow.hpp:107
static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2)
Post propagator .
Definition: mult.cpp:148
int fnroot(int x) const
Return where x must be non-negative and .
Definition: pow-ops.hpp:119
DivBnd(Space &home, bool share, DivBnd< View > &p)
Constructor for cloning p.
Definition: divmod.hpp:112
PowPlusBnd(Home home, VA x0, VB x1, const Ops &ops)
Constructor for posting.
Definition: pow.hpp:81
Computation spaces.
Definition: core.hpp:1325
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: nroot.hpp:428
Base-class for both propagators and branchers.
Definition: core.hpp:666
Bounds consistent absolute value propagator.
Definition: arithmetic.hh:62
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
Definition: max.hpp:138
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: nroot.hpp:229
static ExecStatus post(Home home, View x0, View x1)
Post domain consistent propagator .
Definition: abs.hpp:142
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
NrootBnd(Space &home, bool share, NrootBnd< Ops > &p)
Constructor for cloning p.
Definition: nroot.hpp:223
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
MultDom(Space &home, bool share, MultDom &p)
Constructor for cloning p.
Definition: mult.hpp:357
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: mult.cpp:214
static ExecStatus post(Home home, VA x0, VB x1, Ops ops)
Post propagator.
Definition: pow.hpp:317
Domain consistent n-th root propagator.
Definition: arithmetic.hh:503
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: divmod.hpp:68
Domain consistent absolute value propagator.
Definition: arithmetic.hh:95
Domain consistent positive multiplication propagator.
Definition: arithmetic.hh:660
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: nroot.hpp:143
NNF * r
Right subtree.
Definition: bool-expr.cpp:246
Binary propagator.
Definition: propagator.hpp:87
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: mult.hpp:311
RelTest
Result of testing relation.
Definition: view.hpp:1614
Mixed ternary propagator.
Definition: propagator.hpp:235
PowOps(int n)
Initialize with exponent n.
Definition: pow-ops.hpp:41
ModEventDelta med
A set of modification events (used during propagation)
Definition: core.hpp:764
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: max.hpp:373
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: mult.hpp:244
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: max.hpp:110
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: pow.hpp:465
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition: pow.hpp:154
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: abs.hpp:131
Bounds consistent positive power propagator.
Definition: arithmetic.hh:326
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: nroot.hpp:328
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: pow.hpp:113
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: divmod.hpp:117
IntType pow(IntType x) const
Return where .
Definition: pow-ops.hpp:65
bool even(void) const
Return whether exponent is even.
Definition: pow-ops.hpp:49
Operations for square and square-root propagators.
Definition: arithmetic.hh:259
DivMod(Space &home, bool share, DivMod< View > &p)
Constructor for cloning p.
Definition: divmod.hpp:293
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: pow.hpp:354
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
Definition: max.hpp:246
Ternary propagator.
Definition: propagator.hpp:115
static RelTest equal(View x, int n)
Test whether x is equal to n.
Definition: mult.hpp:103
(n+1)-ary propagator
Definition: propagator.hpp:172
Bounds consistent n-ary maximum propagator.
Definition: arithmetic.hh:162
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: nroot.hpp:322
bool even(void) const
Return whether exponent is even.
Definition: pow-ops.hpp:176
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: max.hpp:278
View arrays.
Definition: array.hpp:234
int n
The exponent and root index.
Definition: arithmetic.hh:287
int cnroot(int x) const
Return where x must be non-negative and .
Definition: pow-ops.hpp:224
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: max.hpp:116
PowDom(Space &home, bool share, PowDom< Ops > &p)
Constructor for cloning p.
Definition: pow.hpp:453
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: nroot.hpp:137
MaxDom(Space &home, bool share, MaxDom &p)
Constructor for cloning p.
Definition: max.hpp:261
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: mult.hpp:327
Bounds consistent division propagator.
Definition: arithmetic.hh:761
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: mult.cpp:201
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: abs.hpp:116
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: nroot.hpp:445
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: nroot.hpp:339
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: divmod.hpp:298
MaxBnd(Space &home, bool share, MaxBnd &p)
Constructor for cloning p.
Definition: max.hpp:99
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: mult.cpp:47
int exp(void) const
Return exponent.
Definition: pow-ops.hpp:181
Domain consistent power propagator.
Definition: arithmetic.hh:411
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
Definition: max.hpp:322
Domain consistent positive power propagator.
Definition: arithmetic.hh:377
Integer view for integer variables.
Definition: view.hpp:129
Bounds consistent multiplication propagator.
Definition: arithmetic.hh:631
Node * x
Pointer to corresponding Boolean expression node.
Definition: bool-expr.cpp:253
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: divmod.hpp:304
Mixed binary propagator.
Definition: propagator.hpp:203
Propagation cost.
Definition: core.hpp:537
IntType pow(IntType x) const
Return .
Definition: pow-ops.hpp:192
PowPlusDom(Home home, VA x0, VB x1, const Ops &ops)
Constructor for posting.
Definition: pow.hpp:311
static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2)
Post propagator .
Definition: mult.cpp:315
Operations for power and nroot propagators.
Definition: arithmetic.hh:284
ExecStatus
Definition: core.hpp:523
Bounds consistent ternary maximum propagator.
Definition: arithmetic.hh:134
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: abs.hpp:122
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: max.hpp:285
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: pow.hpp:227
NrootPlusDom(Space &home, bool share, NrootPlusDom< Ops, minus > &p)
Constructor for cloning p.
Definition: nroot.hpp:315
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
Definition: max.hpp:84
MultPlusBnd(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
Definition: mult.hpp:225
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: mult.cpp:206
bool powgr(long long int r, int x) const
Test whether .
Definition: pow-ops.hpp:98
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator (rounding towards 0)
Definition: divmod.hpp:240
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition: nroot.hpp:300
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition: pow.hpp:392
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: pow.hpp:459
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: nroot.hpp:434
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: divmod.hpp:123
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: max.hpp:170
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: nroot.hpp:235
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: max.hpp:225
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
Definition: divmod.hpp:285
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: max.hpp:272
MultPlusDom(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
Definition: mult.hpp:298
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: pow.hpp:343
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: mult.hpp:317
int fnroot(int x) const
Return where x must be non-negative and .
Definition: pow-ops.hpp:207
NaryMaxDom(Space &home, bool share, NaryMaxDom &p)
Constructor for cloning p.
Definition: max.hpp:349
Bounds or domain consistent propagator for .
Definition: arithmetic.hh:577
Domain consistent multiplication propagator.
Definition: arithmetic.hh:693
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: abs.hpp:175
IntType
Description of integer types.
Definition: int-type.hpp:43
#define GECODE_INT_EXPORT
Definition: int.hh:76
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: mult.hpp:152
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: mult.cpp:52
int ModEventDelta
Modification event deltas.
Definition: core.hpp:173
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator (rounding towards 0)
Definition: divmod.hpp:92
Home class for posting propagators
Definition: core.hpp:717
AbsDom(Space &home, bool share, AbsDom &p)
Constructor for cloning p.
Definition: abs.hpp:164
Bounds consistent n-th root propagator.
Definition: arithmetic.hh:477
PowBnd(Space &home, bool share, PowBnd &p)
Constructor for cloning p.
Definition: pow.hpp:215
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: mult.hpp:238
AbsBnd(Space &home, bool share, AbsBnd &p)
Constructor for cloning p.
Definition: abs.hpp:111
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator .
Definition: mult.hpp:250
Bounds consistent positive multiplication propagator.
Definition: arithmetic.hh:605
static ExecStatus post(Home home, View x0, View x1)
Post bounds consistent propagator .
Definition: abs.hpp:89
int exp(void) const
Return exponent.
Definition: pow-ops.hpp:54
MultBnd(Space &home, bool share, MultBnd &p)
Constructor for cloning p.
Definition: mult.hpp:269
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: abs.hpp:169
NrootPlusBnd(Space &home, bool share, NrootPlusBnd< Ops, minus > &p)
Constructor for cloning p.
Definition: nroot.hpp:130