38 namespace Gecode {
namespace Int {
namespace Count {
40 template<
class VX,
class VY,
class VZ>
52 template<
class VX,
class VY,
class VZ>
57 y.update(home,share,p.
y);
58 z.update(home,share,p.
z);
61 template<
class VX,
class VY,
class VZ>
67 template<
class VX,
class VY,
class VZ>
79 template<
class VX,
class VY,
class VZ>
100 template<
class VX,
class VY,
class VZ>
106 template<
class VX,
class VY,
class VZ>
117 template<
class VX,
class VY,
class VZ>
120 const VY& y,
const VZ& z) {
123 for (
int i = x.
size();
i--; )
void update(Space &, bool share, ViewArray< View > &a)
Update array to be a clone of array a.
Relation may hold or not.
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
Actor must always be disposed.
void cancel(Space &home, Propagator &p, IntSet &y)
VZ z
View which yields result of counting.
static bool sharing(const ViewArray< VX > &x, const VY &y, const VZ &z)
Test whether there is sharing of z with x or y.
int atleast(void) const
How many views are at least equal.
Base-class for count propagators (view)
RelTest holds(VX x, ConstIntView y)
Test whether x and y are equal.
Base-class for propagators.
bool shared(const IntSet &, VX)
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
ViewBase(Space &home, bool share, ViewBase &p)
Constructor for cloning p.
ViewArray< VX > x
Views still to count.
void subscribe(Space &home, Propagator &p, PropCond pc, bool process=true)
Subscribe propagator p with propagation condition pc to variable.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
void count(Space &home)
Count how many views are equal now.
void subscribe(Space &home, Propagator &p, IntSet &y)
ViewTypeDesc vtd(VY y)
Return the view type description of y.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
int atmost(void) const
How many views are at most equal.
Node * x
Pointer to corresponding Boolean expression node.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
virtual size_t dispose(Space &home)
Delete actor and return its size.
int size(void) const
Return size of array (number of elements)
Gecode toplevel namespace
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
virtual size_t dispose(Space &home)
Delete propagator and return its size.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
#define GECODE_NEVER
Assert that this command is never executed.