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);
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);
133 template<
class VA,
class VB,
class VC, PropCond pc_ac>
142 template<
class VA,
class VB,
class VC, PropCond pc_ac>
146 x1.cancel(home,*
this,pc_ac);
147 iv.cancel(home,*
this,pc_ac);
149 return sizeof(*this);
211 template<
class VA,
class VB,
class VC, PropCond pc_ac,
class RelTest>
215 assert(iv.
size() > 1);
225 while (vx0() && (i < iv.
size())) {
226 if (iv[i].idx < vx0.val()) {
227 iv[
i].view.
cancel(home,p,pc_ac);
229 }
else if (iv[i].idx > vx0.val()) {
232 assert(iv[i].idx == vx0.val());
233 switch (rt(iv[i].view,x1)) {
235 iv[
i].view.
cancel(home,p,pc_ac);
246 while (i < iv.
size())
247 iv[i++].view.
cancel(home,p,pc_ac);
248 bool adjust = (j<iv.
size());
254 if (iv.
size() == 1) {
259 assert(x0.size() ==
static_cast<unsigned int>(iv.
size()));
272 template<
class VA,
class VB,
class VC>
278 template<
class VA,
class VB,
class VC>
295 template<
class VA,
class VB,
class VC>
300 template<
class VA,
class VB,
class VC>
306 template<
class VA,
class VB,
class VC>
309 assert(iv.size() > 1);
312 (home,iv,x0,x1,*
this,rt)));
313 if (iv.size() == 1) {
318 assert(iv.size() > 1);
320 int min = iv[iv.size()-1].view.min();
321 int max = iv[iv.size()-1].view.max();
322 for (
int i=iv.
size()-1;
i--; ) {
341 return (x1.assigned() && (min ==
max)) ?
354 template<
class VA,
class VB,
class VC>
360 template<
class VA,
class VB,
class VC>
377 template<
class VA,
class VB,
class VC>
382 template<
class VA,
class VB,
class VC>
389 template<
class VA,
class VB,
class VC>
396 template<
class VA,
class VB,
class VC>
399 assert(iv.size() > 1);
403 (home,iv,x0,x1,*
this,rt)));
404 if (iv.size() == 1) {
410 int min = iv[iv.size()-1].view.min();
411 int max = iv[iv.size()-1].view.max();
412 for (
int i=iv.
size()-1;
i--; ) {
418 return (x1.assigned() && (min ==
max)) ?
424 (home,iv,x0,x1,*
this,rt)));
425 if (iv.size() == 1) {
430 assert(iv.size() > 1);
433 for (
int i = iv.
size();
i--; )
434 if (iv[
i].view.in(x1.val()))
440 for (
int i = iv.
size();
i--; )
441 i_view[
i].init(iv[
i].view);
443 ModEvent me = x1.inter_r(home,i_val);
Domain consistent element propagator for array of views.
Relation may hold or not.
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.
int size(void) const
Return size of array (number of elements)
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
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.
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.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
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.
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 .
IdxViewArray< VA > iv
Current index-view map.
Execution has resulted in failure.
bool operator()(void) const
int val(void) const
Return assigned value (only if assigned)
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.
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.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
RelTest rtest_eq_dom(View x, View y)
Test whether views x and y are equal (use full domain information)
virtual Actor * copy(Space &home, bool share)
Perform copying during cloning.
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)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Node * x
Pointer to corresponding Boolean expression node.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
ViewBnd(Space &home, bool share, ViewBnd &p)
Constructor for cloning p.
virtual size_t dispose(Space &home)
Delete actor and return its size.
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
void subscribe(Space &home, Propagator &p, PropCond pc, bool process=true)
void free(T *b, long unsigned int n)
Delete n objects allocated from the region starting at b.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
ViewDom(Space &home, bool share, ViewDom &p)
Constructor for cloning p.
RelTest rtest_eq_bnd(View x, View y)
Test whether views x and y are equal (use bounds information)
Propagation has not computed fixpoint.
bool shared(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether views share same variable.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
RelTest operator()(VA, VC)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int ModEventDelta
Modification event deltas.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
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.
int size(void) const
Return the current size.
void update(Space &home, bool share, IdxViewArray< View > &x)
Cloning.