distinct.cc
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 #include "gecode/set/distinct.hh"
00023
00024 using namespace Gecode::Set;
00025
00026 namespace Gecode {
00027
00028 void
00029 atmostOne(Space* home, const SetVarArgs& xa, unsigned int c) {
00030 if (home->failed()) return;
00031 if (xa.size() < 2)
00032 return;
00033 ViewArray<SetView> x(home,xa);
00034 GECODE_ES_FAIL(home,Distinct::AtmostOne::post(home, x, c));
00035 }
00036
00037 void
00038 distinct(Space* home, const SetVarArgs& xa, unsigned int c) {
00039 if (home->failed()) return;
00040 if (xa.size() < 2)
00041 return;
00042 ViewArray<SetView> x(home,xa);
00043 GECODE_ES_FAIL(home,Distinct::Distinct::post(home, x, c));
00044 }
00045
00046 }
00047
00048