34 namespace Gecode {
namespace Int {
namespace Count {
36 template<
class VX,
class VY>
39 :
IntBase<VX,VY>(home,x,n_s,y,c) {}
41 template<
class VX,
class VY>
46 for (
int i=n_x;
i--; )
49 x[
i] = x[--n_x];
break;
51 x[
i] = x[--n_x]; c--;
break;
69 template<
class VX,
class VY>
74 template<
class VX,
class VY>
80 template<
class VX,
class VY>
85 for (
int i=
n_s;
i--; )
106 for (
int i=n_x; i-- >
n_s; )
Relation may hold or not.
ViewArray< VX > x
Views still to count.
ExecStatus ES_SUBSUMED(Propagator &p)
int n_s
Views from x[0] ... x[n_s-1] have subscriptions.
RelTest holds(VX x, ConstIntView y)
Test whether x and y are equal.
virtual Actor * copy(Space &home)
Create copy during cloning.
Baseclass for count propagators (integer)
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to variable.
Propagation has computed fixpoint.
static ExecStatus post(Home home, ViewArray< VX > &x, VY y, int c)
Post propagator for .
Base-class for both propagators and branchers.
Propagator for counting views (less or equal integer to number of equal views)
#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.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int c
Number of views which are equal and have been eliminated.
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p with propagation condition pc to all views.
Post propagator for SetVar SetOpType SetVar y
LqInt(Space &home, LqInt &p)
Constructor for cloning p.
Post propagator for SetVar x
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
#define GECODE_NEVER
Assert that this command is never executed.