00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __GECODE_SET_REL_HH__
00029 #define __GECODE_SET_REL_HH__
00030
00031 #include "gecode/set.hh"
00032 #include "gecode/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);
00115 virtual PropCost cost(void) const;
00117 virtual size_t dispose(Space* home);
00119 virtual ExecStatus propagate(Space* home);
00121 static ExecStatus post(Space* home,View0 x, View1 y,
00122 Gecode::Int::BoolView b);
00123 };
00124
00132 template <class View0, class View1>
00133 class Eq :
00134 public InhomBinaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY> {
00135 protected:
00136 using InhomBinaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x0;
00137 using InhomBinaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x1;
00139 Eq(Space* home, bool share,Eq& p);
00141 Eq(Space* home,View0, View1);
00142 public:
00144 virtual Actor* copy(Space* home,bool);
00146 virtual ExecStatus propagate(Space* home);
00148 static ExecStatus post(Space* home,View0,View1);
00149 };
00150
00157 template <class View0, class View1>
00158 class ReEq :
00159 public Propagator {
00160 protected:
00161 View0 x0;
00162 View1 x1;
00163 Gecode::Int::BoolView b;
00164
00166 ReEq(Space* home, bool share,ReEq&);
00168 ReEq(Space* home,View0, View1, Gecode::Int::BoolView);
00169 public:
00171 virtual Actor* copy(Space* home,bool);
00173 virtual PropCost cost(void) const;
00175 virtual size_t dispose(Space* home);
00177 virtual ExecStatus propagate(Space* home);
00179 static ExecStatus post(Space* home,View0 x, View1 y,
00180 Gecode::Int::BoolView b);
00181 };
00182
00190 template <class View0, class View1>
00191 class Distinct :
00192 public InhomBinaryPropagator<View0,PC_SET_VAL,View1,PC_SET_VAL> {
00193 protected:
00194 using InhomBinaryPropagator<View0,PC_SET_VAL,View1,PC_SET_VAL>::x0;
00195 using InhomBinaryPropagator<View0,PC_SET_VAL,View1,PC_SET_VAL>::x1;
00197 Distinct(Space* home, bool share,Distinct& p);
00199 Distinct(Space* home,View0,View1);
00200 public:
00202 virtual Actor* copy(Space* home,bool);
00204 virtual ExecStatus propagate(Space* home);
00206 static ExecStatus post(Space* home,View0,View1);
00207 };
00208
00219 template <class View0, class View1>
00220 class DistinctDoit : public UnaryPropagator<View0,PC_SET_ANY> {
00221 protected:
00222 using UnaryPropagator<View0,PC_SET_ANY>::x0;
00224 View1 y;
00226 DistinctDoit(Space* home, bool share,DistinctDoit&);
00228 DistinctDoit(Space* home, View0, View1);
00229 public:
00231 virtual Actor* copy(Space* home, bool);
00233 virtual ExecStatus propagate(Space* home);
00235 static ExecStatus post(Space* home, View0, View1);
00236 };
00237
00238 }}}
00239
00240 #include "gecode/set/rel/common.icc"
00241 #include "gecode/set/rel/subset.icc"
00242 #include "gecode/set/rel/nosubset.icc"
00243 #include "gecode/set/rel/re-subset.icc"
00244 #include "gecode/set/rel/eq.icc"
00245 #include "gecode/set/rel/re-eq.icc"
00246 #include "gecode/set/rel/nq.icc"
00247
00248 #endif
00249
00250