40 #ifndef __GECODE_INT_ARITHMETIC_HH__
41 #define __GECODE_INT_ARITHMETIC_HH__
53 namespace Gecode {
namespace Int {
namespace Arithmetic {
125 namespace Gecode {
namespace Int {
namespace Arithmetic {
251 namespace Gecode {
namespace Int {
namespace Arithmetic {
262 bool even(
void)
const;
268 template<
class IntType>
271 int tpow(
int x)
const;
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;
298 bool even(
void)
const;
304 template<
class IntType>
307 int tpow(
int x)
const;
318 namespace Gecode {
namespace Int {
namespace Arithmetic {
325 template<
class VA,
class VB,
class Ops>
376 template<
class VA,
class VB,
class Ops>
442 namespace Gecode {
namespace Int {
namespace Arithmetic {
450 template<
class Ops,
bool minus>
502 template<
class Ops,
bool minus>
568 namespace Gecode {
namespace Int {
namespace Arithmetic {
576 template<
class View, PropCond pc>
604 template<
class VA,
class VB,
class VC>
659 template<
class VA,
class VB,
class VC>
726 namespace Gecode {
namespace Int {
namespace Arithmetic {
733 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.
Bounds consistent positive division propagator.
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 .
int tpow(int x) const
Return truncated to integer limits.
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.
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 PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
static ExecStatus post(Home home, VA x0, VB x1, Ops ops)
Post propagator.
int tpow(int x) const
Return where truncated to integer limits.
Base-class for propagators.
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
int cnroot(int x) const
Return where x must be non-negative and .
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Bounds consistent power propagator.
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
bool powle(long long int r, int x) const
Test whether .
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 .
int fnroot(int x) const
Return where x must be non-negative and .
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 .
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
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 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.
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 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.
IntType pow(IntType x) const
Return where .
bool even(void) const
Return whether exponent is even.
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 .
static RelTest equal(View x, int n)
Test whether x is equal to n.
Bounds consistent n-ary maximum propagator.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
bool even(void) const
Return whether exponent is even.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
int n
The exponent and root index.
int cnroot(int x) const
Return where x must be non-negative and .
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.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
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.
MaxBnd(Space &home, bool share, MaxBnd &p)
Constructor for cloning p.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
int exp(void) const
Return exponent.
Domain consistent power propagator.
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
Domain consistent positive power propagator.
Integer view for integer variables.
Bounds consistent multiplication propagator.
Node * x
Pointer to corresponding Boolean expression node.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
IntType pow(IntType x) const
Return .
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 PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
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.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
bool powgr(long long int r, int x) const
Test whether .
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 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.
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, View x0, View x1, View x2)
Post propagator .
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
MultPlusDom(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
int fnroot(int x) const
Return where x must be non-negative and .
NaryMaxDom(Space &home, bool share, NaryMaxDom &p)
Constructor for cloning p.
Bounds or domain consistent propagator for .
Domain consistent multiplication propagator.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
IntType
Description of integer types.
#define GECODE_INT_EXPORT
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 .
int exp(void) const
Return exponent.
MultBnd(Space &home, bool share, MultBnd &p)
Constructor for cloning p.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
NrootPlusBnd(Space &home, bool share, NrootPlusBnd< Ops, minus > &p)
Constructor for cloning p.