36 namespace Gecode {
namespace Int {
namespace Channel {
61 while ((i<x.size()) && !x[i].zero())
77 }
while ((i<x.size()) && !x[i].zero());
126 assert((
y.
min()-o >= 0) && (
y.
max()-o <
n));
132 for (
int i=0;
i<j;
i++)
134 for (
int i=j+1;
i<
n;
i++)
140 if (status == S_ONE) {
142 for (
int i=0;
true;
i++)
144 for (
int j=0; j<
i; j++)
146 for (
int j=
i+1; j<
n; j++)
168 x.drop_lst(
max);
n =
x.size();
174 while ((
i <
n) &&
x[
i].zero())
i++;
177 x.drop_fst(
i); o +=
i;
n =
x.size();
183 while ((
i >= 0) &&
x[
i].zero())
i--;
185 x.drop_lst(
i);
n =
x.size();
203 assert((
n >= 2) &&
x[0].none() &&
x[
n-1].none());
204 assert((
y.
min()-o == 0) && (
y.
max()-o ==
n-1));
221 }
while (
v() && (
i <
n));
int n
Number of negative literals for node type.
Node * x
Pointer to corresponding Boolean expression node.
Base-class for both propagators and branchers.
Class to iterate over advisors of a council.
A & advisor(void) const
Return advisor.
Generic domain change information to be supplied to advisors.
bool one(void) const
Test whether view is assigned to be one.
Iterates the values to be removed as defined by an array of Boolean views.
BoolIter(const ViewArray< BoolView > &x0, int o0)
Initialize iterator.
int val(void) const
Return value.
bool operator()(void) const
Test whether further values available.
void operator++(void)
Move to the next value.
Link propagator for multiple Boolean views.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (low unary if y is assigned, low linear otherwise)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual void reschedule(Space &home)
Schedule function.
int min(void) const
Return minimum of domain.
ModEvent lq(Space &home, int n)
Restrict domain values to be less or equal than n.
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
ModEvent minus_v(Space &home, I &i, bool depends=true)
Remove from domain the values described by i.
int val(void) const
Return assigned value (only if assigned)
int max(void) const
Return maximum of domain.
ModEvent eq(Space &home, int n)
Restrict domain values to be equal to n.
ViewArray< BoolView > x
Array of views.
static PropCost unary(PropCost::Mod m)
Single variable for modifier pcm.
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
ModEventDelta med
A set of modification events (used during propagation)
static ModEvent me(const ModEventDelta &med)
Return modification event for view type in med.
static void schedule(Space &home, Propagator &p, ModEvent me)
Schedule propagator p with modification event me.
void reschedule(Space &home, Propagator &p, PropCond pc)
Re-schedule propagator p with propagation condition pc.
bool assigned(void) const
Test whether view is assigned.
@ ES_FIX
Propagation has computed fixpoint.
@ ES_FAILED
Execution has resulted in failure.
@ ES_NOFIX
Propagation has not computed fixpoint.
ExecStatus ES_SUBSUMED(Propagator &p)
int ModEventDelta
Modification event deltas.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
const FloatNum max
Largest allowed float value.
const FloatNum min
Smallest allowed float value.
const Gecode::ModEvent ME_INT_BND
Domain operation has changed the minimum or maximum of the domain.
const Gecode::ModEvent ME_BOOL_VAL
Domain operation has resulted in a value (assigned variable)
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
const Gecode::ModEvent ME_INT_VAL
Domain operation has resulted in a value (assigned variable)
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
Gecode::IntArgs i({1, 2, 3, 4})
#define GECODE_NEVER
Assert that this command is never executed.