38 namespace Gecode {
namespace Int {
namespace Count {
40 template<
class VX,
class VY,
class VZ,
bool shr,
bool dom>
44 :
ViewBase<VX,VY,VZ>(home,x,y,z,c) {}
46 template<
class VX,
class VY,
class VZ,
bool shr,
bool dom>
52 if (
isval(y) && z.assigned())
61 template<
class VX,
class VY,
class VZ,
bool shr,
bool dom>
65 :
ViewBase<VX,VY,VZ>(home,share,p) {}
67 template<
class VX,
class VY,
class VZ,
bool shr,
bool dom>
73 template<
class VX,
class VY,
class VZ,
bool shr,
bool dom>
93 ::
post(home(*
this),
x,yc,
z.val()+
c)));
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
int atleast(void) const
How many views are at least equal.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
ExecStatus ES_SUBSUMED(Propagator &p)
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.
Base-class for count propagators (view)
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
bool isval(VY y)
Return whether y is a value.
Propagator for counting views (equal to number of equal views)
Propagation has computed fixpoint.
ExecStatus prune(Space &home, ViewArray< VX > &x, ConstIntView)
Base-class for both propagators and branchers.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Gecode::FloatVal c(-8, 8)
EqView(Space &home, bool share, EqView &p)
Constructor for cloning p.
int p
Number of positive literals for node type.
Propagator for counting views (equal integer to number of equal views)
ViewArray< VX > x
Views still to count.
int c
Number of views which are equal and have been eliminated.
void count(Space &home)
Count how many views are equal now.
static ExecStatus post(Home home, ViewArray< VX > &x, VY y, VZ z, int c)
Post propagator for .
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
ModEventDelta modeventdelta(void) const
Return the modification event delta.
Post propagator for SetVar SetOpType SetVar y
Post propagator for SetVar x
Propagation has not computed fixpoint.
int atmost(void) const
How many views are at most equal.
Gecode toplevel namespace
ExecStatus post_false(Home home, VX x, ConstIntView y)
int ModEventDelta
Modification event deltas.
int size(void) const
Return size of array (number of elements)
Home class for posting propagators
const Gecode::ModEvent ME_INT_NONE
Domain operation has not changed domain.
ExecStatus post_true(Home home, VX x, ConstIntView y)