36#ifndef __GECODE_INT_ARITHMETIC_HH__
37#define __GECODE_INT_ARITHMETIC_HH__
50namespace Gecode {
namespace Int {
namespace Arithmetic {
122namespace Gecode {
namespace Int {
namespace Arithmetic {
248namespace Gecode {
namespace Int {
namespace Arithmetic {
259 template<
class VA,
class VB,
bool tiebreak>
294namespace Gecode {
namespace Int {
namespace Arithmetic {
305 bool even(
void)
const;
311 template<
class IntType>
312 IntType
pow(IntType
x)
const;
314 int tpow(
int x)
const;
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;
341 bool even(
void)
const;
347 template<
class IntType>
348 IntType
pow(IntType
x)
const;
350 int tpow(
int x)
const;
361namespace Gecode {
namespace Int {
namespace Arithmetic {
368 template<
class VA,
class VB,
class Ops>
419 template<
class VA,
class VB,
class Ops>
485namespace Gecode {
namespace Int {
namespace Arithmetic {
493 template<
class Ops,
bool minus>
545 template<
class Ops,
bool minus>
611namespace Gecode {
namespace Int {
namespace Arithmetic {
619 template<
class View, PropCond pc>
647 template<
class VA,
class VB,
class VC>
702 template<
class VA,
class VB,
class VC>
769namespace Gecode {
namespace Int {
namespace Arithmetic {
776 template<
class VA,
class VB,
class VC>
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
Base-class for both propagators and branchers.
Home class for posting propagators
Bounds consistent absolute value propagator.
static ExecStatus post(Home home, View x0, View x1)
Post bounds consistent propagator .
virtual Actor * copy(Space &home)
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.
Domain consistent absolute value propagator.
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)
Post domain consistent propagator .
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Argument maximum propagator.
IdxViewArray< VA > x
Map of index and views.
VB y
Position of maximum view (maximal argument)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
static ExecStatus post(Home home, IdxViewArray< VA > &x, VB y)
Post propagator .
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual void reschedule(Space &home)
Schedule function.
Bounds consistent division propagator.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
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.
Integer division/modulo propagator.
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Bounds consistent positive division propagator.
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator (rounding towards 0)
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Bounds consistent ternary maximum propagator.
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)
Copy propagator during cloning.
Domain consistent ternary maximum propagator.
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Bounds consistent multiplication propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
static ExecStatus post(Home home, IntView x0, IntView x1, IntView x2)
Post propagator .
Domain consistent multiplication propagator.
virtual Actor * copy(Space &home)
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, IntView x2)
Post propagator .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Bounds consistent positive multiplication propagator.
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator .
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Domain consistent positive multiplication propagator.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
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 ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Bounds or domain consistent propagator for .
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, View x0, View x1)
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)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
Domain consistent n-ary maximum propagator.
virtual Actor * copy(Space &home)
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.
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
Bounds consistent n-th root propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Domain consistent n-th root propagator.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
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)
Copy propagator during cloning.
Positive bounds consistent n-th root propagator.
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Domain consistent n-th root propagator.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
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.
Bounds consistent power propagator.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
Domain consistent power propagator.
static ExecStatus post(Home home, IntView x0, IntView x1, Ops ops)
Post propagator.
virtual Actor * copy(Space &home)
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.
Operations for power and nroot propagators.
int cnroot(int x) const
Return where x must be non-negative and .
int tpow(int x) const
Return where truncated to integer limits.
bool powgr(long long int r, int x) const
Test whether .
IntType pow(IntType x) const
Return where .
int exp(void) const
Return exponent.
bool powle(long long int r, int x) const
Test whether .
int n
The exponent and root index.
int fnroot(int x) const
Return where x must be non-negative and .
bool even(void) const
Return whether exponent is even.
Bounds consistent positive power propagator.
static ExecStatus post(Home home, VA x0, VB x1, Ops ops)
Post propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Domain 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.
static ExecStatus post(Home home, VA x0, VB x1, Ops ops)
Post propagator.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Operations for square and square-root propagators.
int tpow(int x) const
Return truncated to integer limits.
int fnroot(int x) const
Return where x must be non-negative and .
bool even(void) const
Return whether exponent is even.
IntType pow(IntType x) const
Return .
int cnroot(int x) const
Return where x must be non-negative and .
int exp(void) const
Return exponent.
An array of IdxView pairs.
Integer view for integer variables.
Mixed ternary propagator.
ViewArray< View > x
Array of views.
Base-class for propagators.
ModEventDelta med
A set of modification events (used during propagation)
#define GECODE_INT_EXPORT
int ModEventDelta
Modification event deltas.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
RelTest
Result of testing relation.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
Post propagator for SetVar x