Generated on Sat Feb 7 2015 02:01:14 for Gecode by doxygen 1.8.9.1
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: 2015-01-16 14:10:48 +0100 (Fri, 16 Jan 2015) $ by $Author: schulte $
13  * $Revision: 14362 $
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/idx-view.hh>
46 #include <gecode/int/rel.hh>
47 #include <gecode/int/linear.hh>
48 
54 namespace Gecode { namespace Int { namespace Arithmetic {
55 
62  template<class View>
63  class AbsBnd : public BinaryPropagator<View,PC_INT_BND> {
64  protected:
67 
69  AbsBnd(Space& home, bool share, AbsBnd& p);
71  AbsBnd(Home home, View x0, View x1);
72  public:
73 
75  virtual Actor* copy(Space& home, bool share);
82  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
84  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
86  static ExecStatus post(Home home, View x0, View x1);
87  };
88 
95  template<class View>
96  class AbsDom : public BinaryPropagator<View,PC_INT_DOM> {
97  protected:
100 
102  AbsDom(Space& home, bool share, AbsDom& p);
104  AbsDom(Home home, View x0, View x1);
105  public:
107  virtual Actor* copy(Space& home, bool share);
115  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
117  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
119  static ExecStatus post(Home home, View x0, View x1);
120  };
121 
122 }}}
123 
125 
126 namespace Gecode { namespace Int { namespace Arithmetic {
127 
134  template<class View>
135  class MaxBnd : public TernaryPropagator<View,PC_INT_BND> {
136  protected:
140 
142  MaxBnd(Space& home, bool share, MaxBnd& p);
144  MaxBnd(Home home, View x0, View x1, View x2);
145  public:
147  MaxBnd(Space& home, bool share, Propagator& p, View x0, View x1, View x2);
149  virtual Actor* copy(Space& home, bool share);
151  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
153  static ExecStatus post(Home home, View x0, View x1, View x2);
154  };
155 
162  template<class View>
163  class NaryMaxBnd : public NaryOnePropagator<View,PC_INT_BND> {
164  protected:
167 
169  NaryMaxBnd(Space& home, bool share, NaryMaxBnd& p);
171  NaryMaxBnd(Home home, ViewArray<View>& x, View y);
172  public:
174  virtual Actor* copy(Space& home, bool share);
176  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
178  static ExecStatus post(Home home, ViewArray<View>& x, View y);
179  };
180 
187  template<class View>
188  class MaxDom : public TernaryPropagator<View,PC_INT_DOM> {
189  protected:
193 
195  MaxDom(Space& home, bool share, MaxDom& p);
197  MaxDom(Home home, View x0, View x1, View x2);
198  public:
200  MaxDom(Space& home, bool share, Propagator& p, View x0, View x1, View x2);
202  virtual Actor* copy(Space& home, bool share);
209  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
211  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
213  static ExecStatus post(Home home, View x0, View x1, View x2);
214  };
215 
222  template<class View>
223  class NaryMaxDom : public NaryOnePropagator<View,PC_INT_DOM> {
224  protected:
227 
229  NaryMaxDom(Space& home, bool share, NaryMaxDom& p);
231  NaryMaxDom(Home home, ViewArray<View>& x, View y);
232  public:
234  virtual Actor* copy(Space& home, bool share);
241  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
243  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
245  static ExecStatus post(Home home, ViewArray<View>& x, View y);
246  };
247 
248 }}}
249 
251 
252 namespace Gecode { namespace Int { namespace Arithmetic {
253 
263  template<class VA, class VB, bool tiebreak>
264  class ArgMax : public Propagator {
265  protected:
269  VB y;
271  ArgMax(Space& home, bool share, ArgMax& p);
273  ArgMax(Home home, IdxViewArray<VA>& x, VB y);
274  public:
276  virtual Actor* copy(Space& home, bool share);
277  // Cost function (defined as low linear)
278  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
280  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
282  virtual size_t dispose(Space& home);
289  static ExecStatus post(Home home, IdxViewArray<VA>& x, VB y);
290  };
291 
292 }}}
293 
295 
296 namespace Gecode { namespace Int { namespace Arithmetic {
297 
304  class SqrOps {
305  public:
307  bool even(void) const;
309  int exp(void) const;
311  void exp(int m);
313  template<class IntType>
314  IntType pow(IntType x) const;
316  int tpow(int x) const;
318  int fnroot(int x) const;
320  int cnroot(int x) const;
321  };
322 
329  class PowOps {
330  protected:
332  int n;
334  static bool even(int m);
336  bool powgr(long long int r, int x) const;
338  bool powle(long long int r, int x) const;
339  public:
341  PowOps(int n);
343  bool even(void) const;
345  int exp(void) const;
347  void exp(int m);
349  template<class IntType>
350  IntType pow(IntType x) const;
352  int tpow(int x) const;
354  int fnroot(int x) const;
356  int cnroot(int x) const;
357  };
358 
359 }}}
360 
362 
363 namespace Gecode { namespace Int { namespace Arithmetic {
364 
370  template<class VA, class VB, class Ops>
371  class PowPlusBnd : public MixBinaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND> {
372  protected:
376  Ops ops;
378  PowPlusBnd(Home home, VA x0, VB x1, const Ops& ops);
380  PowPlusBnd(Space& home, bool share, PowPlusBnd<VA,VB,Ops>& p);
381  public:
383  virtual Actor* copy(Space& home, bool share);
385  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
387  static ExecStatus post(Home home, VA x0, VB x1, Ops ops);
388  };
389 
396  template<class Ops>
397  class PowBnd : public BinaryPropagator<IntView,PC_INT_BND> {
398  protected:
402  Ops ops;
404  PowBnd(Space& home, bool share, PowBnd& p);
406  PowBnd(Home home, IntView x0, IntView x1, const Ops& ops);
407  public:
409  virtual Actor* copy(Space& home, bool share);
411  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
413  static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
414  };
415 
421  template<class VA, class VB, class Ops>
422  class PowPlusDom : public MixBinaryPropagator<VA,PC_INT_DOM,VB,PC_INT_DOM> {
423  protected:
427  Ops ops;
429  PowPlusDom(Home home, VA x0, VB x1, const Ops& ops);
431  PowPlusDom(Space& home, bool share, PowPlusDom<VA,VB,Ops>& p);
432  public:
434  virtual Actor* copy(Space& home, bool share);
442  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
444  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
446  static ExecStatus post(Home home, VA x0, VB x1, Ops ops);
447  };
448 
455  template<class Ops>
456  class PowDom : public BinaryPropagator<IntView,PC_INT_DOM> {
457  protected:
461  Ops ops;
463  PowDom(Space& home, bool share, PowDom<Ops>& p);
465  PowDom(Home home, IntView x0, IntView x1, const Ops& ops);
466  public:
468  virtual Actor* copy(Space& home, bool share);
470  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
478  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
480  static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
481  };
482 
483 }}}
484 
486 
487 namespace Gecode { namespace Int { namespace Arithmetic {
488 
495  template<class Ops, bool minus>
496  class NrootPlusBnd : public BinaryPropagator<IntView,PC_INT_BND> {
497  protected:
501  Ops ops;
503  NrootPlusBnd(Space& home, bool share, NrootPlusBnd<Ops,minus>& p);
505  NrootPlusBnd(Home home, IntView x0, IntView x1, const Ops& ops);
506  public:
508  virtual Actor* copy(Space& home, bool share);
510  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
512  static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
513  };
514 
521  template<class Ops>
522  class NrootBnd : public BinaryPropagator<IntView,PC_INT_BND> {
523  protected:
527  Ops ops;
529  NrootBnd(Space& home, bool share, NrootBnd<Ops>& p);
531  NrootBnd(Home home, IntView x0, IntView x1, const Ops& ops);
532  public:
534  virtual Actor* copy(Space& home, bool share);
536  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
538  static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
539  };
540 
547  template<class Ops, bool minus>
548  class NrootPlusDom : public BinaryPropagator<IntView,PC_INT_DOM> {
549  protected:
553  Ops ops;
555  NrootPlusDom(Space& home, bool share, NrootPlusDom<Ops,minus>& p);
557  NrootPlusDom(Home home, IntView x0, IntView x1, const Ops& ops);
558  public:
560  virtual Actor* copy(Space& home, bool share);
562  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
570  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
572  static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
573  };
574 
581  template<class Ops>
582  class NrootDom : public BinaryPropagator<IntView,PC_INT_DOM> {
583  protected:
587  Ops ops;
589  NrootDom(Space& home, bool share, NrootDom<Ops>& p);
591  NrootDom(Home home, IntView x0, IntView x1, const Ops& ops);
592  public:
594  virtual Actor* copy(Space& home, bool share);
596  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
604  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
606  static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
607  };
608 
609 }}}
610 
612 
613 namespace Gecode { namespace Int { namespace Arithmetic {
614 
621  template<class View, PropCond pc>
622  class MultZeroOne : public BinaryPropagator<View,pc> {
623  protected:
626 
628  MultZeroOne(Space& home, bool share, MultZeroOne<View,pc>& p);
630  MultZeroOne(Home home, View x0, View x1);
632  static RelTest equal(View x, int n);
633  public:
635  virtual Actor* copy(Space& home, bool share);
637  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
639  static ExecStatus post(Home home, View x0, View x1);
640  };
641 
642 
643 
649  template<class VA, class VB, class VC>
650  class MultPlusBnd :
651  public MixTernaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND,VC,PC_INT_BND> {
652  protected:
656  public:
658  MultPlusBnd(Home home, VA x0, VB x1, VC x2);
660  MultPlusBnd(Space& home, bool share, MultPlusBnd<VA,VB,VC>& p);
662  static ExecStatus post(Home home, VA x0, VB x1, VC x2);
664  virtual Actor* copy(Space& home, bool share);
666  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
667  };
668 
676  class MultBnd : public TernaryPropagator<IntView,PC_INT_BND> {
677  protected:
682  MultBnd(Space& home, bool share, MultBnd& p);
683  public:
688  static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2);
691  virtual Actor* copy(Space& home, bool share);
694  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
695  };
696 
697 
698 
704  template<class VA, class VB, class VC>
705  class MultPlusDom :
706  public MixTernaryPropagator<VA,PC_INT_DOM,VB,PC_INT_DOM,VC,PC_INT_DOM> {
707  protected:
711  public:
713  MultPlusDom(Home home, VA x0, VB x1, VC x2);
715  MultPlusDom(Space& home, bool share, MultPlusDom<VA,VB,VC>& p);
717  static ExecStatus post(Home home, VA x0, VB x1, VC x2);
719  virtual Actor* copy(Space& home, bool share);
726  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
728  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
729  };
730 
738  class MultDom : public TernaryPropagator<IntView,PC_INT_DOM> {
739  protected:
744  MultDom(Space& home, bool share, MultDom& p);
745  public:
750  static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2);
753  virtual Actor* copy(Space& home, bool share);
761  virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
764  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
765  };
766 
767 }}}
768 
770 
771 namespace Gecode { namespace Int { namespace Arithmetic {
772 
778  template<class VA, class VB, class VC>
779  class DivPlusBnd :
780  public MixTernaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND,VC,PC_INT_BND> {
781  protected:
785  public:
787  DivPlusBnd(Home home, VA x0, VB x1, VC x2);
789  DivPlusBnd(Space& home, bool share, DivPlusBnd<VA,VB,VC>& p);
791  static ExecStatus post(Home home, VA x0, VB x1, VC x2);
793  virtual Actor* copy(Space& home, bool share);
795  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
796  };
797 
805  template<class View>
806  class DivBnd : public TernaryPropagator<View,PC_INT_BND> {
807  protected:
811 
813  DivBnd(Space& home, bool share, DivBnd<View>& p);
814  public:
816  DivBnd(Home home, View x0, View x1, View x2);
818  static ExecStatus post(Home home, View x0, View x1, View x2);
820  virtual Actor* copy(Space& home, bool share);
822  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
823  };
824 
835  template<class View>
836  class DivMod : public TernaryPropagator<View,PC_INT_BND> {
837  protected:
841 
843  DivMod(Space& home, bool share, DivMod<View>& p);
844  public:
846  DivMod(Home home, View x0, View x1, View x2);
848  static ExecStatus post(Home home, View x0, View x1, View x2);
850  virtual Actor* copy(Space& home, bool share);
852  virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
853  };
854 
855 }}}
856 
858 
859 #endif
860 
861 // STATISTICS: int-prop
862 
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
ArgMax(Space &home, bool share, ArgMax &p)
Constructor for cloning p.
Definition: argmax.hpp:80
Bounds consistent positive division propagator.
Definition: arithmetic.hh:779
Integer division/modulo propagator.
Definition: arithmetic.hh:836
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
static ExecStatus post(Home home, IdxViewArray< VA > &x, VB y)
Post propagator .
Definition: argmax.hpp:52
ViewArray< View > x
Array of views.
Definition: propagator.hpp:175
Domain consistent ternary maximum propagator.
Definition: arithmetic.hh:188
Domain consistent n-th root propagator.
Definition: arithmetic.hh:582
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:496
Domain consistent n-ary maximum propagator.
Definition: arithmetic.hh:223
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:397
VB y
Position of maximum view (maximal argument)
Definition: arithmetic.hh:269
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:1362
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:63
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
Definition: max.hpp:138
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: argmax.hpp:95
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:548
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: divmod.hpp:68
Domain consistent absolute value propagator.
Definition: arithmetic.hh:96
Domain consistent positive multiplication propagator.
Definition: arithmetic.hh:705
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:371
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:304
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:163
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 size_t dispose(Space &home)
Delete propagator and return its size.
Definition: argmax.hpp:254
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:332
int cnroot(int x) const
Return where x must be non-negative and .
Definition: pow-ops.hpp:224
Argument maximum propagator.
Definition: arithmetic.hh:264
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:806
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:456
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
Definition: max.hpp:322
Domain consistent positive power propagator.
Definition: arithmetic.hh:422
Integer view for integer variables.
Definition: view.hpp:129
Bounds consistent multiplication propagator.
Definition: arithmetic.hh:676
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:329
ExecStatus
Definition: core.hpp:523
Bounds consistent ternary maximum propagator.
Definition: arithmetic.hh:135
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
IdxViewArray< VA > x
Map of index and views.
Definition: arithmetic.hh:267
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 ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: argmax.hpp:102
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
Gecode toplevel namespace
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: argmax.hpp:89
NaryMaxDom(Space &home, bool share, NaryMaxDom &p)
Constructor for cloning p.
Definition: max.hpp:349
Bounds or domain consistent propagator for .
Definition: arithmetic.hh:622
Domain consistent multiplication propagator.
Definition: arithmetic.hh:738
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:78
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:522
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:650
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