56 bool doval(
void)
const;
58 bool dodom(
void)
const;
82 return !
a &&
view.assigned();
107 template<
class View,
class Offset,
class Info>
114 int j = ox(
x[i].view).val();
126 for (
int k=0; k<i; k++) {
144 for (
int k=i+1; k<n; k++) {
161 x[i].assigned(); n_na--;
162 }
while (!xa.
empty());
167 template<
class View,
class Offset,
class Info>
173 return doprop_val<View,Offset,Info>(home,n,
x,ox,
y,oy,n_na,xa,ya);
180 template<
class View,
class Offset,
bool shared>
186 template<
class View,
class Offset,
bool shared>
191 template<
class View,
class Offset,
bool shared>
197 template<
class View,
class Offset,
bool shared>
208 for (
int i=0; i<
n; i++) {
209 if (
x[i].doval()) xa.
push(i);
210 if (
y[i].doval()) ya.
push(i);
221 }
while (!xa.
empty());
228 template<
class View,
class Offset,
bool shared>
238 for (
int i=0; i<
n; i++) {
Base-class for both propagators and branchers.
Home class for posting propagators
Base-class for channel propagators.
Base(Space &home, Base< ValInfo< View >, Offset, pc > &p)
Combine view with information for value propagation.
void done(void)
Update the cardinality and bounds information after pruning.
bool a
Whether it has been propagated that view is assigned.
void init(View x, int n)
Initialize.
void assigned(void)
Record that view got assigned.
void removed(int i)
Record that one value got removed.
bool dodom(void) const
Check whether propagation for domain is to be done.
bool doval(void) const
Check whether propagation for assignment is to be done.
void update(Space &home, ValInfo< View > &vi)
Update during cloning.
Naive channel propagator.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
static ExecStatus post(Home home, int n, ValInfo< View > *xy, Offset &ox, Offset &oy)
Post propagator for channeling.
Val(Space &home, Val &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Converter with fixed offset.
void push(const T &x)
Push element x on top of stack.
T pop(void)
Pop topmost element from stack and return it.
bool empty(void) const
Test whether stack is empty.
ExecStatus ES_SUBSUMED(Propagator &p)
Propagator p is subsumed
int ModEventDelta
Modification event deltas.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
bool me_failed(ModEvent me)
Check whether modification event me is failed.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
ExecStatus prop_val(Space &home, int n, Info *x, Offset &ox, Info *y, Offset &oy, int &n_na, ProcessStack &xa, ProcessStack &ya)
Support::StaticStack< int, Region > ProcessStack
Processing stack.
ExecStatus doprop_val(Space &home, int n, Info *x, Offset &ox, Info *y, Offset &oy, int &n_na, ProcessStack &xa, ProcessStack &ya)
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value)
const Gecode::ModEvent ME_INT_VAL
Domain operation has resulted in a value (assigned variable)
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
Post propagator for SetVar SetOpType SetVar y
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
@ ES_FAILED
Execution has resulted in failure.
@ ES_NOFIX
Propagation has not computed fixpoint.
bool shared(ViewArray< ViewX > x, ViewArray< ViewY > y)
Post propagator for SetVar x
int ModEvent
Type for modification events.