Go to the documentation of this file.
40 #ifndef __GECODE_INT_ARITHMETIC_HH__
41 #define __GECODE_INT_ARITHMETIC_HH__
54 namespace Gecode {
namespace Int {
namespace Arithmetic {
126 namespace Gecode {
namespace Int {
namespace Arithmetic {
252 namespace Gecode {
namespace Int {
namespace Arithmetic {
263 template<
class VA,
class VB,
bool tiebreak>
298 namespace Gecode {
namespace Int {
namespace Arithmetic {
309 bool even(
void)
const;
315 template<
class IntType>
318 int tpow(
int x)
const;
336 static bool even(
int m);
338 bool powgr(
long long int r,
int x)
const;
340 bool powle(
long long int r,
int x)
const;
345 bool even(
void)
const;
351 template<
class IntType>
354 int tpow(
int x)
const;
365 namespace Gecode {
namespace Int {
namespace Arithmetic {
372 template<
class VA,
class VB,
class Ops>
423 template<
class VA,
class VB,
class Ops>
489 namespace Gecode {
namespace Int {
namespace Arithmetic {
497 template<
class Ops,
bool minus>
549 template<
class Ops,
bool minus>
615 namespace Gecode {
namespace Int {
namespace Arithmetic {
623 template<
class View, PropCond pc>
651 template<
class VA,
class VB,
class VC>
706 template<
class VA,
class VB,
class VC>
773 namespace Gecode {
namespace Int {
namespace Arithmetic {
780 template<
class VA,
class VB,
class VC>
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator .
Post propagator for SetVar x
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Bounds consistent positive multiplication propagator.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
DivBnd(Space &home, bool share, DivBnd< View > &p)
Constructor for cloning p.
DivPlusBnd(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
DivMod(Space &home, bool share, DivMod< View > &p)
Constructor for cloning p.
int exp(void) const
Return exponent.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
int fnroot(int x) const
Return where x must be non-negative and .
MultZeroOne(Space &home, bool share, MultZeroOne< View, pc > &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int exp(void) const
Return exponent.
Domain consistent positive power propagator.
Bounds consistent multiplication propagator.
PowBnd(Space &home, bool share, PowBnd &p)
Constructor for cloning p.
Positive bounds consistent n-th root propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Operations for square and square-root propagators.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Domain consistent multiplication propagator.
NaryMaxBnd(Space &home, bool share, NaryMaxBnd &p)
Constructor for cloning p.
Bounds consistent absolute value propagator.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2)
Post propagator .
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator .
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Base-class for both propagators and branchers.
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
static ExecStatus post(Home home, VA x0, VB x1, Ops ops)
Post propagator.
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
AbsBnd(Space &home, bool share, AbsBnd &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
static ExecStatus post(Home home, View x0, View x1)
Post bounds consistent propagator .
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
MultDom(Space &home, bool share, MultDom &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ViewArray< View > x
Array of views.
NrootBnd(Space &home, bool share, NrootBnd< Ops > &p)
Constructor for cloning p.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
bool powle(long long int r, int x) const
Test whether .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Mixed ternary propagator.
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
Bounds consistent division propagator.
static ExecStatus post(Home home, View x0, View x1)
Post domain consistent propagator .
MultPlusDom(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
PowPlusBnd(Home home, VA x0, VB x1, const Ops &ops)
Constructor for posting.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
static ExecStatus post(Home home, VA x0, VB x1, Ops ops)
Post propagator.
Bounds consistent positive division propagator.
int fnroot(int x) const
Return where x must be non-negative and .
IntType pow(IntType x) const
Return where .
Gecode toplevel namespace
Domain consistent positive multiplication propagator.
Base-class for propagators.
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
virtual void reschedule(Space &home)
Schedule function.
static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2)
Post propagator .
Operations for power and nroot propagators.
NrootPlusDom(Space &home, bool share, NrootPlusDom< Ops, minus > &p)
Constructor for cloning p.
MaxBnd(Space &home, bool share, MaxBnd &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
#define GECODE_INT_EXPORT
Argument maximum propagator.
Home class for posting propagators
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Domain consistent n-ary maximum propagator.
Bounds consistent ternary maximum propagator.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
IntType pow(IntType x) const
Return .
MultBnd(Space &home, bool share, MultBnd &p)
Constructor for cloning p.
int tpow(int x) const
Return truncated to integer limits.
Domain consistent power propagator.
Post propagator for SetVar SetOpType SetVar SetRelType r
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
ModEventDelta med
A set of modification events (used during propagation)
bool even(void) const
Return whether exponent is even.
static ExecStatus post(Home home, View x0, View x1)
Post propagator .
Domain consistent ternary maximum propagator.
ArgMax(Space &home, bool share, ArgMax &p)
Constructor for cloning p.
Bounds consistent power propagator.
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator (rounding towards 0)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Bounds or domain consistent propagator for .
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
PowPlusDom(Home home, VA x0, VB x1, const Ops &ops)
Constructor for posting.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
PowDom(Space &home, bool share, PowDom< Ops > &p)
Constructor for cloning p.
AbsDom(Space &home, bool share, AbsDom &p)
Constructor for cloning p.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
MaxDom(Space &home, bool share, MaxDom &p)
Constructor for cloning p.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Domain consistent absolute value propagator.
int cnroot(int x) const
Return where x must be non-negative and .
IntType
Description of integer types.
int tpow(int x) const
Return where truncated to integer limits.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Domain consistent n-th root propagator.
static RelTest equal(View x, int n)
Test whether x is equal to n.
static ExecStatus post(Home home, IdxViewArray< VA > &x, VB y)
Post propagator .
Integer view for integer variables.
int cnroot(int x) const
Return where x must be non-negative and .
PowOps(int n)
Initialize with exponent n.
NaryMaxDom(Space &home, bool share, NaryMaxDom &p)
Constructor for cloning p.
NrootDom(Space &home, bool share, NrootDom< Ops > &p)
Constructor for cloning p.
Integer division/modulo propagator.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
RelTest
Result of testing relation.
Bounds consistent n-ary maximum propagator.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
MultPlusBnd(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
bool even(void) const
Return whether exponent is even.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator (rounding towards 0)
Domain consistent n-th root propagator.
IdxViewArray< VA > x
Map of index and views.
Bounds consistent n-th root propagator.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
int n
Number of negative literals for node type.
int n
The exponent and root index.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
int ModEventDelta
Modification event deltas.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
int p
Number of positive literals for node type.
NrootPlusBnd(Space &home, bool share, NrootPlusBnd< Ops, minus > &p)
Constructor for cloning p.
VB y
Position of maximum view (maximal argument)
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
bool powgr(long long int r, int x) const
Test whether .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Bounds consistent positive power propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.