44 template<
class View,
class Offset>
60 bool doval(
void)
const;
62 bool dodom(
void)
const;
71 template<
class View,
class Offset>
75 size =
static_cast<unsigned int>(n);
80 template<
class View,
class Offset>
89 template<
class View,
class Offset>
92 return (
size != 1) &&
view.assigned();
95 template<
class View,
class Offset>
101 template<
class View,
class Offset>
107 template<
class View,
class Offset>
117 template<
class View,
class Offset>
126 template<
class View,
class Offset>
130 for (
int i=0; i<n; i++)
167 template<
class View,
class Offset,
bool shared>
173 template<
class View,
class Offset,
bool shared>
178 template<
class View,
class Offset,
bool shared>
184 template<
class View,
class Offset,
bool shared>
194 template<
class View,
class Offset,
bool shared>
198 const int n = this->n;
208 for (
int i=0; i<
n; i++) {
209 if (
x[i].doval()) xa.
push(i);
210 if (
y[i].doval()) ya.
push(i);
233 }
while (!xa.
empty());
248 if (
dc.available()) {
252 for (
int i=0; i<
n; i++)
263 for (
int i=0; i<
n; i++)
265 int j =
ox(
x[i].view).val();
276 x[i].assigned();
n_na--;
296 for (
int i=0; i<2*
n; i++)
297 if (!
xy[i].view.assigned())
305 template<
class View,
class Offset,
bool shared>
315 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< DomInfo< View, Offset >, Offset, pc > &p)
DomInfo< View, Offset > * xy
Combine view with information for domain propagation.
void update(Space &home, DomInfo< View, Offset > &vcb)
Update during cloning.
unsigned int size
Last propagated size.
void removed(int i)
Record that one value got removed.
void assigned(void)
Record that view got assigned.
void done(Offset &o)
Update the size and bounds information after pruning.
int min
Last propagated minimum.
bool doval(void) const
Check whether propagation for assignment is to be done.
void init(View x, int n)
Initialize.
bool dodom(void) const
Check whether propagation for domain is to be done.
int max
Last propagated maximum.
Domain consistent channel propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, int n, DomInfo< View, Offset > *xy, Offset &ox, Offset &oy)
Post propagator for channeling on xy.
Dom(Space &home, Dom &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Distinct::DomCtrl< View > dc
Propagation controller for propagating distinct.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Converter with fixed offset.
Range iterator for integer views.
Range iterator for computing the complement (described by values)
Value iterator from range iterator.
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
ModEventDelta med
A set of modification events (used during propagation)
void push(const T &x)
Push element x on top of stack.
bool empty(void) const
Test whether stack is empty.
ExecStatus ES_NOFIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has not computed partial fixpoint
ExecStatus ES_FIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has computed partial fixpoint
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 prop_dom(Space &home, int n, DomInfo< View, Offset > *x, Offset &ox, DomInfo< View, Offset > *y, Offset &oy, ProcessStack &ya)
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.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
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.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
bool shared(ViewArray< ViewX > x, ViewArray< ViewY > y)
Post propagator for SetVar x
int ModEvent
Type for modification events.