42 namespace Gecode {
namespace Int {
namespace Channel {
60 bool doval(
void)
const;
62 bool dodom(
void)
const;
80 view.update(home,share,vi.
view);
a = vi.
a;
86 return !
a && view.assigned();
111 template<
class View,
class Offset,
class Info>
118 int j = ox(x[i].view).val();
121 ModEvent me = oy(y[j].view).eq(home,i);
130 for (
int k=i; k--; ) {
131 ModEvent me = ox(x[k].view).nq(home,j);
148 for (
int k=i+1; k<
n; k++) {
149 ModEvent me = ox(x[k].view).nq(home,j);
165 x[
i].assigned(); n_na--;
166 }
while (!xa.
empty());
171 template<
class View,
class Offset,
class Info>
177 return doprop_val<View,Offset,Info>(home,
n,
x,ox,y,oy,n_na,xa,ya);
184 template<
class View,
class Offset,
bool shared>
190 template<
class View,
class Offset,
bool shared>
196 template<
class View,
class Offset,
bool shared>
202 template<
class View,
class Offset,
bool shared>
213 for (
int i = n;
i--; ) {
214 if (x[
i].doval()) xa.
push(
i);
215 if (y[
i].doval()) ya.
push(
i);
221 (home,n,x,ox,y,oy,n_na,xa,ya)));
224 (home,n,y,oy,x,ox,n_na,ya,xa)));
226 }
while (!xa.
empty());
233 template<
class View,
class Offset,
bool shared>
243 for (
int i=n;
i--; ) {
void push(const T &x)
Push element x on top of stack.
ExecStatus prop_val(Space &home, int n, Info *x, Offset &ox, Info *y, Offset &oy, int &n_na, ProcessStack &xa, ProcessStack &ya)
bool doval(void) const
Check whether propagation for assignment is to be done.
ExecStatus ES_SUBSUMED(Propagator &p)
bool a
Whether it has been propagated that view is assigned.
int ModEvent
Type for modification events.
void done(void)
Update the cardinality and bounds information after pruning.
static ExecStatus post(Home home, int n, ValInfo< View > *xy, Offset &ox, Offset &oy)
Post propagator for channeling.
Propagation has computed fixpoint.
Combine view with information for value propagation.
Naive channel propagator.
Base-class for both propagators and branchers.
void update(Space &home, bool share, ValInfo< View > &vi)
Update during cloning.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
int p
Number of positive literals for node type.
bool empty(void) const
Test whether stack is empty.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Execution has resulted in failure.
const Gecode::ModEvent ME_INT_VAL
Domain operation has resulted in a value (assigned variable)
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
Converter with fixed offset.
Val(Space &home, bool share, Val &p)
Constructor for cloning p.
void removed(int i)
Record that one value got removed.
Node * x
Pointer to corresponding Boolean expression node.
Base-class for channel propagators.
Stack with fixed number of elements.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
T pop(void)
Pop topmost element from stack and return it.
Propagation has not computed fixpoint.
bool shared(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether views share same variable.
void assigned(void)
Record that view got assigned.
Gecode toplevel namespace
void init(View x, int n)
Initialize.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
ExecStatus doprop_val(Space &home, int n, Info *x, Offset &ox, Info *y, Offset &oy, int &n_na, ProcessStack &xa, ProcessStack &ya)
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
bool me_failed(ModEvent me)
Check whether modification event me is failed.
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value)
bool dodom(void) const
Check whether propagation for domain is to be done.