distinct.icc
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 namespace Gecode { namespace Set { namespace Distinct {
00023
00024
00025
00026
00027
00028
00029 forceinline
00030 Distinct::Distinct(Space* home, ViewArray<SetView>& x, unsigned int _c)
00031 : NaryPropagator<SetView, PC_SET_ANY>(home,x,true), bin(10), c(_c) {}
00032
00033 forceinline
00034 Distinct::Distinct(Space* home, bool share, Distinct& p)
00035 : NaryPropagator<SetView, PC_SET_ANY>(home,share,p), bin(0), c(p.c) {
00036 bin.update(share, p.bin);
00037 }
00038
00039 forceinline ExecStatus
00040 Distinct::post(Space* home, ViewArray<SetView> x, unsigned int c) {
00041 for (int i=x.size(); i--;) {
00042 GECODE_ES_CHECK(x[i].cardMin(home, c));
00043 GECODE_ES_CHECK(x[i].cardMax(home, c));
00044 }
00045
00046 (void) new (home) Distinct(home,x,c);
00047 return ES_OK;
00048 }
00049
00050 forceinline size_t
00051 Distinct::dispose(Space* home) {
00052 bin.~Binomial();
00053 return sizeof(*this);
00054 }
00055
00056 }}}
00057
00058