44 namespace Gecode {
namespace Int {
namespace Element {
91 for (
int i =
n;
i--; ) {
92 xs[
i].idx =
i; xs[
i].view = xa[
i];
120 assert((
i >= 0) && (
i <
size()));
127 assert((
i >= 0) && (
i <
size()));
135 for (
int i =
n;
i--; )
136 xs[
i].view.subscribe(home,
p,pc,process);
142 for (
int i =
n;
i--; )
143 xs[
i].view.cancel(home,
p,pc);
152 for (
int i=
n;
i--; ) {
153 xs[
i].idx =
a[
i].idx;
154 xs[
i].view.update(home,share,
a[
i].view);
164 template<
class VA,
class VC>
183 template<
class VA,
class VC>
199 template<
class VA,
class VC>
210 template<
class VA,
class VC>
229 template<
class VA,
class VB,
class VC, PropCond pc_ac>
234 x1.subscribe(home,*
this,pc_ac);
235 iv.subscribe(home,*
this,pc_ac);
238 template<
class VA,
class VB,
class VC, PropCond pc_ac>
242 x0.update(home,share,
p.x0);
243 x1.update(home,share,
p.x1);
244 iv.update(home,share,
p.iv);
247 template<
class VA,
class VB,
class VC, PropCond pc_ac>
256 template<
class VA,
class VB,
class VC, PropCond pc_ac>
260 x1.cancel(home,*
this,pc_ac);
261 iv.cancel(home,*
this,pc_ac);
262 (void) Propagator::dispose(home);
263 return sizeof(*this);
281 bool operator ()(
void)
const;
282 void operator ++(
void);
325 template<
class VA,
class VB,
class VC, PropCond pc_ac,
class RelTest>
329 assert(iv.
size() > 1);
339 while (vx0() && (
i < iv.
size())) {
340 if (iv[
i].idx < vx0.val()) {
343 }
else if (iv[
i].idx > vx0.val()) {
346 assert(iv[
i].idx == vx0.val());
347 switch (rt(iv[
i].view,x1)) {
360 while (
i < iv.
size())
362 bool adjust = (j<iv.
size());
368 if (iv.
size() == 1) {
373 assert(x0.size() == static_cast<unsigned int>(iv.
size()));
386 template<
class VA,
class VB,
class VC>
392 template<
class VA,
class VB,
class VC>
409 template<
class VA,
class VB,
class VC>
414 template<
class VA,
class VB,
class VC>
420 template<
class VA,
class VB,
class VC>
423 assert(iv.size() > 1);
426 (home,iv,x0,x1,*
this,rt)));
427 if (iv.size() == 1) {
432 assert(iv.size() > 1);
434 int min = iv[iv.size()-1].view.min();
435 int max = iv[iv.size()-1].view.max();
436 for (
int i=iv.
size()-1;
i--; ) {
455 return (x1.assigned() && (
min ==
max)) ?
468 template<
class VA,
class VB,
class VC>
474 template<
class VA,
class VB,
class VC>
491 template<
class VA,
class VB,
class VC>
496 template<
class VA,
class VB,
class VC>
503 template<
class VA,
class VB,
class VC>
510 template<
class VA,
class VB,
class VC>
513 assert(iv.size() > 1);
517 (home,iv,x0,x1,*
this,rt)));
518 if (iv.size() == 1) {
524 int min = iv[iv.size()-1].view.min();
525 int max = iv[iv.size()-1].view.max();
526 for (
int i=iv.
size()-1;
i--; ) {
532 return (x1.assigned() && (
min ==
max)) ?
538 (home,iv,x0,x1,*
this,rt)));
539 if (iv.size() == 1) {
544 assert(iv.size() > 1);
547 for (
int i = iv.
size();
i--; )
548 if (iv[
i].view.in(x1.val()))
554 for (
int i = iv.
size();
i--; )
555 i_view[
i].init(iv[
i].view);
557 ModEvent me = x1.inter_r(home,i_val);
Domain consistent element propagator for array of views.
Relation may hold or not.
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatNum c)
Post propagator for .
int size(void) const
Return the current size.
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.
ExecStatus ES_SUBSUMED(Propagator &p)
const FloatNum max
Largest allowed float value.
void cancel(Space &home, Propagator &p, IntSet &y)
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 .
struct Gecode::@511::NNF::@54::@55 b
For binary nodes (and, or, eqv)
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.
static IdxView * allocate(Space &, int)
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
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)
int n
Number of negative literals for node type.
int val(void) const
Return assigned value (only if assigned)
void cancel(Space &home, Propagator &p, PropCond pc)
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.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
int PropCond
Type for propagation conditions.
void subscribe(Space &home, Propagator &p, IntSet &y)
Range iterator for union of iterators.
unsigned int size(I &i)
Size of all ranges of range iterator i.
Binary bounds consistent equality propagator.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
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)
Passing integer variables.
Passing Boolean variables.
virtual Actor * copy(Space &home, bool share)
Perform copying during cloning.
struct Gecode::@511::NNF::@54::@56 a
For atomic nodes.
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)
Integer view for integer variables.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Node * x
Pointer to corresponding Boolean expression node.
ViewBnd(Space &home, bool share, ViewBnd &p)
Constructor for cloning p.
Class for pair of index and view.
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
An array of IndexView pairs.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
ViewDom(Space &home, bool share, ViewDom &p)
Constructor for cloning p.
Class to get VarArg type for view.
RelTest rtest_eq_bnd(View x, View y)
Test whether views x and y are equal (use bounds information)
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.
IdxViewArray(void)
Default constructor.
Gecode toplevel namespace
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
#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.
Boolean view for Boolean variables.