Generated on Wed Jan 4 17:49:09 2006 for Gecode by doxygen 1.4.6

distinct.hh

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Christian Schulte <schulte@gecode.org>
00004  *     Guido Tack <tack@gecode.org>
00005  *
00006  *  Contributing authors:
00007  *     Gabor Szokoli <szokoli@gecode.org>
00008  *
00009  *  Copyright:
00010  *     Christian Schulte, 2002
00011  *     Guido Tack, 2004
00012  *     Gabor Szokoli, 2003
00013  *
00014  *  Last modified:
00015  *     $Date: 2005-08-09 17:26:38 +0200 (Tue, 09 Aug 2005) $ by $Author: schulte $
00016  *     $Revision: 2190 $
00017  *
00018  *  This file is part of Gecode, the generic constraint
00019  *  development environment:
00020  *     http://www.gecode.org
00021  *
00022  *  See the file "LICENSE" for information on usage and
00023  *  redistribution of this file, and for a
00024  *     DISCLAIMER OF ALL WARRANTIES.
00025  *
00026  */
00027 
00028 #ifndef __GECODE_INT_DISTINCT_HH__
00029 #define __GECODE_INT_DISTINCT_HH__
00030 
00031 #include "int.hh"
00032 
00033 #include "int/rel.hh"
00034 
00040 namespace Gecode { namespace Int { namespace Distinct {
00041 
00050   template <class View>
00051   class Val : public NaryPropagator<View,PC_INT_VAL> {
00052   protected:
00053     using NaryPropagator<View,PC_INT_VAL>::x;
00054 
00056     Val(Space* home, ViewArray<View>& x);
00058     Val(Space* home, bool share, Val<View>& p);
00059   public:
00061     virtual Actor*     copy(Space* home, bool share);
00063     virtual ExecStatus propagate(Space* home);
00065     static  ExecStatus post(Space* home, ViewArray<View>& y);
00066   };
00067 
00082   template <class View, bool complete>
00083   ExecStatus prop_val(Space* home, ViewArray<View>&);
00084 
00085 
00086 
00115   template <class View>
00116   class Bnd {
00117   public:
00119     static ExecStatus post(Space* home, ViewArray<View>& x);
00120   };
00121 
00128   template <class View, bool shared>
00129   class BndImp : public Propagator {
00130     friend class Bnd<View>;
00131   protected:
00133     ViewArray<View> x; 
00135     ViewArray<View> y;
00137     BndImp(Space* home, ViewArray<View>& x);
00139     BndImp(Space* home, bool share, BndImp<View,shared>& p);
00140   public:
00142     virtual ExecStatus propagate(Space* home);
00149     virtual PropCost cost(void) const;
00151     virtual Actor* copy(Space* home, bool share);
00153     virtual ~BndImp(void);
00154   };
00155 
00167   template <class View, bool shared>
00168   ExecStatus prop_bnd(Space* home, ViewArray<View>& x);
00169 
00170 
00171 
00187   template <class View>
00188   class Dom : public NaryPropagator<View,PC_INT_DOM> {
00189   protected:
00190     using NaryPropagator<View,PC_INT_DOM>::x;
00191 
00193     class ViewValGraph;
00195     ViewValGraph* vvg;
00197     Dom(Space* home, bool share, Dom<View>& p);
00199     Dom(Space* home, ViewArray<View>& x);
00200   public:
00202     virtual ExecStatus propagate(Space* home);
00209     virtual PropCost cost(void) const;
00211     virtual Actor* copy(Space* home, bool share);
00213     virtual ~Dom(void);
00215     virtual void flush(void);
00217     virtual size_t size(void) const;
00219     static  ExecStatus post(Space* home, ViewArray<View>& x);
00220   };
00221 
00222 }}}
00223 
00224 #include "int/distinct/val.icc"
00225 #include "int/distinct/bnd.icc"
00226 #include "int/distinct/dom.icc"
00227 
00228 #endif
00229 
00230 // STATISTICS: int-prop
00231