38 namespace Gecode {
namespace Int {
namespace Count {
40 template<
class VX,
class VY>
43 :
IntBase<VX,VY>(home,x,n_s,y,c) {}
45 template<
class VX,
class VY>
50 for (
int i=n_x;
i--; )
53 x[
i] = x[--n_x];
break;
55 x[
i] = x[--n_x]; c--;
break;
63 if ((c < 0) || (c > n_x))
78 template<
class VX,
class VY>
81 :
IntBase<VX,VY>(home,share,p) {}
83 template<
class VX,
class VY>
89 template<
class VX,
class VY>
94 for (
int i=n_s;
i--; )
98 x[
i]=
x[--n_s];
x[n_s]=
x[--n_x];
102 x[
i]=
x[--n_s];
x[n_s]=
x[--n_x];
c--;
110 if ((
c < 0) || (
c > n_x))
113 for (
int i=n_x; i-- > n_s; )
121 if ((
c < 0) || (
c > n_x))
Relation may hold or not.
static ExecStatus post(Home home, ViewArray< VX > &x, VY y, int c)
Post propagator for .
ExecStatus ES_SUBSUMED(Propagator &p)
const FloatNum max
Largest allowed float value.
RelTest holds(VX x, ConstIntView y)
Test whether x and y are equal.
Baseclass for count propagators (integer)
Propagation has computed fixpoint.
EqInt(Space &home, bool share, EqInt &p)
Constructor for cloning p.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
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)
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Execution has resulted in failure.
Propagator for counting views (equal integer to number of equal views)
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Node * x
Pointer to corresponding Boolean expression node.
int size(void) const
Return size of array (number of elements)
Gecode toplevel namespace
ExecStatus post_false(Home home, VX x, ConstIntView y)
int ModEventDelta
Modification event deltas.
Home class for posting propagators
#define GECODE_NEVER
Assert that this command is never executed.
ExecStatus post_true(Home home, VX x, ConstIntView y)