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.
ArgMax(Space &home, bool share, ArgMax &p)
Constructor for cloning p.
Bounds consistent positive division propagator.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Integer division/modulo propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, View x0, View x1)
Post propagator .
static ExecStatus post(Home home, IdxViewArray< VA > &x, VB y)
Post propagator .
ViewArray< View > x
Array of views.
Domain consistent ternary maximum propagator.
Domain consistent n-th root propagator.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
MultZeroOne(Space &home, bool share, MultZeroOne< View, pc > &p)
Constructor for cloning p.
DivPlusBnd(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
Positive bounds consistent n-th root propagator.
Domain consistent n-ary maximum propagator.
NaryMaxBnd(Space &home, bool share, NaryMaxBnd &p)
Constructor for cloning p.
int fnroot(int x) const
Return where x must be non-negative and .
NrootDom(Space &home, bool share, NrootDom< Ops > &p)
Constructor for cloning p.
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator .
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
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.
Base-class for propagators.
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Bounds consistent power propagator.
VB y
Position of maximum view (maximal argument)
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2)
Post propagator .
bool powgr(long long int r, int x) const
Test whether .
DivBnd(Space &home, bool share, DivBnd< View > &p)
Constructor for cloning p.
PowPlusBnd(Home home, VA x0, VB x1, const Ops &ops)
Constructor for posting.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Base-class for both propagators and branchers.
Bounds consistent absolute value propagator.
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
bool even(void) const
Return whether exponent is even.
int cnroot(int x) const
Return where x must be non-negative and .
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
static ExecStatus post(Home home, View x0, View x1)
Post domain consistent propagator .
int p
Number of positive literals for node type.
NrootBnd(Space &home, bool share, NrootBnd< Ops > &p)
Constructor for cloning p.
int n
Number of negative literals for node type.
MultDom(Space &home, bool share, MultDom &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, VA x0, VB x1, Ops ops)
Post propagator.
Domain consistent n-th root propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Domain consistent absolute value propagator.
Domain consistent positive multiplication propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
RelTest
Result of testing relation.
Mixed ternary propagator.
PowOps(int n)
Initialize with exponent n.
ModEventDelta med
A set of modification events (used during propagation)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
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, IntView x0, IntView x1, Ops ops)
Post propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Bounds consistent positive power propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Operations for square and square-root propagators.
DivMod(Space &home, bool share, DivMod< View > &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
virtual void reschedule(Space &home)
Schedule function.
static RelTest equal(View x, int n)
Test whether x is equal to n.
bool powle(long long int r, int x) const
Test whether .
Bounds consistent n-ary maximum propagator.
int tpow(int x) const
Return truncated to integer limits.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
int n
The exponent and root index.
Argument maximum propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
PowDom(Space &home, bool share, PowDom< Ops > &p)
Constructor for cloning p.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
MaxDom(Space &home, bool share, MaxDom &p)
Constructor for cloning p.
IntType pow(IntType x) const
Return where .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Bounds consistent division 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.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
MaxBnd(Space &home, bool share, MaxBnd &p)
Constructor for cloning p.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Domain consistent power propagator.
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
Post propagator for SetVar SetOpType SetVar SetRelType r
Domain consistent positive power propagator.
Integer view for integer variables.
Bounds consistent multiplication propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int fnroot(int x) const
Return where x must be non-negative and .
PowPlusDom(Home home, VA x0, VB x1, const Ops &ops)
Constructor for posting.
static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2)
Post propagator .
Operations for power and nroot propagators.
Bounds consistent ternary maximum propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
NrootPlusDom(Space &home, bool share, NrootPlusDom< Ops, minus > &p)
Constructor for cloning p.
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
MultPlusBnd(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
IdxViewArray< VA > x
Map of index and views.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator (rounding towards 0)
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.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Post propagator for SetVar x
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int cnroot(int x) const
Return where x must be non-negative and .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
int tpow(int x) const
Return where truncated to integer limits.
MultPlusDom(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Gecode toplevel namespace
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
NaryMaxDom(Space &home, bool share, NaryMaxDom &p)
Constructor for cloning p.
Bounds or domain consistent propagator for .
Domain consistent multiplication propagator.
bool even(void) const
Return whether exponent is even.
IntType pow(IntType x) const
Return .
IntType
Description of integer types.
#define GECODE_INT_EXPORT
int exp(void) const
Return exponent.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int ModEventDelta
Modification event deltas.
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator (rounding towards 0)
Home class for posting propagators
AbsDom(Space &home, bool share, AbsDom &p)
Constructor for cloning p.
Bounds consistent n-th root propagator.
PowBnd(Space &home, bool share, PowBnd &p)
Constructor for cloning p.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
AbsBnd(Space &home, bool share, AbsBnd &p)
Constructor for cloning p.
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator .
Bounds consistent positive multiplication propagator.
static ExecStatus post(Home home, View x0, View x1)
Post bounds consistent propagator .
MultBnd(Space &home, bool share, MultBnd &p)
Constructor for cloning p.
int exp(void) const
Return exponent.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
NrootPlusBnd(Space &home, bool share, NrootPlusBnd< Ops, minus > &p)
Constructor for cloning p.