Go to the documentation of this file.
40 namespace Gecode {
namespace Int {
namespace Element {
46 template<
class VA,
class VC>
65 template<
class VA,
class VC>
81 template<
class VA,
class VC>
92 template<
class VA,
class VC>
111 template<
class VA,
class VB,
class VC, PropCond pc_ac>
116 x1.subscribe(home,*
this,pc_ac);
117 iv.subscribe(home,*
this,pc_ac);
120 template<
class VA,
class VB,
class VC, PropCond pc_ac>
124 x0.update(home,
p.x0);
125 x1.update(home,
p.x1);
126 iv.update(home,
p.iv);
129 template<
class VA,
class VB,
class VC, PropCond pc_ac>
138 template<
class VA,
class VB,
class VC, PropCond pc_ac>
142 x1.reschedule(home,*
this,pc_ac);
143 iv.reschedule(home,*
this,pc_ac);
146 template<
class VA,
class VB,
class VC, PropCond pc_ac>
150 x1.cancel(home,*
this,pc_ac);
151 iv.cancel(home,*
this,pc_ac);
152 (void) Propagator::dispose(home);
153 return sizeof(*this);
171 bool operator ()(
void)
const;
172 void operator ++(
void);
215 template<
class VA,
class VB,
class VC, PropCond pc_ac,
class RelTest>
219 assert(iv.
size() > 1);
229 while (vx0() && (
i < iv.
size())) {
230 if (iv[
i].idx < vx0.
val()) {
233 }
else if (iv[
i].idx > vx0.
val()) {
236 assert(iv[
i].idx == vx0.
val());
237 switch (rt(iv[
i].view,x1)) {
250 while (
i < iv.
size())
252 bool adjust = (j<iv.
size());
258 if (iv.
size() == 1) {
263 assert(x0.size() ==
static_cast<unsigned int>(iv.
size()));
276 template<
class VA,
class VB,
class VC>
282 template<
class VA,
class VB,
class VC>
299 template<
class VA,
class VB,
class VC>
304 template<
class VA,
class VB,
class VC>
310 template<
class VA,
class VB,
class VC>
313 assert(iv.size() > 1);
316 (home,iv,x0,x1,*
this,rt)));
317 if (iv.size() == 1) {
322 assert(iv.size() > 1);
324 int min = iv[0].view.min();
325 int max = iv[0].view.max();
326 for (
int i=1;
i<iv.size();
i++) {
345 return (x1.assigned() && (
min ==
max)) ?
358 template<
class VA,
class VB,
class VC>
364 template<
class VA,
class VB,
class VC>
381 template<
class VA,
class VB,
class VC>
386 template<
class VA,
class VB,
class VC>
393 template<
class VA,
class VB,
class VC>
400 template<
class VA,
class VB,
class VC>
403 assert(iv.size() > 1);
407 (home,iv,x0,x1,*
this,rt)));
408 if (iv.size() == 1) {
414 int min = iv[0].view.min();
415 int max = iv[0].view.max();
416 for (
int i=1;
i<iv.size();
i++) {
422 return (x1.assigned() && (
min ==
max)) ?
428 (home,iv,x0,x1,*
this,rt)));
429 if (iv.size() == 1) {
434 assert(iv.size() > 1);
437 for (
int i=0;
i<iv.size();
i++)
438 if (iv[
i].view.in(x1.val()))
444 for (
int i=0;
i<iv.size();
i++)
445 i_view[
i].init(iv[
i].view);
447 ModEvent me = x1.inter_r(home,i_val);
ViewBnd(Space &home, ViewBnd &p)
Constructor for cloning p.
Post propagator for SetVar x
Post propagator for SetVar SetOpType SetVar y
bool me_failed(ModEvent me)
Check whether modification event me is failed.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
ExecStatus ES_SUBSUMED(Propagator &p)
Base-class for element propagator for array of views.
RelTest rtest_eq_bnd(VX x, VY y)
Test whether views x and y are equal (use bounds information)
static ExecStatus post(Home home, IdxViewArray< VA > &iv, VB x0, VC x1)
Post propagator for .
View(Space &home, View &p)
Constructor for cloning p.
Value iterator for integer views.
const FloatNum min
Smallest allowed float value.
bool operator()(void) const
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
ExecStatus ES_NOFIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has not computed partial fixpoint
Base-class for both propagators and branchers.
@ RT_TRUE
Relation does hold.
int val(void) const
Return current value.
virtual Actor * copy(Space &home)
Perform copying during cloning.
Gecode toplevel namespace
Base-class for propagators.
@ RT_MAYBE
Relation may hold or not.
Range iterator for integer views.
void cancel(Space &home, Propagator &p, PropCond pc)
Binary domain consistent equality propagator.
RelTest rtest_eq_dom(VX x, VY y)
Test whether views x and y are equal (use full domain information)
@ RT_FALSE
Relation does not hold.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
void reschedule(Space &home, Propagator &p, IntSet &y)
Bounds consistent element propagator for array of views.
Home class for posting propagators
static ExecStatus post(Home home, IdxViewArray< VA > &iv, VB x0, VC x1)
Post propagator for .
virtual Actor * copy(Space &home)
Perform copying during cloning.
Class for domain-equality test.
Domain consistent element propagator for array of views.
ExecStatus scan(Space &home, IdxViewArray< VA > &iv, VB x0, VC x1, Propagator &p, RelTest rt)
Post propagator for SetVar SetOpType SetVar SetRelType r
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
Range iterator for union of iterators.
#define GECODE_NEVER
Assert that this command is never executed.
int size(void) const
Return the current size.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
int ModEvent
Type for modification events.
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatVal c)
Post propagator for .
Value iterator for indices in index-view map.
RelTest operator()(VA, VC)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
bool shared(ViewArray< ViewX > x, ViewArray< ViewY > y)
@ ES_FIX
Propagation has computed fixpoint.
RelTest operator()(VA, VC)
Binary bounds consistent equality propagator.
ViewDom(Space &home, ViewDom &p)
Constructor for cloning p.
RelTest
Result of testing relation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Class for pair of index and view.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
@ ES_FAILED
Execution has resulted in failure.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
int ModEventDelta
Modification event deltas.
@ ES_NOFIX
Propagation has not computed fixpoint.
void init(const IdxView< View > *, const IdxView< View > *)
Gecode::IntArgs i({1, 2, 3, 4})
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
@ ES_OK
Execution is okay.
int p
Number of positive literals for node type.
const FloatNum max
Largest allowed float value.
Class for bounds-equality test.