lq-le.hpp
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
* Gabor Szokoli <szokoli@gecode.org>
*
* Copyright:
* Christian Schulte, 2003
* Gabor Szokoli, 2003
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
namespace Gecode { namespace Int { namespace Rel {
/*
* Less or equal propagator
*
*/
template<class V0, class V1>
forceinline
Lq<V0,V1>::Lq(Home home, V0 x0, V1 x1)
: MixBinaryPropagator<V0,PC_INT_BND,V1,PC_INT_BND>(home,x0,x1) {}
template<class V0, class V1>
ExecStatus
Lq<V0,V1>::post(Home home, V0 x0, V1 x1) {
GECODE_ME_CHECK(x0.lq(home,x1.max()));
GECODE_ME_CHECK(x1.gq(home,x0.min()));
if ((x0 != x1) && (x0.max() > x1.min()))
(void) new (home) Lq<V0,V1>(home,x0,x1);
return ES_OK;
}
template<class V0, class V1>
forceinline
Lq<V0,V1>::Lq(Space& home, Lq<V0,V1>& p)
: MixBinaryPropagator<V0,PC_INT_BND,V1,PC_INT_BND>(home,p) {}
template<class V0, class V1>
Actor*
Lq<V0,V1>::copy(Space& home) {
return new (home) Lq<V0,V1>(home,*this);
}
template<class V0, class V1>
ExecStatus
Lq<V0,V1>::propagate(Space& home, const ModEventDelta&) {
GECODE_ME_CHECK(x0.lq(home,x1.max()));
GECODE_ME_CHECK(x1.gq(home,x0.min()));
return (x0.max() <= x1.min()) ? home.ES_SUBSUMED(*this) : ES_FIX;
}
/*
* Less propagator
*
*/
template<class V0, class V1>
forceinline
Le<V0,V1>::Le(Home home, V0 x0, V1 x1)
: MixBinaryPropagator<V0,PC_INT_BND,V1,PC_INT_BND>(home,x0,x1) {}
template<class V0, class V1>
ExecStatus
Le<V0,V1>::post(Home home, V0 x0, V1 x1) {
if (x0 == x1)
return ES_FAILED;
GECODE_ME_CHECK(x0.le(home,x1.max()));
GECODE_ME_CHECK(x1.gr(home,x0.min()));
if (x0.max() >= x1.min())
(void) new (home) Le<V0,V1>(home,x0,x1);
return ES_OK;
}
template<class V0, class V1>
forceinline
Le<V0,V1>::Le(Space& home, Le<V0,V1>& p)
: MixBinaryPropagator<V0,PC_INT_BND,V1,PC_INT_BND>(home,p) {}
template<class V0, class V1>
Actor*
Le<V0,V1>::copy(Space& home) {
return new (home) Le<V0,V1>(home,*this);
}
template<class V0, class V1>
ExecStatus
Le<V0,V1>::propagate(Space& home, const ModEventDelta&) {
GECODE_ME_CHECK(x0.le(home,x1.max()));
GECODE_ME_CHECK(x1.gr(home,x0.min()));
return (x0.max() < x1.min()) ? home.ES_SUBSUMED(*this) : ES_FIX;
}
/*
* Nary less and less or equal propagator
*
*/
template<class View, int o>
forceinline
NaryLqLe<View,o>::Index::Index(Space& home, Propagator& p,
Council<Index>& c, int i0)
: Advisor(home,p,c), i(i0) {}
template<class View, int o>
forceinline
NaryLqLe<View,o>::Index::Index(Space& home, Index& a)
: Advisor(home,a), i(a.i) {}
template<class View, int o>
forceinline
NaryLqLe<View,o>::Pos::Pos(int p0, Pos* n)
: FreeList(n), p(p0) {}
template<class View, int o>
forceinline typename NaryLqLe<View,o>::Pos*
NaryLqLe<View,o>::Pos::next(void) const {
return static_cast<Pos*>(FreeList::next());
}
template<class View, int o>
forceinline void
NaryLqLe<View,o>::Pos::operator delete(void*) {}
template<class View, int o>
forceinline void
NaryLqLe<View,o>::Pos::operator delete(void*, Space&) {
GECODE_NEVER;
}
template<class View, int o>
forceinline void*
NaryLqLe<View,o>::Pos::operator new(size_t, Space& home) {
return home.fl_alloc<sizeof(Pos)>();
}
template<class View, int o>
forceinline void
NaryLqLe<View,o>::Pos::dispose(Space& home) {
home.fl_dispose<sizeof(Pos)>(this,this);
}
template<class View, int o>
forceinline bool
NaryLqLe<View,o>::empty(void) const {
return pos == NULL;
}
template<class View, int o>
forceinline void
NaryLqLe<View,o>::push(Space& home, int p) {
// Try to avoid entering same position twice
if ((pos != NULL) && (pos->p == p))
return;
pos = new (home) Pos(p,pos);
}
template<class View, int o>
forceinline int
NaryLqLe<View,o>::pop(Space& home) {
Pos* t = pos;
int p = t->p;
pos = pos->next();
t->dispose(home);
return p;
}
template<class View, int o>
forceinline
NaryLqLe<View,o>::NaryLqLe(Home home, ViewArray<View>& x)
: NaryPropagator<View,PC_INT_NONE>(home,x),
c(home), pos(NULL), run(false), n_subsumed(0) {
for (int i=0; i<x.size(); i++)
x[i].subscribe(home, *new (home) Index(home,*this,c,i));
}
template<class View, int o>
ExecStatus
NaryLqLe<View,o>::post(Home home, ViewArray<View>& x) {
assert((o == 0) || (o == 1));
// Check for sharing
if (x.same()) {
if (o == 1)
return ES_FAILED;
/*
* Eliminate sharing: if a view occurs twice, all views in between
* must be equal.
*/
int n = x.size();
for (int i=0; i<n; i++)
for (int j=n-1; j>i; j--)
if (x[i] == x[j]) {
if (i+1 != j) {
// Create equality propagator for elements i+1 ... j
ViewArray<View> y(home,j-i);
for (int k=j-i; k--; )
y[k] = x[i+1+k];
GECODE_ES_CHECK(NaryEqBnd<View>::post(home,y));
}
for (int k=0; k<n-1-j-1+1; k++)
x[i+1+k]=x[j+1+k];
n -= j-i;
break;
}
x.size(n);
}
// Propagate one round
for (int i=1; i<x.size(); i++)
GECODE_ME_CHECK(x[i].gq(home,x[i-1].min()+o));
for (int i=x.size()-1; i--;)
GECODE_ME_CHECK(x[i].lq(home,x[i+1].max()-o));
// Eliminate redundant variables
{
// Eliminate at beginning
{
int i=0;
while ((i+1 < x.size()) && (x[i].max()+o <= x[i+1].min()))
i++;
x.drop_fst(i);
}
// Eliminate at end
{
int i=x.size()-1;
while ((i > 0) && (x[i-1].max()+o <= x[i].min()))
i--;
x.drop_lst(i);
}
// Eliminate in the middle
if (x.size() > 1) {
int j=1;
for (int i=1; i+1<x.size(); i++)
if ((x[j-1].max()+o > x[i].min()) ||
(x[i].max()+o > x[i+1].min()))
x[j++]=x[i];
x[j++]=x[x.size()-1];
x.size(j);
}
}
if (x.size() == 2) {
if (o == 0)
return Lq<View,View>::post(home,x[0],x[1]);
else
return Le<View,View>::post(home,x[0],x[1]);
} else if (x.size() >= 2) {
(void) new (home) NaryLqLe<View,o>(home,x);
}
return ES_OK;
}
template<class View, int o>
forceinline
NaryLqLe<View,o>::NaryLqLe(Space& home, NaryLqLe<View,o>& p)
: NaryPropagator<View,PC_INT_NONE>(home,p),
pos(NULL), run(false), n_subsumed(p.n_subsumed) {
assert(p.pos == NULL);
c.update(home, p.c);
}
template<class View, int o>
Actor*
NaryLqLe<View,o>::copy(Space& home) {
if (n_subsumed > n_threshold) {
Region r;
// Record for which views there is an advisor
Support::BitSet<Region> a(r,static_cast<unsigned int>(x.size()));
for (Advisors<Index> as(c); as(); ++as)
a.set(static_cast<unsigned int>(as.advisor().i));
// Compact view array and compute map for advisors
int* m = r.alloc<int>(x.size());
int j=0;
for (int i=0; i<x.size(); i++)
if (a.get(static_cast<unsigned int>(i))) {
m[i] = j; x[j++] = x[i];
}
x.size(j);
// Remap advisors
for (Advisors<Index> as(c); as(); ++as)
as.advisor().i = m[as.advisor().i];
n_subsumed = 0;
}
return new (home) NaryLqLe<View,o>(home,*this);
}
template<class View, int o>
PropCost
NaryLqLe<View,o>::cost(const Space&, const ModEventDelta&) const {
return PropCost::binary(PropCost::HI);
}
template<class View, int o>
forceinline size_t
NaryLqLe<View,o>::dispose(Space& home) {
for (Advisors<Index> as(c); as(); ++as)
x[as.advisor().i].cancel(home,as.advisor());
c.dispose(home);
while (!empty())
(void) pop(home);
(void) NaryPropagator<View,PC_INT_NONE>::dispose(home);
return sizeof(*this);
}
template<class View, int o>
ExecStatus
NaryLqLe<View,o>::advise(Space& home, Advisor& _a, const Delta& d) {
Index& a = static_cast<Index&>(_a);
const int i = a.i;
switch (View::modevent(d)) {
case ME_INT_VAL:
a.dispose(home,c);
n_subsumed++;
break;
case ME_INT_BND:
if (((i == 0) || (x[i-1].max()+o <= x[i].min())) &&
((i == x.size()-1) || (x[i].max()+o <= x[i+1].min()))) {
x[i].cancel(home,a);
a.dispose(home,c);
n_subsumed++;
return (run || (n_subsumed + 1 < x.size())) ? ES_FIX : ES_NOFIX;
}
break;
default:
return ES_FIX;
}
if (run)
return ES_FIX;
if (((i < x.size()-1) && (x[i+1].min() < x[i].min()+o)) ||
((i > 0) && (x[i-1].max() > x[i].max()-o))) {
push(home,i);
return ES_NOFIX;
}
return (n_subsumed+1 >= x.size()) ? ES_NOFIX : ES_FIX;
}
template<class View, int o>
void
NaryLqLe<View,o>::reschedule(Space& home) {
View::schedule(home, *this, ME_INT_BND);
}
template<class View, int o>
ExecStatus
NaryLqLe<View,o>::propagate(Space& home, const ModEventDelta&) {
run = true;
int n = x.size();
while (!empty()) {
int p = pop(home);
for (int i=p; i<n-1; i++) {
ModEvent me = x[i+1].gq(home,x[i].min()+o);
if (me_failed(me))
return ES_FAILED;
if (!me_modified(me))
break;
}
for (int i=p; i>0; i--) {
ModEvent me = x[i-1].lq(home,x[i].max()-o);
if (me_failed(me))
return ES_FAILED;
if (!me_modified(me))
break;
}
}
#ifdef GECODE_AUDIT
for (int i=0; i<n-1; i++)
assert(!me_modified(x[i+1].gq(home,x[i].min()+o)));
for (int i=n-1; i>0; i--)
assert(!me_modified(x[i-1].lq(home,x[i].max()-o)));
#endif
if (n_subsumed+1 >= n)
return home.ES_SUBSUMED(*this);
run = false;
return ES_FIX;
}
/*
* Reified less or equal propagator
*
*/
template<class View, class CtrlView, ReifyMode rm>
forceinline
ReLq<View,CtrlView,rm>::ReLq(Home home, View x0, View x1, CtrlView b)
: ReBinaryPropagator<View,PC_INT_BND,CtrlView>(home,x0,x1,b) {}
template<class View, class CtrlView, ReifyMode rm>
ExecStatus
ReLq<View,CtrlView,rm>::post(Home home, View x0, View x1, CtrlView b) {
if (b.one()) {
if (rm == RM_PMI)
return ES_OK;
return Lq<View,View>::post(home,x0,x1);
}
if (b.zero()) {
if (rm == RM_IMP)
return ES_OK;
return Le<View,View>::post(home,x1,x0);
}
if (x0 != x1) {
switch (rtest_lq(x0,x1)) {
case RT_TRUE:
if (rm != RM_IMP)
GECODE_ME_CHECK(b.one_none(home));
break;
case RT_FALSE:
if (rm != RM_PMI)
GECODE_ME_CHECK(b.zero_none(home));
break;
case RT_MAYBE:
(void) new (home) ReLq<View,CtrlView,rm>(home,x0,x1,b);
break;
default: GECODE_NEVER;
}
} else if (rm != RM_IMP) {
GECODE_ME_CHECK(b.one_none(home));
}
return ES_OK;
}
template<class View, class CtrlView, ReifyMode rm>
forceinline
ReLq<View,CtrlView,rm>::ReLq(Space& home, ReLq& p)
: ReBinaryPropagator<View,PC_INT_BND,CtrlView>(home,p) {}
template<class View, class CtrlView, ReifyMode rm>
Actor*
ReLq<View,CtrlView,rm>::copy(Space& home) {
return new (home) ReLq<View,CtrlView,rm>(home,*this);
}
template<class View, class CtrlView, ReifyMode rm>
ExecStatus
ReLq<View,CtrlView,rm>::propagate(Space& home, const ModEventDelta&) {
if (b.one()) {
if (rm != RM_PMI)
GECODE_REWRITE(*this,(Lq<View,View>::post(home(*this),x0,x1)));
} else if (b.zero()) {
if (rm != RM_IMP)
GECODE_REWRITE(*this,(Le<View,View>::post(home(*this),x1,x0)));
} else {
switch (rtest_lq(x0,x1)) {
case RT_TRUE:
if (rm != RM_IMP)
GECODE_ME_CHECK(b.one_none(home));
break;
case RT_FALSE:
if (rm != RM_PMI)
GECODE_ME_CHECK(b.zero_none(home));
break;
case RT_MAYBE:
return ES_FIX;
default: GECODE_NEVER;
}
}
return home.ES_SUBSUMED(*this);
}
/*
* Reified less or equal propagator involving one variable
*
*/
template<class View, class CtrlView, ReifyMode rm>
forceinline
ReLqInt<View,CtrlView,rm>::ReLqInt(Home home, View x, int c0, CtrlView b)
: ReUnaryPropagator<View,PC_INT_BND,CtrlView>(home,x,b), c(c0) {}
template<class View, class CtrlView, ReifyMode rm>
ExecStatus
ReLqInt<View,CtrlView,rm>::post(Home home, View x, int c, CtrlView b) {
if (b.one()) {
if (rm != RM_PMI)
GECODE_ME_CHECK(x.lq(home,c));
} else if (b.zero()) {
if (rm != RM_IMP)
GECODE_ME_CHECK(x.gr(home,c));
} else {
switch (rtest_lq(x,c)) {
case RT_TRUE:
if (rm != RM_IMP)
GECODE_ME_CHECK(b.one_none(home));
break;
case RT_FALSE:
if (rm != RM_PMI)
GECODE_ME_CHECK(b.zero_none(home));
break;
case RT_MAYBE:
(void) new (home) ReLqInt<View,CtrlView,rm>(home,x,c,b);
break;
default: GECODE_NEVER;
}
}
return ES_OK;
}
template<class View, class CtrlView, ReifyMode rm>
forceinline
ReLqInt<View,CtrlView,rm>::ReLqInt(Space& home, ReLqInt& p)
: ReUnaryPropagator<View,PC_INT_BND,CtrlView>(home,p), c(p.c) {}
template<class View, class CtrlView, ReifyMode rm>
Actor*
ReLqInt<View,CtrlView,rm>::copy(Space& home) {
return new (home) ReLqInt<View,CtrlView,rm>(home,*this);
}
template<class View, class CtrlView, ReifyMode rm>
ExecStatus
ReLqInt<View,CtrlView,rm>::propagate(Space& home, const ModEventDelta&) {
if (b.one()) {
if (rm != RM_PMI)
GECODE_ME_CHECK(x0.lq(home,c));
} else if (b.zero()) {
if (rm != RM_IMP)
GECODE_ME_CHECK(x0.gr(home,c));
} else {
switch (rtest_lq(x0,c)) {
case RT_TRUE:
if (rm != RM_IMP)
GECODE_ME_CHECK(b.one_none(home));
break;
case RT_FALSE:
if (rm != RM_PMI)
GECODE_ME_CHECK(b.zero_none(home));
break;
case RT_MAYBE:
return ES_FIX;
default: GECODE_NEVER;
}
}
return home.ES_SUBSUMED(*this);
}
}}}
// STATISTICS: int-prop
Gecode::ActorLink::Space
friend class Space
Definition core.hpp:595
Gecode::ActorLink::Propagator
friend class Propagator
Definition core.hpp:591
Gecode::Actor
Base-class for both propagators and branchers.
Definition core.hpp:628
Gecode::Advisor::Advisor
Advisor(Space &home, Propagator &p, Council< A > &c)
Constructor for creation.
Definition core.hpp:3831
Gecode::Advisor::Council
friend class Council
Definition core.hpp:1294
Gecode::Advisors
Class to iterate over advisors of a council.
Definition core.hpp:1266
Gecode::Delta
Generic domain change information to be supplied to advisors.
Definition core.hpp:204
Gecode::FreeList::FreeList
FreeList(void)
Use uninitialized.
Definition manager.hpp:241
Gecode::FreeList::next
FreeList * next(void) const
Return next freelist object.
Definition manager.hpp:248
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::Int::ReBinaryPropagator< View, PC_INT_BND, CtrlView >::ReBinaryPropagator
ReBinaryPropagator(Space &home, ReBinaryPropagator &p)
Gecode::Int::ReBinaryPropagator< View, PC_INT_BND, CtrlView >::x0
View x0
Definition propagator.hpp:90
Gecode::Int::ReBinaryPropagator< View, PC_INT_BND, CtrlView >::b
CtrlView b
Definition propagator.hpp:92
Gecode::Int::ReBinaryPropagator< View, PC_INT_BND, CtrlView >::x1
View x1
Definition propagator.hpp:90
Gecode::Int::ReUnaryPropagator< View, PC_INT_BND, CtrlView >::b
CtrlView b
Definition propagator.hpp:59
Gecode::Int::ReUnaryPropagator< View, PC_INT_BND, CtrlView >::ReUnaryPropagator
ReUnaryPropagator(Space &home, ReUnaryPropagator &p)
Gecode::Int::ReUnaryPropagator< View, PC_INT_BND, CtrlView >::x0
View x0
Definition propagator.hpp:57
Gecode::Int::Rel::Le::Le
Le(Space &home, Le &p)
Constructor for cloning p.
Definition lq-le.hpp:103
Gecode::Int::Rel::Le::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition lq-le.hpp:108
Gecode::Int::Rel::Le::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition lq-le.hpp:114
Gecode::Int::Rel::Le::post
static ExecStatus post(Home home, V0 x0, V1 x1)
Post propagator .
Definition lq-le.hpp:91
Gecode::Int::Rel::Lq::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition lq-le.hpp:71
Gecode::Int::Rel::Lq::post
static ExecStatus post(Home home, V0 x0, V1 x1)
Post propagator .
Definition lq-le.hpp:50
Gecode::Int::Rel::Lq::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition lq-le.hpp:65
Gecode::Int::Rel::Lq::Lq
Lq(Space &home, Lq &p)
Constructor for cloning p.
Definition lq-le.hpp:60
Gecode::Int::Rel::NaryEqBnd::post
static ExecStatus post(Home home, ViewArray< View > &x)
Post bounds consistent propagator .
Definition eq.hpp:402
Gecode::Int::Rel::NaryLqLe::Index
Advisors for views (by position in array)
Definition rel.hh:234
Gecode::Int::Rel::NaryLqLe::Index::Index
Index(Space &home, Propagator &p, Council< Index > &c, int i)
Create index advisor.
Definition lq-le.hpp:129
Gecode::Int::Rel::NaryLqLe::Index::i
int i
The position of the view in the view array.
Definition rel.hh:237
Gecode::Int::Rel::NaryLqLe::Pos
Positions in view array that have to be propagated.
Definition rel.hh:246
Gecode::Int::Rel::NaryLqLe::Pos::p
int p
Position of view in view array.
Definition rel.hh:249
Gecode::Int::Rel::NaryLqLe::Pos::Pos
Pos(int p, Pos *n)
Initialize with position p and next position n.
Definition lq-le.hpp:142
Gecode::Int::Rel::NaryLqLe::Pos::dispose
void dispose(Space &home)
Free memory for this position.
Definition lq-le.hpp:169
Gecode::Int::Rel::NaryLqLe::Pos::next
Pos * next(void) const
Return next position.
Definition lq-le.hpp:147
Gecode::Int::Rel::NaryLqLe::empty
bool empty(void) const
Whether no more positions must be propagated.
Definition lq-le.hpp:176
Gecode::Int::Rel::NaryLqLe::push
void push(Space &home, int p)
Push a new position p to be propagated.
Definition lq-le.hpp:181
Gecode::Int::Rel::NaryLqLe::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition lq-le.hpp:291
Gecode::Int::Rel::NaryLqLe::c
Council< Index > c
The advisor council.
Definition rel.hh:244
Gecode::Int::Rel::NaryLqLe::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition lq-le.hpp:323
Gecode::Int::Rel::NaryLqLe::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition lq-le.hpp:317
Gecode::Int::Rel::NaryLqLe::n_threshold
static const int n_threshold
Compact during cloning when more advisors than that are subsumed.
Definition rel.hh:289
Gecode::Int::Rel::NaryLqLe::run
bool run
Whether the propagator is currently running.
Definition rel.hh:285
Gecode::Int::Rel::NaryLqLe::n_subsumed
int n_subsumed
Number of already subsumed advisors (or views).
Definition rel.hh:287
Gecode::Int::Rel::NaryLqLe::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition lq-le.hpp:368
Gecode::Int::Rel::NaryLqLe::post
static ExecStatus post(Home home, ViewArray< View > &x)
Post propagator for .
Definition lq-le.hpp:208
Gecode::Int::Rel::NaryLqLe::advise
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition lq-le.hpp:336
Gecode::Int::Rel::NaryLqLe::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition lq-le.hpp:374
Gecode::Int::Rel::NaryLqLe::NaryLqLe
NaryLqLe(Space &home, NaryLqLe< View, o > &p)
Constructor for cloning p.
Definition lq-le.hpp:282
Gecode::Int::Rel::NaryLqLe::pos
Pos * pos
Stack of positions.
Definition rel.hh:277
Gecode::Int::Rel::NaryLqLe::pop
int pop(Space &home)
Pop a position to be propagated and return it.
Definition lq-le.hpp:189
Gecode::Int::Rel::ReLqInt::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition lq-le.hpp:542
Gecode::Int::Rel::ReLqInt::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition lq-le.hpp:536
Gecode::Int::Rel::ReLqInt::ReLqInt
ReLqInt(Space &home, ReLqInt &p)
Constructor for cloning p.
Definition lq-le.hpp:531
Gecode::Int::Rel::ReLqInt::c
int c
Integer constant to check.
Definition rel.hh:581
Gecode::Int::Rel::ReLqInt::post
static ExecStatus post(Home home, View x, int c, CtrlView b)
Post propagator for .
Definition lq-le.hpp:502
Gecode::Int::Rel::ReLq::ReLq
ReLq(Space &home, ReLq &p)
Constructor for cloning p.
Definition lq-le.hpp:454
Gecode::Int::Rel::ReLq::post
static ExecStatus post(Home home, View x0, View x1, CtrlView b)
Post propagator for .
Definition lq-le.hpp:420
Gecode::Int::Rel::ReLq::copy
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition lq-le.hpp:459
Gecode::Int::Rel::ReLq::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition lq-le.hpp:465
Gecode::MixBinaryPropagator< V0, PC_INT_BND, V1, PC_INT_BND >::x1
V1 x1
Definition pattern.hpp:209
Gecode::MixBinaryPropagator< V0, PC_INT_BND, V1, PC_INT_BND >::MixBinaryPropagator
MixBinaryPropagator(Space &home, MixBinaryPropagator &p)
Definition pattern.hpp:597
Gecode::MixBinaryPropagator< V0, PC_INT_BND, V1, PC_INT_BND >::x0
V0 x0
Definition pattern.hpp:207
Gecode::NaryPropagator::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition pattern.hpp:513
Gecode::NaryPropagator< View, PC_INT_NONE >::x
ViewArray< View > x
Definition pattern.hpp:145
Gecode::NaryPropagator< View, PC_INT_NONE >::NaryPropagator
NaryPropagator(Space &home, NaryPropagator &p)
Gecode::PropCost
Propagation cost.
Definition core.hpp:486
Gecode::PropCost::binary
static PropCost binary(PropCost::Mod m)
Two variables for modifier pcm.
Definition core.hpp:4809
Gecode::PropCost::HI
@ HI
Expensive.
Definition core.hpp:514
Gecode::Propagator::Space
friend class Space
Definition core.hpp:1066
Gecode::Propagator::Advisor
friend class Advisor
Definition core.hpp:1068
Gecode::Region
Handle to region.
Definition region.hpp:55
Gecode::Space::fl_dispose
void fl_dispose(FreeList *f, FreeList *l)
Return freelist-managed memory to freelist.
Definition core.hpp:2827
Gecode::Support::BitSet
Simple bitsets.
Definition bitset.hpp:45
Gecode::View
Gecode::ViewArray
View arrays.
Definition array.hpp:253
Gecode::Space::ES_SUBSUMED
ExecStatus ES_SUBSUMED(Propagator &p)
Definition core.hpp:3563
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
GECODE_ME_CHECK
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
Definition macros.hpp:52
GECODE_REWRITE
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
Definition macros.hpp:116
Gecode::me_failed
bool me_failed(ModEvent me)
Check whether modification event me is failed.
Definition modevent.hpp:54
GECODE_ES_CHECK
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Definition macros.hpp:91
Gecode::me_modified
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
Definition modevent.hpp:59
Gecode::RM_IMP
@ RM_IMP
Implication for reification.
Definition int.hh:862
Gecode::RM_PMI
@ RM_PMI
Inverse implication for reification.
Definition int.hh:869
Gecode::Int::Rel
Simple relation propagators.
Gecode::Int
Finite domain integers.
Gecode::Int::ME_INT_BND
const Gecode::ModEvent ME_INT_BND
Domain operation has changed the minimum or maximum of the domain.
Definition var-type.hpp:65
Gecode::Int::PC_INT_BND
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
Definition var-type.hpp:91
Gecode::Int::rtest_lq
RelTest rtest_lq(VX x, VY y)
Test whether view x is less or equal than view y.
Definition rel-test.hpp:164
Gecode::Int::PC_INT_NONE
const Gecode::PropCond PC_INT_NONE
Propagation condition to be ignored (convenience).
Definition var-type.hpp:74
Gecode::Int::ME_INT_VAL
const Gecode::ModEvent ME_INT_VAL
Domain operation has resulted in a value (assigned variable).
Definition var-type.hpp:56
Gecode::Int::RT_TRUE
@ RT_TRUE
Relation does hold.
Definition view.hpp:1737
Gecode::Int::RT_MAYBE
@ RT_MAYBE
Relation may hold or not.
Definition view.hpp:1736
Gecode::Int::RT_FALSE
@ RT_FALSE
Relation does not hold.
Definition view.hpp:1735
Gecode
Gecode toplevel namespace
Gecode::min
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition arithmetic.cpp:67
Gecode::ExecStatus
ExecStatus
Definition core.hpp:472
Gecode::ES_OK
@ ES_OK
Execution is okay.
Definition core.hpp:476
Gecode::ES_FIX
@ ES_FIX
Propagation has computed fixpoint.
Definition core.hpp:477
Gecode::ES_FAILED
@ ES_FAILED
Execution has resulted in failure.
Definition core.hpp:474
Gecode::ES_NOFIX
@ ES_NOFIX
Propagation has not computed fixpoint.
Definition core.hpp:475
Gecode::max
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition arithmetic.cpp:49
Gecode::ModEvent
int ModEvent
Type for modification events.
Definition core.hpp:62
forceinline
#define forceinline
Definition config.hpp:187
GECODE_NEVER
#define GECODE_NEVER
Assert that this command is never executed.
Definition macros.hpp:56