Generated on Thu Jan 16 2025 00:00:00 for Gecode by doxygen 1.14.0
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 * 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#ifndef __GECODE_INT_ARITHMETIC_HH__
37#define __GECODE_INT_ARITHMETIC_HH__
38
39#include <gecode/int.hh>
40
42#include <gecode/int/rel.hh>
43#include <gecode/int/linear.hh>
44
49
50namespace Gecode { namespace Int { namespace Arithmetic {
51
58 template<class View>
59 class AbsBnd : public BinaryPropagator<View,PC_INT_BND> {
60 protected:
63
65 AbsBnd(Space& home, AbsBnd& p);
67 AbsBnd(Home home, View x0, View x1);
68 public:
69
71 virtual Actor* copy(Space& home);
78 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
80 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
82 static ExecStatus post(Home home, View x0, View x1);
83 };
84
91 template<class View>
92 class AbsDom : public BinaryPropagator<View,PC_INT_DOM> {
93 protected:
96
98 AbsDom(Space& home, AbsDom& p);
100 AbsDom(Home home, View x0, View x1);
101 public:
103 virtual Actor* copy(Space& home);
111 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
113 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
115 static ExecStatus post(Home home, View x0, View x1);
116 };
117
118}}}
119
121
122namespace Gecode { namespace Int { namespace Arithmetic {
123
130 template<class View>
131 class MaxBnd : public TernaryPropagator<View,PC_INT_BND> {
132 protected:
136
138 MaxBnd(Space& home, MaxBnd& p);
140 MaxBnd(Home home, View x0, View x1, View x2);
141 public:
143 MaxBnd(Space& home, Propagator& p, View x0, View x1, View x2);
145 virtual Actor* copy(Space& home);
147 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
149 static ExecStatus post(Home home, View x0, View x1, View x2);
150 };
151
158 template<class View>
159 class NaryMaxBnd : public NaryOnePropagator<View,PC_INT_BND> {
160 protected:
163
168 public:
170 virtual Actor* copy(Space& home);
172 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
174 static ExecStatus post(Home home, ViewArray<View>& x, View y);
175 };
176
183 template<class View>
184 class MaxDom : public TernaryPropagator<View,PC_INT_DOM> {
185 protected:
189
191 MaxDom(Space& home, MaxDom& p);
193 MaxDom(Home home, View x0, View x1, View x2);
194 public:
196 MaxDom(Space& home, Propagator& p, View x0, View x1, View x2);
198 virtual Actor* copy(Space& home);
205 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
207 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
209 static ExecStatus post(Home home, View x0, View x1, View x2);
210 };
211
218 template<class View>
219 class NaryMaxDom : public NaryOnePropagator<View,PC_INT_DOM> {
220 protected:
223
228 public:
230 virtual Actor* copy(Space& home);
237 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
239 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
241 static ExecStatus post(Home home, ViewArray<View>& x, View y);
242 };
243
244}}}
245
247
248namespace Gecode { namespace Int { namespace Arithmetic {
249
259 template<class VA, class VB, bool tiebreak>
260 class ArgMax : public Propagator {
261 protected:
265 VB y;
267 ArgMax(Space& home, ArgMax& p);
269 ArgMax(Home home, IdxViewArray<VA>& x, VB y);
270 public:
272 virtual Actor* copy(Space& home);
273 // Cost function (defined as low linear)
274 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
276 virtual void reschedule(Space& home);
278 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
280 virtual size_t dispose(Space& home);
287 static ExecStatus post(Home home, IdxViewArray<VA>& x, VB y);
288 };
289
290}}}
291
293
294namespace Gecode { namespace Int { namespace Arithmetic {
295
302 class SqrOps {
303 public:
305 bool even(void) const;
307 int exp(void) const;
309 void exp(int m);
311 template<class IntType>
312 IntType pow(IntType x) const;
314 int tpow(int x) const;
316 int fnroot(int x) const;
318 int cnroot(int x) const;
319 };
320
327 class PowOps {
328 protected:
330 int n;
332 static bool even(int m);
334 bool powgr(long long int r, int x) const;
336 bool powle(long long int r, int x) const;
337 public:
339 PowOps(int n);
341 bool even(void) const;
343 int exp(void) const;
345 void exp(int m);
347 template<class IntType>
348 IntType pow(IntType x) const;
350 int tpow(int x) const;
352 int fnroot(int x) const;
354 int cnroot(int x) const;
355 };
356
357}}}
358
360
361namespace Gecode { namespace Int { namespace Arithmetic {
362
368 template<class VA, class VB, class Ops>
369 class PowPlusBnd : public MixBinaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND> {
370 protected:
374 Ops ops;
376 PowPlusBnd(Home home, VA x0, VB x1, const Ops& ops);
379 public:
381 virtual Actor* copy(Space& home);
383 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
385 static ExecStatus post(Home home, VA x0, VB x1, Ops ops);
386 };
387
394 template<class Ops>
395 class PowBnd : public BinaryPropagator<IntView,PC_INT_BND> {
396 protected:
400 Ops ops;
402 PowBnd(Space& home, PowBnd& p);
404 PowBnd(Home home, IntView x0, IntView x1, const Ops& ops);
405 public:
407 virtual Actor* copy(Space& home);
409 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
411 static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
412 };
413
419 template<class VA, class VB, class Ops>
420 class PowPlusDom : public MixBinaryPropagator<VA,PC_INT_DOM,VB,PC_INT_DOM> {
421 protected:
425 Ops ops;
427 PowPlusDom(Home home, VA x0, VB x1, const Ops& ops);
430 public:
432 virtual Actor* copy(Space& home);
440 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
442 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
444 static ExecStatus post(Home home, VA x0, VB x1, Ops ops);
445 };
446
453 template<class Ops>
454 class PowDom : public BinaryPropagator<IntView,PC_INT_DOM> {
455 protected:
459 Ops ops;
461 PowDom(Space& home, PowDom<Ops>& p);
463 PowDom(Home home, IntView x0, IntView x1, const Ops& ops);
464 public:
466 virtual Actor* copy(Space& home);
468 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
476 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
478 static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
479 };
480
481}}}
482
484
485namespace Gecode { namespace Int { namespace Arithmetic {
486
493 template<class Ops, bool minus>
494 class NrootPlusBnd : public BinaryPropagator<IntView,PC_INT_BND> {
495 protected:
499 Ops ops;
503 NrootPlusBnd(Home home, IntView x0, IntView x1, const Ops& ops);
504 public:
506 virtual Actor* copy(Space& home);
508 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
510 static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
511 };
512
519 template<class Ops>
520 class NrootBnd : public BinaryPropagator<IntView,PC_INT_BND> {
521 protected:
525 Ops ops;
527 NrootBnd(Space& home, NrootBnd<Ops>& p);
529 NrootBnd(Home home, IntView x0, IntView x1, const Ops& ops);
530 public:
532 virtual Actor* copy(Space& home);
534 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
536 static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
537 };
538
545 template<class Ops, bool minus>
546 class NrootPlusDom : public BinaryPropagator<IntView,PC_INT_DOM> {
547 protected:
551 Ops ops;
555 NrootPlusDom(Home home, IntView x0, IntView x1, const Ops& ops);
556 public:
558 virtual Actor* copy(Space& home);
560 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
568 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
570 static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
571 };
572
579 template<class Ops>
580 class NrootDom : public BinaryPropagator<IntView,PC_INT_DOM> {
581 protected:
585 Ops ops;
587 NrootDom(Space& home, NrootDom<Ops>& p);
589 NrootDom(Home home, IntView x0, IntView x1, const Ops& ops);
590 public:
592 virtual Actor* copy(Space& home);
594 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
602 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
604 static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops);
605 };
606
607}}}
608
610
611namespace Gecode { namespace Int { namespace Arithmetic {
612
619 template<class View, PropCond pc>
620 class MultZeroOne : public BinaryPropagator<View,pc> {
621 protected:
622 using BinaryPropagator<View,pc>::x0;
623 using BinaryPropagator<View,pc>::x1;
624
628 MultZeroOne(Home home, View x0, View x1);
630 static RelTest equal(View x, int n);
631 public:
633 virtual Actor* copy(Space& home);
635 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
637 static ExecStatus post(Home home, View x0, View x1);
638 };
639
640
641
647 template<class VA, class VB, class VC>
649 public MixTernaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND,VC,PC_INT_BND> {
650 protected:
654 public:
656 MultPlusBnd(Home home, VA x0, VB x1, VC x2);
660 static ExecStatus post(Home home, VA x0, VB x1, VC x2);
662 virtual Actor* copy(Space& home);
664 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
665 };
666
674 class MultBnd : public TernaryPropagator<IntView,PC_INT_BND> {
675 protected:
680 MultBnd(Space& home, MultBnd& p);
681 public:
686 static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2);
689 virtual Actor* copy(Space& home);
692 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
693 };
694
695
696
702 template<class VA, class VB, class VC>
704 public MixTernaryPropagator<VA,PC_INT_DOM,VB,PC_INT_DOM,VC,PC_INT_DOM> {
705 protected:
709 public:
711 MultPlusDom(Home home, VA x0, VB x1, VC x2);
715 static ExecStatus post(Home home, VA x0, VB x1, VC x2);
717 virtual Actor* copy(Space& home);
724 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
726 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
727 };
728
736 class MultDom : public TernaryPropagator<IntView,PC_INT_DOM> {
737 protected:
742 MultDom(Space& home, MultDom& p);
743 public:
748 static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2);
751 virtual Actor* copy(Space& home);
759 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
762 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
763 };
764
765}}}
766
768
769namespace Gecode { namespace Int { namespace Arithmetic {
770
776 template<class VA, class VB, class VC>
778 public MixTernaryPropagator<VA,PC_INT_BND,VB,PC_INT_BND,VC,PC_INT_BND> {
779 protected:
783 public:
785 DivPlusBnd(Home home, VA x0, VB x1, VC x2);
789 static ExecStatus post(Home home, VA x0, VB x1, VC x2);
791 virtual Actor* copy(Space& home);
793 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
794 };
795
803 template<class View>
804 class DivBnd : public TernaryPropagator<View,PC_INT_BND> {
805 protected:
809
811 DivBnd(Space& home, DivBnd<View>& p);
812 public:
814 DivBnd(Home home, View x0, View x1, View x2);
816 static ExecStatus post(Home home, View x0, View x1, View x2);
818 virtual Actor* copy(Space& home);
820 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
821 };
822
833 template<class View>
834 class DivMod : public TernaryPropagator<View,PC_INT_BND> {
835 protected:
839
841 DivMod(Space& home, DivMod<View>& p);
842 public:
844 DivMod(Home home, View x0, View x1, View x2);
846 static ExecStatus post(Home home, View x0, View x1, View x2);
848 virtual Actor* copy(Space& home);
850 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
851 };
852
853}}}
854
856
857#endif
858
859// STATISTICS: int-prop
860
BinaryPropagator(Space &home, BinaryPropagator &p)
Home class for posting propagators
Definition core.hpp:856
AbsBnd(Space &home, AbsBnd &p)
Constructor for cloning p.
static ExecStatus post(Home home, View x0, View x1)
Post bounds consistent propagator .
Definition abs.hpp:93
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition abs.hpp:120
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition abs.hpp:126
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition abs.hpp:135
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition abs.hpp:191
AbsDom(Space &home, AbsDom &p)
Constructor for cloning p.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition abs.hpp:181
static ExecStatus post(Home home, View x0, View x1)
Post domain consistent propagator .
Definition abs.hpp:148
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition abs.hpp:175
IdxViewArray< VA > x
Map of index and views.
VB y
Position of maximum view (maximal argument)
ArgMax(Space &home, ArgMax &p)
Constructor for cloning p.
Definition argmax.hpp:76
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition argmax.hpp:103
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition argmax.hpp:84
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition argmax.hpp:90
static ExecStatus post(Home home, IdxViewArray< VA > &x, VB y)
Post propagator .
Definition argmax.hpp:48
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition argmax.hpp:255
virtual void reschedule(Space &home)
Schedule function.
Definition argmax.hpp:96
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition divmod.hpp:112
DivBnd(Space &home, DivBnd< View > &p)
Constructor for cloning p.
Definition divmod.hpp:107
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator (rounding towards 0)
Definition divmod.hpp:235
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition divmod.hpp:118
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
Definition divmod.hpp:280
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition divmod.hpp:293
DivMod(Space &home, DivMod< View > &p)
Constructor for cloning p.
Definition divmod.hpp:288
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition divmod.hpp:299
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator (rounding towards 0)
Definition divmod.hpp:87
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition divmod.hpp:57
DivPlusBnd(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
Definition divmod.hpp:45
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition divmod.hpp:63
MaxBnd(Space &home, MaxBnd &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition max.hpp:112
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
Definition max.hpp:80
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition max.hpp:106
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
Definition max.hpp:242
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition max.hpp:281
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition max.hpp:268
MaxDom(Space &home, MaxDom &p)
Constructor for cloning p.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition max.hpp:274
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition mult.cpp:48
MultBnd(Space &home, MultBnd &p)
Constructor for cloning p.
Definition mult.hpp:263
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition mult.cpp:43
static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2)
Post propagator .
Definition mult.cpp:144
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition mult.cpp:197
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition mult.cpp:202
static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2)
Post propagator .
Definition mult.cpp:311
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition mult.cpp:210
MultDom(Space &home, MultDom &p)
Constructor for cloning p.
Definition mult.hpp:350
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator .
Definition mult.hpp:244
MultPlusBnd(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
Definition mult.hpp:220
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition mult.hpp:232
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition mult.hpp:238
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition mult.hpp:304
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator .
Definition mult.hpp:331
MultPlusDom(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
Definition mult.hpp:292
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition mult.hpp:310
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition mult.hpp:320
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition mult.hpp:141
MultZeroOne(Space &home, MultZeroOne< View, pc > &p)
Constructor for cloning p.
Definition mult.hpp:136
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition mult.hpp:147
static ExecStatus post(Home home, View x0, View x1)
Post propagator .
Definition mult.hpp:109
static RelTest equal(View x, int n)
Test whether x is equal to n.
Definition mult.hpp:99
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition max.hpp:166
NaryMaxBnd(Space &home, NaryMaxBnd &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition max.hpp:221
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
Definition max.hpp:134
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition max.hpp:350
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition max.hpp:360
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition max.hpp:369
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
Definition max.hpp:318
NaryMaxDom(Space &home, NaryMaxDom &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition nroot.hpp:231
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition nroot.hpp:225
NrootBnd(Space &home, NrootBnd< Ops > &p)
Constructor for cloning p.
Definition nroot.hpp:219
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition nroot.hpp:172
NrootDom(Space &home, NrootDom< Ops > &p)
Constructor for cloning p.
Definition nroot.hpp:418
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition nroot.hpp:430
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition nroot.hpp:441
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition nroot.hpp:371
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition nroot.hpp:424
NrootPlusBnd(Space &home, NrootPlusBnd< Ops, minus > &p)
Constructor for cloning p.
Definition nroot.hpp:126
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition nroot.hpp:112
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition nroot.hpp:133
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition nroot.hpp:139
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition nroot.hpp:318
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition nroot.hpp:335
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition nroot.hpp:296
NrootPlusDom(Space &home, NrootPlusDom< Ops, minus > &p)
Constructor for cloning p.
Definition nroot.hpp:311
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition nroot.hpp:324
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition pow.hpp:216
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition pow.hpp:222
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition pow.hpp:149
PowBnd(Space &home, PowBnd &p)
Constructor for cloning p.
Definition pow.hpp:210
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Definition pow.hpp:386
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition pow.hpp:453
PowDom(Space &home, PowDom< Ops > &p)
Constructor for cloning p.
Definition pow.hpp:447
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition pow.hpp:459
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition pow.hpp:470
int cnroot(int x) const
Return where x must be non-negative and .
Definition pow-ops.hpp:153
int tpow(int x) const
Return where truncated to integer limits.
Definition pow-ops.hpp:75
bool powgr(long long int r, int x) const
Test whether .
Definition pow-ops.hpp:94
IntType pow(IntType x) const
Return where .
Definition pow-ops.hpp:61
int exp(void) const
Return exponent.
Definition pow-ops.hpp:50
bool powle(long long int r, int x) const
Test whether .
Definition pow-ops.hpp:132
int n
The exponent and root index.
PowOps(int n)
Initialize with exponent n.
Definition pow-ops.hpp:37
int fnroot(int x) const
Return where x must be non-negative and .
Definition pow-ops.hpp:115
bool even(void) const
Return whether exponent is even.
Definition pow-ops.hpp:45
static ExecStatus post(Home home, VA x0, VB x1, Ops ops)
Post propagator.
Definition pow.hpp:83
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition pow.hpp:108
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition pow.hpp:102
PowPlusBnd(Home home, VA x0, VB x1, const Ops &ops)
Constructor for posting.
Definition pow.hpp:77
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition pow.hpp:337
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition pow.hpp:348
static ExecStatus post(Home home, VA x0, VB x1, Ops ops)
Post propagator.
Definition pow.hpp:312
PowPlusDom(Home home, VA x0, VB x1, const Ops &ops)
Constructor for posting.
Definition pow.hpp:306
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition pow.hpp:331
Operations for square and square-root propagators.
int tpow(int x) const
Return truncated to integer limits.
Definition pow-ops.hpp:193
int fnroot(int x) const
Return where x must be non-negative and .
Definition pow-ops.hpp:203
bool even(void) const
Return whether exponent is even.
Definition pow-ops.hpp:172
IntType pow(IntType x) const
Return .
Definition pow-ops.hpp:188
int cnroot(int x) const
Return where x must be non-negative and .
Definition pow-ops.hpp:220
int exp(void) const
Return exponent.
Definition pow-ops.hpp:177
An array of IdxView pairs.
Definition idx-view.hh:67
Integer view for integer variables.
Definition view.hpp:129
MixBinaryPropagator(Space &home, MixBinaryPropagator &p)
Definition pattern.hpp:597
NaryOnePropagator(Space &home, NaryOnePropagator &p)
Propagation cost.
Definition core.hpp:486
friend class Space
Definition core.hpp:1068
ModEventDelta med
A set of modification events (used during propagation)
Definition core.hpp:1077
Propagator(Home home)
Constructor for posting.
Definition core.hpp:3505
TernaryPropagator(Space &home, TernaryPropagator &p)
View arrays.
Definition array.hpp:253
#define GECODE_INT_EXPORT
Definition int.hh:81
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
Numerical (arithmetic) propagators.
Finite domain integers.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
Definition var-type.hpp:91
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
Definition var-type.hpp:100
RelTest
Result of testing relation.
Definition view.hpp:1734
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition set.hh:773
ExecStatus
Definition core.hpp:472
Post propagator for SetVar x
Definition set.hh:773