Generated on Wed Nov 1 15:04:33 2006 for Gecode by doxygen 1.4.5

distinct.cc

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Guido Tack <tack@gecode.org>
00004  *
00005  *  Copyright:
00006  *     Guido Tack, 2004
00007  *
00008  *  Last modified:
00009  *     $Date: 2006-04-11 15:58:37 +0200 (Tue, 11 Apr 2006) $ by $Author: tack $
00010  *     $Revision: 3188 $
00011  *
00012  *  This file is part of Gecode, the generic constraint
00013  *  development environment:
00014  *     http://www.gecode.org
00015  *
00016  *  See the file "LICENSE" for information on usage and
00017  *  redistribution of this file, and for a
00018  *     DISCLAIMER OF ALL WARRANTIES.
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 // STATISTICS: set-post