Go to the documentation of this file.
44 namespace Gecode {
namespace Set {
namespace Precede {
65 }
else if (
x[
alpha].contains(
t)) {
81 }
while ((
beta <
n) &&
93 int s0,
int t0,
int b,
int g)
96 for (
int i=
x.size();
i--; )
98 x[
i].subscribe(home,*
new (home)
Index(home,*
this,
c,
i));
107 while (alpha <
x.size()) {
108 if (
x[alpha].notContains(s)) {
110 }
else if (
x[alpha].contains(
t)) {
122 int beta = 0, gamma = 0;
125 }
while ((gamma <
x.size()) &&
129 }
while ((beta <
x.size()) &&
136 if (gamma <
x.size())
149 alpha(
p.alpha), beta(
p.beta), gamma(
p.gamma) {
150 c.update(home, share,
p.c);
163 alpha -=
i; beta -=
i; gamma -=
i;
166 if (gamma <
x.size()) {
181 x[as.advisor().i].cancel(home,as.advisor());
184 return sizeof(*this);
205 if ((beta <= gamma) && (
i < gamma) &&
206 x[
i].notContains(s) &&
x[
i].contains(
t))
212 }
else if ((
i < alpha) || (
i > gamma)) {
219 if ((alpha ==
i) || (beta ==
i))
233 if (alpha <
n && (
x[alpha].notContains(s) ||
x[alpha].contains(
t))) {
234 if (
x[alpha].notContains(s)) {
240 while (alpha < beta) {
241 if (
x[alpha].notContains(s)) {
252 }
else if ((beta <
n) && (
x[beta].notContains(s) ||
x[beta].contains(
t))) {
Post propagator for SetVar x
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
virtual void reschedule(Space &home)
Schedule function.
ModEvent exclude(Space &home, View &x, int s)
Prune view x to exclude all values from s.
const Gecode::PropCond PC_SET_NONE
Propagation condition to be ignored (convenience)
ExecStatus ES_SUBSUMED(Propagator &p)
Index(Space &home, Propagator &p, Council< Index > &c, int i)
Create index advisor.
bool assigned(View x, int v)
Whether x is assigned to value v.
Class to iterate over advisors of a council.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Single value precedence propagator.
ExecStatus updateBeta(Space &home)
Update the beta pointer.
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
bool assigned(void) const
Test whether view is assigned.
ViewArray< View > x
Array of views.
static ExecStatus post(Home home, ViewArray< View > &x, int s, int t)
Post propagator that s precedes t in x.
Gecode toplevel namespace
Base-class for propagators.
virtual Propagator * copy(Space &home, bool share)
Copy propagator during cloning.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Generic domain change information to be supplied to advisors.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Home class for posting propagators
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Single(Home home, ViewArray< View > &x, int s, int t, int beta, int gamma)
Constructor for posting.
const Gecode::ModEvent ME_SET_BB
Domain operation has changed both greatest lower and least upper bound.
ExecStatus updateAlpha(Space &home)
Update the alpha pointer.
int alpha
Pointers updated during propagation.
bool contains(int i) const
Test whether i is in greatest lower bound.
@ ES_FIX
Propagation has computed fixpoint.
Advisors for views (by position in array)
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
ModEvent include(Space &home, View &x, int s)
Prune view x to only include values from s.
Gecode::FloatVal c(-8, 8)
Council< Index > c
The advisor council.
int s
The value s must precede t.
int n
Number of negative literals for node type.
int ModEventDelta
Modification event deltas.
@ ES_NOFIX
Propagation has not computed fixpoint.
@ ES_OK
Execution is okay.
int p
Number of positive literals for node type.
bool notContains(int i) const
Test whether i is not in the least upper bound.
virtual PropCost cost(const Space &, const ModEventDelta &) const
Cost function.