44 namespace Gecode {
namespace Int {
namespace Element {
50 template<
class VA,
class VC>
69 template<
class VA,
class VC>
85 template<
class VA,
class VC>
96 template<
class VA,
class VC>
115 template<
class VA,
class VB,
class VC, PropCond pc_ac>
120 x1.subscribe(home,*
this,pc_ac);
121 iv.subscribe(home,*
this,pc_ac);
124 template<
class VA,
class VB,
class VC, PropCond pc_ac>
128 x0.update(home,share,
p.x0);
129 x1.update(home,share,
p.x1);
130 iv.update(home,share,
p.iv);
133 template<
class VA,
class VB,
class VC, PropCond pc_ac>
142 template<
class VA,
class VB,
class VC, PropCond pc_ac>
146 x1.reschedule(home,*
this,pc_ac);
147 iv.reschedule(home,*
this,pc_ac);
150 template<
class VA,
class VB,
class VC, PropCond pc_ac>
154 x1.cancel(home,*
this,pc_ac);
155 iv.cancel(home,*
this,pc_ac);
156 (void) Propagator::dispose(home);
157 return sizeof(*this);
175 bool operator ()(
void)
const;
176 void operator ++(
void);
219 template<
class VA,
class VB,
class VC, PropCond pc_ac,
class RelTest>
223 assert(iv.
size() > 1);
233 while (vx0() && (
i < iv.
size())) {
234 if (iv[
i].idx < vx0.val()) {
237 }
else if (iv[
i].idx > vx0.val()) {
240 assert(iv[
i].idx == vx0.val());
241 switch (rt(iv[
i].view,x1)) {
254 while (
i < iv.
size())
256 bool adjust = (j<iv.
size());
262 if (iv.
size() == 1) {
267 assert(x0.size() ==
static_cast<unsigned int>(iv.
size()));
280 template<
class VA,
class VB,
class VC>
286 template<
class VA,
class VB,
class VC>
303 template<
class VA,
class VB,
class VC>
308 template<
class VA,
class VB,
class VC>
314 template<
class VA,
class VB,
class VC>
317 assert(iv.size() > 1);
320 (home,iv,x0,x1,*
this,rt)));
321 if (iv.size() == 1) {
326 assert(iv.size() > 1);
328 int min = iv[iv.size()-1].view.min();
329 int max = iv[iv.size()-1].view.max();
330 for (
int i=iv.
size()-1;
i--; ) {
349 return (x1.assigned() && (
min ==
max)) ?
362 template<
class VA,
class VB,
class VC>
368 template<
class VA,
class VB,
class VC>
385 template<
class VA,
class VB,
class VC>
390 template<
class VA,
class VB,
class VC>
397 template<
class VA,
class VB,
class VC>
404 template<
class VA,
class VB,
class VC>
407 assert(iv.size() > 1);
411 (home,iv,x0,x1,*
this,rt)));
412 if (iv.size() == 1) {
418 int min = iv[iv.size()-1].view.min();
419 int max = iv[iv.size()-1].view.max();
420 for (
int i=iv.
size()-1;
i--; ) {
426 return (x1.assigned() && (
min ==
max)) ?
432 (home,iv,x0,x1,*
this,rt)));
433 if (iv.size() == 1) {
438 assert(iv.size() > 1);
441 for (
int i = iv.
size();
i--; )
442 if (iv[
i].view.in(x1.val()))
448 for (
int i = iv.
size();
i--; )
449 i_view[
i].init(iv[
i].view);
451 ModEvent me = x1.inter_r(home,i_val);
Domain consistent element propagator for array of views.
Relation may hold or not.
int size(void) const
Return size of array (number of elements)
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
Binary domain consistent equality propagator.
View(Space &home, bool share, View &p)
Constructor for cloning p.
ExecStatus ES_SUBSUMED(Propagator &p)
const FloatNum max
Largest allowed float value.
RelTest rtest_eq_dom(VX x, VY y)
Test whether views x and y are equal (use full domain information)
ExecStatus ES_NOFIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has not computed partial fixpoint
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
int ModEvent
Type for modification events.
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatVal c)
Post propagator for .
Base-class for propagators.
void init(const IdxView< View > *, const IdxView< View > *)
static ExecStatus post(Home home, IdxViewArray< VA > &iv, VB x0, VC x1)
Post propagator for .
Value iterator for integer views.
Propagation has computed fixpoint.
Base-class for both propagators and branchers.
Range iterator for integer views.
Class for bounds-equality test.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
virtual Actor * copy(Space &home, bool share)
Perform copying during cloning.
bool operator()(void) const
int p
Number of positive literals for node type.
const FloatNum min
Smallest allowed float value.
Gecode::IntArgs i(4, 1, 2, 3, 4)
static ExecStatus post(Home home, IdxViewArray< VA > &iv, VB x0, VC x1)
Post propagator for .
Execution has resulted in failure.
RelTest
Result of testing relation.
void cancel(Space &home, Propagator &p, PropCond pc)
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
Range iterator for union of iterators.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
Binary bounds consistent equality propagator.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
RelTest operator()(VA, VC)
Base-class for element propagator for array of views.
int size(void) const
Return the current size.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
virtual Actor * copy(Space &home, bool share)
Perform copying during cloning.
RelTest rtest_eq_bnd(VX x, VY y)
Test whether views x and y are equal (use bounds information)
Post propagator for SetVar SetOpType SetVar SetRelType r
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Value iterator for indices in index-view map.
ExecStatus scan(Space &home, IdxViewArray< VA > &iv, VB x0, VC x1, Propagator &p, RelTest rt)
Post propagator for SetVar SetOpType SetVar y
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ViewBnd(Space &home, bool share, ViewBnd &p)
Constructor for cloning p.
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
ViewDom(Space &home, bool share, ViewDom &p)
Constructor for cloning p.
Post propagator for SetVar x
Propagation has not computed fixpoint.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
bool shared(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether views share same variable.
Gecode toplevel namespace
RelTest operator()(VA, VC)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
void reschedule(Space &home, Propagator &p, IntSet &y)
int ModEventDelta
Modification event deltas.
Home class for posting propagators
Class for pair of index and view.
#define GECODE_NEVER
Assert that this command is never executed.
Class for domain-equality test.
Bounds consistent element propagator for array of views.
bool me_failed(ModEvent me)
Check whether modification event me is failed.