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 #ifndef __GECODE_SET_RELOP_HH__
00041 #define __GECODE_SET_RELOP_HH__
00042
00043 #include <gecode/set.hh>
00044 #include <gecode/set/rel.hh>
00045
00046 namespace Gecode { namespace Set { namespace RelOp {
00047
00060 template<class View0, class View1, class View2>
00061 class SuperOfInter :
00062 public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00063 View2,PC_SET_CLUB> {
00064 protected:
00065 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00066 View2,PC_SET_CLUB>::x0;
00067 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00068 View2,PC_SET_CLUB>::x1;
00069 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00070 View2,PC_SET_CLUB>::x2;
00072 SuperOfInter(Space& home, SuperOfInter& p);
00074 SuperOfInter(Home home, View0, View1, View2);
00075 public:
00077 virtual Actor* copy(Space& home);
00079 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00081 static ExecStatus post(Home home, View0 x, View1 y, View2 z);
00082 };
00083
00090 template<class View0, class View1, class View2>
00091 class SubOfUnion :
00092 public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00093 View2,PC_SET_ANY> {
00094 protected:
00095 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00096 View2,PC_SET_ANY>::x0;
00097 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00098 View2,PC_SET_ANY>::x1;
00099 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00100 View2,PC_SET_ANY>::x2;
00102 SubOfUnion(Space& home, SubOfUnion& p);
00104 SubOfUnion(Home home, View0, View1, View2);
00105 public:
00107 virtual Actor* copy(Space& home);
00109 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00111 static ExecStatus post(Home home,View0 x,View1 y,View2 z);
00112 };
00113
00114
00121 template<class View0, class View1, class View2>
00122 class Intersection:
00123 public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00124 View2,PC_SET_ANY> {
00125 protected:
00126 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00127 View2,PC_SET_ANY>::x0;
00128 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00129 View2,PC_SET_ANY>::x1;
00130 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00131 View2,PC_SET_ANY>::x2;
00133 Intersection(Space& home, Intersection& p);
00135 Intersection(Home home,View0,View1,View2);
00136 public:
00138 virtual Actor* copy(Space& home);
00140 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00142 static ExecStatus post(Home home,View0 x,View1 y,View2 z);
00143 };
00144
00151 template<class View0, class View1, class View2>
00152 class Union:
00153 public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00154 View2,PC_SET_ANY> {
00155 protected:
00156 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00157 View2,PC_SET_ANY>::x0;
00158 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00159 View2,PC_SET_ANY>::x1;
00160 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00161 View2,PC_SET_ANY>::x2;
00163 Union(Space& home, Union& p);
00165 Union(Home home, View0, View1, View2);
00166 public:
00168 virtual Actor* copy(Space& home);
00170 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00172 static ExecStatus post(Home home,View0 x,View1 y,View2 z);
00173 };
00174
00181 template<class View0, class View1>
00182 class IntersectionN :
00183 public MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY> {
00184 protected:
00185 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
00186 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
00188 bool shared;
00190 LUBndSet intOfDets;
00192 IntersectionN(Space& home, IntersectionN& p);
00194 IntersectionN(Home home, ViewArray<View0>&, View1);
00196 IntersectionN(Home home, ViewArray<View0>&, const IntSet&, View1);
00197 public:
00199 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00201 virtual Actor* copy(Space& home);
00203 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00205 static ExecStatus post(Home home,ViewArray<View0>& y,View1 x);
00207 static ExecStatus post(Home home,ViewArray<View0>& y,
00208 const IntSet& z,View1 x);
00209 };
00210
00217 template<class View0, class View1>
00218 class UnionN : public MixNaryOnePropagator<View0,PC_SET_ANY,
00219 View1,PC_SET_ANY> {
00220 protected:
00221 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
00222 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
00224 bool shared;
00226 GLBndSet unionOfDets;
00228 UnionN(Space& home, UnionN& p);
00230 UnionN(Home home,ViewArray<View0>&,View1);
00232 UnionN(Home home,ViewArray<View0>&,const IntSet&,View1);
00233 public:
00235 virtual Actor* copy(Space& home);
00237 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00239 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00241 static ExecStatus post(Home home,ViewArray<View0>& y,View1 x);
00243 static ExecStatus post(Home home,ViewArray<View0>& y,
00244 const IntSet& z,View1 x);
00245 };
00246
00247
00254 template<class View0, class View1>
00255 class PartitionN : public MixNaryOnePropagator<View0,PC_SET_ANY,
00256 View1,PC_SET_ANY> {
00257 protected:
00258 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
00259 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
00261 bool shared;
00263 GLBndSet unionOfDets;
00265 PartitionN(Space& home, PartitionN& p);
00267 PartitionN(Home home, ViewArray<View0>&, View1);
00269 PartitionN(Home home, ViewArray<View0>&, const IntSet&, View1);
00270 public:
00272 virtual Actor* copy(Space& home);
00274 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00276 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00278 static ExecStatus post(Home home,ViewArray<View0>& y,View1 x);
00280 static ExecStatus post(Home home,ViewArray<View0>& y,
00281 const IntSet& z,View1 x);
00282 };
00283
00284 }}}
00285
00286 #include <gecode/set/rel-op/common.hpp>
00287 #include <gecode/set/rel-op/superofinter.hpp>
00288 #include <gecode/set/rel-op/subofunion.hpp>
00289 #include <gecode/set/rel-op/inter.hpp>
00290 #include <gecode/set/rel-op/union.hpp>
00291 #include <gecode/set/rel-op/partition.hpp>
00292 #include <gecode/set/rel-op/post.hpp>
00293
00294 #endif
00295
00296