42 namespace Gecode {
namespace Int {
namespace Precede {
48 return x.assigned() && (x.val() ==
v);
59 Single<View>::Index::Index(
Space& home,
bool share, Index&
a)
67 while ((alpha < n) && !
x[alpha].in(s))
80 }
while ((beta < n) && !
x[beta].in(s));
89 int s0,
int t0,
int b,
int g)
91 c(home), s(s0),
t(t0), alpha(0), beta(b), gamma(g) {
92 for (
int i=
x.size();
i--; )
103 while ((alpha < x.
size()) && !x[alpha].in(s))
110 int beta = 0, gamma = 0;
117 }
while ((beta < x.
size()) && !x[beta].in(s));
122 if (gamma < x.
size())
135 alpha(p.alpha), beta(p.beta), gamma(p.gamma) {
136 c.update(home, share, p.
c);
149 alpha -=
i; beta -=
i; gamma -=
i;
152 if (gamma <
x.size()) {
167 x[as.advisor().i].cancel(home,as.advisor());
170 return sizeof(*this);
182 Index&
a(static_cast<Index&>(a0));
185 if ((beta <= gamma) && (i < gamma) &&
assigned(
x[i],
t))
191 }
else if ((i < alpha) || (i > gamma)) {
198 if ((alpha == i) || (beta ==
i)) {
199 if (
x[i].
any(d) && !
x[
i].in(s))
201 if ((
x[i].
min(d) <= s) && (s <=
x[
i].max(d)))
215 if ((alpha < n) && !
x[alpha].in(s)) {
223 }
else if ((beta < n) && !
x[beta].in(s)) {
virtual size_t dispose(Space &home)
Delete propagator and return its size.
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
Single(Home home, ViewArray< View > &x, int s, int t, int beta, int gamma)
Constructor for posting.
Council< Index > c
The advisor council.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ExecStatus ES_SUBSUMED(Propagator &p)
Advisors for views (by position in array)
bool any(const View &x)
Test whether x is neither positive nor negative.
int i
The position of the view in the view array.
ViewArray< View > x
Array of views.
Base-class for propagators.
Class to iterate over advisors of a council.
Propagation has computed fixpoint.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
void drop_lst(int i)
Drop views from positions i+1 to size()-1 from array.
int n
Number of negative literals for node type.
const Gecode::PropCond PC_INT_NONE
Propagation condition to be ignored (convenience)
void subscribe(Space &home, Propagator &p, IntSet &y)
const Gecode::ModEvent ME_INT_BND
Domain operation has changed the minimum or maximum of the domain.
struct Gecode::@519::NNF::@60::@62 a
For atomic nodes.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
void drop_fst(int i)
Drop views from positions 0 to i-1 from array.
static ExecStatus post(Home home, ViewArray< View > &x, int s, int t)
Post propagator that s precedes t in x.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
Index(Space &home, Propagator &p, Council< Index > &c, int i)
Create index advisor.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
struct Gecode::@519::NNF::@60::@61 b
For binary nodes (and, or, eqv)
Node * x
Pointer to corresponding Boolean expression node.
Generic domain change information to be supplied to advisors.
void dispose(Space &home, Council< A > &c)
Dispose the advisor.
bool assigned(View x, int v)
Whether x is assigned to value v.
Propagation has not computed fixpoint.
Single value precedence propagator.
int size(void) const
Return size of array (number of elements)
int ModEventDelta
Modification event deltas.
Home class for posting propagators
virtual Propagator * copy(Space &home, bool share)
Copy propagator during cloning.
virtual PropCost cost(const Space &, const ModEventDelta &) const
Cost function.