40namespace 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);
120 template<
class VA,
class VB,
class VC, PropCond pc_ac>
124 x0.update(home,
p.x0);
125 x1.update(home,
p.x1);
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);
153 return sizeof(*this);
215 template<
class VA,
class VB,
class VC, PropCond pc_ac,
class RelTest>
229 while (vx0() && (i < iv.
size())) {
230 if (iv[i].idx < vx0.val()) {
231 iv[i].view.
cancel(home,
p,pc_ac);
233 }
else if (iv[i].idx > vx0.val()) {
236 assert(iv[i].idx == vx0.val());
237 switch (rt(iv[i].view,x1)) {
239 iv[i].view.
cancel(home,
p,pc_ac);
250 while (i < iv.
size())
252 bool adjust = (j<iv.
size());
258 if (iv.
size() == 1) {
261 IterIdxView<VA>
v(&iv[0],&iv[0]+iv.
size());
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++) {
327 min = std::min(iv[i].view.min(),
min);
328 max = std::max(iv[i].view.max(),
max);
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++) {
417 min = std::min(iv[i].view.min(),
min);
418 max = std::max(iv[i].view.max(),
max);
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);
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
int p
Number of positive literals for node type.
Base-class for both propagators and branchers.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Home class for posting propagators
Value iterator for indices in index-view map.
void init(const IdxView< View > *, const IdxView< View > *)
bool operator()(void) const
Class for bounds-equality test.
RelTest operator()(VA, VC)
Class for domain-equality test.
RelTest operator()(VA, VC)
Bounds consistent element propagator for array of views.
ViewBnd(Space &home, ViewBnd &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Perform copying during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, IdxViewArray< VA > &iv, VB x0, VC x1)
Post propagator for .
Domain consistent element propagator for array of views.
virtual Actor * copy(Space &home)
Perform copying during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
static ExecStatus post(Home home, IdxViewArray< VA > &iv, VB x0, VC x1)
Post propagator for .
ViewDom(Space &home, ViewDom &p)
Constructor for cloning p.
Base-class for element propagator for array of views.
IdxViewArray< VA > iv
Current index-view map.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
virtual void reschedule(Space &home)
Schedule function.
View(Space &home, View &p)
Constructor for cloning p.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
An array of IdxView pairs.
void subscribe(Space &home, Propagator &p, PropCond pc, bool process=true)
void update(Space &home, IdxViewArray< View > &x)
Cloning.
void cancel(Space &home, Propagator &p, PropCond pc)
int size(void) const
Return the current size.
Class for pair of index and view.
Binary bounds consistent equality propagator.
Binary domain consistent equality propagator.
Range iterator for integer views.
Value iterator for integer views.
Range iterator for union of iterators.
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
Base-class for propagators.
ExecStatus ES_NOFIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has not computed partial fixpoint
ExecStatus ES_SUBSUMED(Propagator &p)
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 scan(Space &home, IdxViewArray< VA > &iv, VB x0, VC x1, Propagator &p, RelTest rt)
RelTest rtest_eq_dom(VX x, VY y)
Test whether views x and y are equal (use full domain information)
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
RelTest rtest_eq_bnd(VX x, VY y)
Test whether views x and y are equal (use bounds information)
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
RelTest
Result of testing relation.
@ RT_TRUE
Relation does hold.
@ RT_MAYBE
Relation may hold or not.
@ RT_FALSE
Relation does not hold.
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.
Gecode::IntArgs i({1, 2, 3, 4})
#define GECODE_NEVER
Assert that this command is never executed.