40 namespace Gecode {
namespace Int {
namespace Arithmetic {
105 View x0, View x1, View x2)
118 if ((x0.max() <= x1.min()) || (x0.max() < x2.min()))
120 if ((x1.max() <= x0.min()) || (x1.max() < x2.min()))
122 return x0.assigned() && x1.assigned() && x2.assigned() ?
139 assert(x.
size() > 0);
147 for (
int i=x.
size();
i--; ) {
153 if (x.
same(home,y)) {
155 for (
int i=x.
size();
i--; )
174 return new (home)
MaxBnd<View>(home,share,*
this,x[0],x[1],y);
190 assert(x.
size() > 0);
191 int maxmax = x[x.
size()-1].max();
192 int maxmin = x[x.
size()-1].min();
193 for (
int i = x.
size()-1;
i--; ) {
202 for (
int i = x.
size();
i--; ) {
208 if (x[
i].
max() < maxmin) {
267 View x0, View x1, View x2)
288 if ((x0.max() <= x1.min()) || (x0.max() < x2.min()))
290 if ((x1.max() <= x0.min()) || (x1.max() < x2.min()))
292 return x0.assigned() && x1.assigned() && x2.assigned() ?
323 assert(x.
size() > 0);
331 for (
int i=x.
size();
i--; ) {
337 if (x.
same(home,y)) {
339 for (
int i=x.
size();
i--; )
358 return new (home)
MaxDom<View>(home,share,*
this,x[0],x[1],y);
383 for (
int i =
x.size();
i--; ) {
388 for (
int i =
x.size();
i--; )
393 assert(
x.size() > 0);
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntConLevel icl)
Post propagator for .
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
Binary domain consistent equality propagator.
ExecStatus ES_SUBSUMED(Propagator &p)
Domain consistent ternary maximum propagator.
const FloatNum max
Largest allowed float value.
MaxPropStatus
Status of propagation for nary max.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
ExecStatus ES_NOFIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has not computed partial fixpoint
Domain consistent n-ary maximum propagator.
NaryMaxBnd(Space &home, bool share, NaryMaxBnd &p)
Constructor for cloning p.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
int ModEvent
Type for modification events.
Base-class for propagators.
Propagation has computed fixpoint.
void unique(const Space &home)
Remove all duplicate views from array (changes element order)
const int min
Smallest allowed integer value.
Base-class for both propagators and branchers.
Range iterator for integer views.
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
const Gecode::ModEvent ME_INT_FAILED
Domain operation has resulted in failure.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
bool same(const CachedView< View > &x, const CachedView< View > &y)
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Execution has resulted in failure.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
int PropCond
Type for propagation conditions.
Range iterator for union of iterators.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Binary bounds consistent equality propagator.
Less or equal propagator.
RelTest rtest_nq_dom(View x, View y)
Test whether views x and y are different (use full domain information)
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
size_t size
The size of the propagator (used during subsumption)
Bounds consistent n-ary maximum propagator.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
ExecStatus prop_max_bnd(Space &home, View x0, View x1, View x2)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ExecStatus prop_nary_max_bnd(Space &home, Propagator &p, ViewArray< View > &x, View y, PropCond pc)
MaxDom(Space &home, bool share, MaxDom &p)
Constructor for cloning p.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
ExecStatus ES_FIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has computed partial fixpoint
void move_lst(int i)
Move view from position size()-1 to position i (truncate array by one)
Range iterator for computing union (binary)
MaxBnd(Space &home, bool share, MaxBnd &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< View > &x, View y)
Post propagator .
union Gecode::@518::NNF::@57 u
Union depending on nodetype t.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Node * x
Pointer to corresponding Boolean expression node.
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
Bounds consistent ternary maximum propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
bool assigned(View x, int v)
Whether x is assigned to value v.
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
bool same(const Space &home) const
Test whether array has multiple occurence of the same view.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Propagation has not computed fixpoint.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
int size(void) const
Return size of array (number of elements)
static PropCost ternary(PropCost::Mod m)
Three variables for modifier pcm.
Gecode toplevel namespace
NaryMaxDom(Space &home, bool share, NaryMaxDom &p)
Constructor for cloning p.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
Telling has found a new upper bound.
bool me_failed(ModEvent me)
Check whether modification event me is failed.