38 namespace Gecode {
namespace Int {
namespace Channel {
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>
206 for (
int i=0;
i<
n;
i++) {
207 if (x[
i].doval()) xa.
push(
i);
208 if (y[
i].doval()) ya.
push(
i);
231 }
while (!xa.
empty());
246 if (
dc.available()) {
250 for (
int i=0;
i<
n;
i++)
261 for (
int i=0;
i<
n;
i++)
263 int j =
ox(x[
i].view).val();
294 for (
int i=0;
i<2*
n;
i++)
295 if (!
xy[
i].view.assigned())
303 template<
class View,
class Offset,
bool shared>
306 Offset&
ox, Offset&
oy) {
313 for (
int i=0;
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)
Distinct::DomCtrl< View > dc
Propagation controller for propagating distinct.
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
bool dodom(void) const
Check whether propagation for domain is to be done.
ExecStatus ES_SUBSUMED(Propagator &p)
ExecStatus ES_NOFIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has not computed partial fixpoint
Offset ox
Offset transformation for x variables.
bool doval(void) const
Check whether propagation for assignment is to be done.
bool empty(void) const
Test whether stack is empty.
int ModEvent
Type for modification events.
DomInfo< View, Offset > * xy
View and information for both x and y.
Offset oy
Offset transformation for y variables.
void done(Offset &o)
Update the size and bounds information after pruning.
Propagation has computed fixpoint.
void update(Space &home, DomInfo< View, Offset > &vcb)
Update during cloning.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Base-class for both propagators and branchers.
Range iterator for integer views.
#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.
void assigned(void)
Record that view got assigned.
int n
Number of negative literals for node type.
Gecode::IntArgs i({1, 2, 3, 4})
Execution has resulted in failure.
int n
Number of views (actually twice as many for both x and y)
const Gecode::ModEvent ME_INT_VAL
Domain operation has resulted in a value (assigned variable)
ExecStatus prop_dom(Space &home, int n, DomInfo< View, Offset > *x, Offset &ox, DomInfo< View, Offset > *y, Offset &oy, ProcessStack &ya)
ModEventDelta med
A set of modification events (used during propagation)
static ExecStatus post(Home home, int n, DomInfo< View, Offset > *xy, Offset &ox, Offset &oy)
Post propagator for channeling on xy.
Value iterator from range iterator.
Domain consistent channel propagator.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
unsigned int size
Last propagated size.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
ExecStatus ES_FIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has computed partial fixpoint
Converter with fixed offset.
Post propagator for SetVar SetOpType SetVar SetRelType r
Combine view with information for domain propagation.
Post propagator for SetVar SetOpType SetVar y
Base-class for channel propagators.
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
void init(View x, int n)
Initialize.
bool assigned(View x, int v)
Whether x is assigned to value v.
int max
Last propagated maximum.
Stack with fixed number of elements.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
int min
Last propagated minimum.
Post propagator for SetVar x
Propagation has not computed fixpoint.
Dom(Space &home, Dom &p)
Constructor for cloning p.
Gecode toplevel namespace
bool shared(ViewArray< ViewX > x, ViewArray< ViewY > y)
void removed(int i)
Record that one value got removed.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
bool me_failed(ModEvent me)
Check whether modification event me is failed.
int n_na
Total number of not assigned views (not known to be assigned)
Range iterator for computing the complement (described by values)