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;
71 template<
class VX,
class VY>
76 template<
class VX,
class VY>
82 template<
class VX,
class VY>
87 for (
int i=
n_s;
i--; )
108 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.
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.
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({1, 2, 3, 4})
Execution has resulted in failure.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
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.
Propagator for counting views (greater or equal integer to number of equal views) ...
Post propagator for SetVar SetOpType SetVar y
GqInt(Space &home, GqInt &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Post propagator for SetVar x
Gecode toplevel namespace
static ExecStatus post(Home home, ViewArray< VX > &x, VY y, int c)
Post propagator for .
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.
ExecStatus post_true(Home home, VX x, ConstIntView y)