atmostOne.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 AtmostOne::AtmostOne(Space* home, ViewArray<SetView>& x, unsigned int _c)
00031 : NaryPropagator<SetView, PC_SET_ANY>(home,x), c(_c) {}
00032
00033 forceinline
00034 AtmostOne::AtmostOne(Space* home, bool share, AtmostOne& p)
00035 : NaryPropagator<SetView, PC_SET_ANY>(home,share,p), c(p.c) {}
00036
00037 forceinline ExecStatus
00038 AtmostOne::post(Space* home, ViewArray<SetView> x, unsigned int c) {
00039 for (int i=x.size(); i--;) {
00040 GECODE_ES_CHECK(x[i].cardMin(home, c));
00041 GECODE_ES_CHECK(x[i].cardMax(home, c));
00042 }
00043
00044 (void) new (home) AtmostOne(home,x,c);
00045 return ES_OK;
00046 }
00047
00048 }}}
00049
00050