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>
296 namespace Gecode {
namespace Int {
namespace Arithmetic {
307 bool even(
void)
const;
313 template<
class IntType>
316 int tpow(
int x)
const;
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;
343 bool even(
void)
const;
349 template<
class IntType>
352 int tpow(
int x)
const;
363 namespace Gecode {
namespace Int {
namespace Arithmetic {
370 template<
class VA,
class VB,
class Ops>
421 template<
class VA,
class VB,
class Ops>
487 namespace Gecode {
namespace Int {
namespace Arithmetic {
495 template<
class Ops,
bool minus>
547 template<
class Ops,
bool minus>
613 namespace Gecode {
namespace Int {
namespace Arithmetic {
621 template<
class View, PropCond pc>
649 template<
class VA,
class VB,
class VC>
704 template<
class VA,
class VB,
class VC>
771 namespace Gecode {
namespace Int {
namespace Arithmetic {
778 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.
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.
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.
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.
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.
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 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, 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 size_t dispose(Space &home)
Delete propagator and return its size.
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 .
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.
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.
IdxViewArray< VA > x
Map of index and views.
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 ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
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 .
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.
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.