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

rel.hh

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Guido Tack <tack@gecode.org>
00004  *     Christian Schulte <schulte@gecode.org>
00005  *
00006  *  Contributing authors:
00007  *     Gabor Szokoli <szokoli@gecode.org>
00008  *
00009  *  Copyright:
00010  *     Guido Tack, 2004
00011  *     Christian Schulte, 2004
00012  *     Gabor Szokoli, 2004
00013  *
00014  *  Last modified:
00015  *     $Date: 2005-11-15 17:40:47 +0100 (Tue, 15 Nov 2005) $ by $Author: tack $
00016  *     $Revision: 2576 $
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_SET_REL_HH__
00029 #define __GECODE_SET_REL_HH__
00030 
00031 #include "set.hh"
00032 #include "iter.hh"
00033 
00034 namespace Gecode { namespace Set { namespace Rel {
00035 
00048   template <class View0, class View1>
00049   class SubSet :
00050     public InhomBinaryPropagator<View0,PC_SET_CGLB,View1,PC_SET_CLUB> {
00051   protected:
00052     using InhomBinaryPropagator<View0,PC_SET_CGLB,View1,PC_SET_CLUB>::x0;
00053     using InhomBinaryPropagator<View0,PC_SET_CGLB,View1,PC_SET_CLUB>::x1;
00055     SubSet(Space* home, bool share,SubSet& p);
00057     SubSet(Space* home,View0, View1);
00058   public:
00060     virtual Actor*      copy(Space* home,bool);
00062     virtual ExecStatus propagate(Space* home);
00064     static  ExecStatus post(Space* home,View0 x,View1 y);
00065   };
00066 
00074   template <class View0, class View1>
00075   class NoSubSet :
00076     public InhomBinaryPropagator<View0,PC_SET_CLUB,View1,PC_SET_CGLB> {
00077   protected:
00078     using InhomBinaryPropagator<View0,PC_SET_CLUB,View1,PC_SET_CGLB>::x0;
00079     using InhomBinaryPropagator<View0,PC_SET_CLUB,View1,PC_SET_CGLB>::x1;
00081     NoSubSet(Space* home, bool share,NoSubSet& p);
00083     NoSubSet(Space* home,View0,View1);
00084   public:
00086     virtual Actor*      copy(Space* home,bool);
00088     virtual ExecStatus propagate(Space* home);
00090     static  ExecStatus post(Space* home,View0 x,View1 y);
00091   };
00092 
00099   template <class View0, class View1>
00100   class ReSubset :
00101     public Propagator {
00102   protected:
00103     View0 x0;
00104     View1 x1;
00105     Gecode::Int::BoolView b;
00106 
00108     ReSubset(Space* home, bool share,ReSubset&);
00110     ReSubset(Space* home,View0, View1, Gecode::Int::BoolView);
00111   public:
00113     virtual Actor*      copy(Space* home,bool);
00114     virtual PropCost cost(void) const;
00115     virtual ~ReSubset(void);
00117     virtual ExecStatus propagate(Space* home);
00119     static ExecStatus post(Space* home,View0 x, View1 y,
00120                            Gecode::Int::BoolView b);
00121   };
00122 
00130   template <class View0, class View1>
00131   class Eq : 
00132     public InhomBinaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY> {
00133   protected:
00134     using InhomBinaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x0;
00135     using InhomBinaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x1;
00137     Eq(Space* home, bool share,Eq& p);
00139     Eq(Space* home,View0, View1);
00140   public:
00142     virtual Actor*      copy(Space* home,bool);
00144     virtual ExecStatus  propagate(Space* home);
00146     static  ExecStatus  post(Space* home,View0,View1);
00147   };
00148 
00155   template <class View0, class View1>
00156   class ReEq :
00157     public Propagator {
00158   protected:
00159     View0 x0;
00160     View1 x1;
00161     Gecode::Int::BoolView b;
00162 
00164     ReEq(Space* home, bool share,ReEq&);
00166     ReEq(Space* home,View0, View1, Gecode::Int::BoolView);
00167   public:
00169     virtual Actor*      copy(Space* home,bool);
00170     virtual PropCost cost(void) const;
00171     virtual ~ReEq(void);
00173     virtual ExecStatus propagate(Space* home);
00175     static ExecStatus post(Space* home,View0 x, View1 y,
00176                            Gecode::Int::BoolView b);
00177   };
00178 
00186   template <class View0, class View1>
00187   class Distinct :
00188     public InhomBinaryPropagator<View0,PC_SET_VAL,View1,PC_SET_VAL> {
00189   protected:
00190     using InhomBinaryPropagator<View0,PC_SET_VAL,View1,PC_SET_VAL>::x0;
00191     using InhomBinaryPropagator<View0,PC_SET_VAL,View1,PC_SET_VAL>::x1;
00193     Distinct(Space* home, bool share,Distinct& p);
00195     Distinct(Space* home,View0,View1);
00196   public:
00198     virtual Actor*      copy(Space* home,bool);
00200     virtual ExecStatus  propagate(Space* home);
00202     static  ExecStatus  post(Space* home,View0,View1);
00203   };
00204 
00215   template <class View0, class View1>
00216   class DistinctDoit : public UnaryPropagator<View0,PC_SET_ANY> {
00217   protected:
00218     using UnaryPropagator<View0,PC_SET_ANY>::x0;
00220     View1 y;
00222     DistinctDoit(Space* home, bool share,DistinctDoit&);
00224     DistinctDoit(Space* home, View0, View1);
00225   public:
00227     virtual Actor*      copy(Space* home, bool);
00229     virtual ExecStatus propagate(Space* home);
00231     static ExecStatus post(Space* home, View0, View1);
00232   };
00233 
00234 }}}
00235 
00236 #include "set/rel/common.icc"
00237 #include "set/rel/subset.icc"
00238 #include "set/rel/nosubset.icc"
00239 #include "set/rel/re-subset.icc"
00240 #include "set/rel/eq.icc"
00241 #include "set/rel/re-eq.icc"
00242 #include "set/rel/nq.icc"
00243 
00244 #endif
00245 
00246 // STATISTICS: set-prop