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
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #ifndef __GECODE_SET_REL_HH__
00045 #define __GECODE_SET_REL_HH__
00046
00047 #include <gecode/set.hh>
00048
00049 namespace Gecode { namespace Set { namespace Rel {
00050
00063 template<class View0, class View1>
00064 class Subset :
00065 public MixBinaryPropagator<View0,PC_SET_CGLB,View1,PC_SET_CLUB> {
00066 protected:
00067 using MixBinaryPropagator<View0,PC_SET_CGLB,View1,PC_SET_CLUB>::x0;
00068 using MixBinaryPropagator<View0,PC_SET_CGLB,View1,PC_SET_CLUB>::x1;
00070 Subset(Space& home, bool share,Subset& p);
00072 Subset(Home home,View0, View1);
00073 public:
00075 virtual Actor* copy(Space& home,bool);
00077 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00079 static ExecStatus post(Home home,View0 x,View1 y);
00080 };
00081
00089 template<class View0, class View1>
00090 class NoSubset :
00091 public MixBinaryPropagator<View0,PC_SET_CLUB,View1,PC_SET_CGLB> {
00092 protected:
00093 using MixBinaryPropagator<View0,PC_SET_CLUB,View1,PC_SET_CGLB>::x0;
00094 using MixBinaryPropagator<View0,PC_SET_CLUB,View1,PC_SET_CGLB>::x1;
00096 NoSubset(Space& home, bool share,NoSubset& p);
00098 NoSubset(Home home,View0,View1);
00099 public:
00101 virtual Actor* copy(Space& home,bool);
00103 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00105 static ExecStatus post(Home home,View0 x,View1 y);
00106 };
00107
00114 template<class View0, class View1>
00115 class ReSubset : public Propagator {
00116 protected:
00117 View0 x0;
00118 View1 x1;
00119 Gecode::Int::BoolView b;
00120
00122 ReSubset(Space& home, bool share,ReSubset&);
00124 ReSubset(Home home,View0, View1, Gecode::Int::BoolView);
00125 public:
00127 virtual Actor* copy(Space& home,bool);
00129 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00131 virtual size_t dispose(Space& home);
00133 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00135 static ExecStatus post(Home home,View0 x, View1 y,
00136 Gecode::Int::BoolView b);
00137 };
00138
00146 template<class View0, class View1>
00147 class Eq : public MixBinaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY> {
00148 protected:
00149 using MixBinaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x0;
00150 using MixBinaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x1;
00152 Eq(Space& home, bool share,Eq& p);
00154 Eq(Home home,View0, View1);
00155 public:
00157 virtual Actor* copy(Space& home,bool);
00159 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00161 static ExecStatus post(Home home,View0,View1);
00162 };
00163
00170 template<class View0, class View1>
00171 class ReEq : public Propagator {
00172 protected:
00173 View0 x0;
00174 View1 x1;
00175 Gecode::Int::BoolView b;
00176
00178 ReEq(Space& home, bool share,ReEq&);
00180 ReEq(Home home,View0, View1, Gecode::Int::BoolView);
00181 public:
00183 virtual Actor* copy(Space& home,bool);
00185 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00187 virtual size_t dispose(Space& home);
00189 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00191 static ExecStatus post(Home home,View0 x, View1 y,
00192 Gecode::Int::BoolView b);
00193 };
00194
00202 template<class View0, class View1>
00203 class Distinct :
00204 public MixBinaryPropagator<View0,PC_SET_VAL,View1,PC_SET_VAL> {
00205 protected:
00206 using MixBinaryPropagator<View0,PC_SET_VAL,View1,PC_SET_VAL>::x0;
00207 using MixBinaryPropagator<View0,PC_SET_VAL,View1,PC_SET_VAL>::x1;
00209 Distinct(Space& home, bool share,Distinct& p);
00211 Distinct(Home home,View0,View1);
00212 public:
00214 virtual Actor* copy(Space& home,bool);
00216 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00218 static ExecStatus post(Home home,View0,View1);
00219 };
00220
00231 template<class View0>
00232 class DistinctDoit : public UnaryPropagator<View0,PC_SET_ANY> {
00233 protected:
00234 using UnaryPropagator<View0,PC_SET_ANY>::x0;
00236 ConstSetView y;
00238 DistinctDoit(Space& home, bool share,DistinctDoit&);
00240 DistinctDoit(Home home, View0, ConstSetView);
00241 public:
00243 virtual Actor* copy(Space& home, bool);
00245 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00247 static ExecStatus post(Home home, View0, ConstSetView);
00248 };
00249
00250 }}}
00251
00252 #include <gecode/set/rel/common.hpp>
00253 #include <gecode/set/rel/subset.hpp>
00254 #include <gecode/set/rel/nosubset.hpp>
00255 #include <gecode/set/rel/re-subset.hpp>
00256 #include <gecode/set/rel/eq.hpp>
00257 #include <gecode/set/rel/re-eq.hpp>
00258 #include <gecode/set/rel/nq.hpp>
00259
00260 #endif
00261
00262