Go to the documentation of this file.
43 namespace Gecode {
namespace Int {
namespace GCC {
74 return new (home)
Val<Card>(home,share,*
this);
107 for (
int i = k.
size();
i--; ) {
108 removed += k[
i].counter();
109 sum_min += k[
i].min();
115 for (
int i = k.
size();
i--; )
121 for (
int i =
x.size();
i--; )
133 for (
int i = k.
size();
i--; )
147 for (
int i = k.
size();
i--; ) {
164 if ((req == non) && (n_r == 1)) {
166 for (
int i =
x.size();
i--; ) {
170 assert((single >= 0) && (single < k.
size()));
174 assert((single >= 0) && (single < k.
size()));
176 for (
int i = k.
size();
i--; )
184 for (
int i = k.
size();
i--; ) {
188 rem.
set(
static_cast<unsigned int>(
i));
198 if (Card::propagate) {
200 int occupied = t_noa -
ci;
211 for (
int i = n_x;
i--; ) {
217 if (rem.
get(
static_cast<unsigned int>(idx)))
227 int* pr =
r.alloc<
int>(k.
size());
231 pr[n_pr++] = k[
i.val()].card();
233 for (
int i =
x.size();
i--;) {
240 bool all_assigned =
true;
242 for (
int i =
x.size();
i--; ) {
250 all_assigned =
false;
255 for (
int i = k.
size();
i--; )
261 if (Card::propagate) {
265 for (
int i = k.
size();
i--; ) {
266 if (k[
i].counter() > k[
i].
max()) {
269 allmax += k[
i].max() - k[
i].counter();
270 if (k[
i].counter() < k[
i].
min())
271 reqmin += k[
i].min() - k[
i].counter();
275 if ((
x.size() < reqmin) || (allmax <
x.size())) {
286 return prop_val<Card>(home, *
this,
x, k);
295 if (isDistinct<Card>(home,
x,k))
ViewArray< IntView > x
Views on which to perform value-propagation.
Post propagator for SetVar x
void set(unsigned int i)
Set bit i.
Value iterator for values in a bitset.
virtual size_t dispose(Space &home)
Destructor.
void update(Space &, bool share, ViewArray< View > &a)
Update array to be a clone of array a.
Value consistent global cardinality propagator.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to variable.
ExecStatus prop_val(Space &home, Propagator &p, ViewArray< IntView > &x, ViewArray< Card > &k)
ExecStatus ES_SUBSUMED(Propagator &p)
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost funtion returning high linear.
bool assigned(View x, int v)
Whether x is assigned to value v.
Value iterator for array of integers
Gecode::IntArgs i(4, 1, 2, 3, 4)
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
Base-class for both propagators and branchers.
bool lookupValue(T &a, int v, int &i)
Return index of v in array a.
Val(Home home, ViewArray< IntView > &x, ViewArray< Card > &k)
Constructor for posting.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
void quicksort(Type *l, Type *r, Less &less)
Standard quick sort.
Gecode toplevel namespace
Base-class for propagators.
static ExecStatus post(Home home, ViewArray< IntView > &x, ViewArray< Card > &k)
Post propagator for views x and cardinalities k.
const unsigned int card
Maximum cardinality of an integer set.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Home class for posting propagators
Post propagator for SetVar SetOpType SetVar SetRelType r
virtual void reschedule(Space &home)
Schedule function.
bool get(unsigned int i) const
Access value at bit i.
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntPropLevel)
Post propagator for .
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value)
static ExecStatus post(Home home, ViewArray< View > &x)
Post propagator for view array x.
int size(void) const
Return size of array (number of elements)
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
virtual size_t dispose(Space &home)
Delete actor and return its size.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
ViewArray< Card > k
Array containing either fixed cardinalities or CardViews.
@ ES_FAILED
Execution has resulted in failure.
int ModEventDelta
Modification event deltas.
@ ES_NOFIX
Propagation has not computed fixpoint.
@ ES_OK
Execution is okay.
int p
Number of positive literals for node type.