3
* Guido Tack <tack@gecode.org>
9
* $Date: 2005-11-24 18:03:01 +0100 (Thu, 24 Nov 2005) $ by $Author: tack $
12
* This file is part of Gecode, the generic constraint
13
* development environment:
14
* http://www.gecode.org
16
* See the file "LICENSE" for information on usage and
17
* redistribution of this file, and for a
18
* DISCLAIMER OF ALL WARRANTIES.
22
namespace Gecode { namespace Set { namespace Distinct {
25
* n-ary distinct with fixed cardinalities propagator
30
Distinct::Distinct(Space* home, ViewArray<SetView>& x, unsigned int _c)
31
: NaryPropagator<SetView, PC_SET_ANY>(home,x), bin(10), c(_c) {}
34
Distinct::Distinct(Space* home, bool share, Distinct& p)
35
: NaryPropagator<SetView, PC_SET_ANY>(home,share,p), bin(0), c(p.c) {
36
bin.update(share, p.bin);
39
forceinline ExecStatus
40
Distinct::post(Space* home, ViewArray<SetView> x, unsigned int c) {
41
for (int i=x.size(); i--;) {
42
GECODE_ES_CHECK(x[i].cardMin(home, c));
43
GECODE_ES_CHECK(x[i].cardMax(home, c));
46
(void) new (home) Distinct(home,x,c);
52
// STATISTICS: set-prop