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_RELOP_HH__
00045 #define __GECODE_SET_RELOP_HH__
00046
00047 #include <gecode/set.hh>
00048 #include <gecode/set/rel.hh>
00049
00050 namespace Gecode { namespace Set { namespace RelOp {
00051
00064 template<class View0, class View1, class View2>
00065 class SuperOfInter :
00066 public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00067 View2,PC_SET_CLUB> {
00068 protected:
00069 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00070 View2,PC_SET_CLUB>::x0;
00071 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00072 View2,PC_SET_CLUB>::x1;
00073 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00074 View2,PC_SET_CLUB>::x2;
00076 SuperOfInter(Space& home, bool share,SuperOfInter& p);
00078 SuperOfInter(Home home,View0, View1, View2);
00079 public:
00081 virtual Actor* copy(Space& home,bool);
00083 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00085 static ExecStatus post(Home home, View0 x, View1 y, View2 z);
00086 };
00087
00094 template<class View0, class View1, class View2>
00095 class SubOfUnion :
00096 public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00097 View2,PC_SET_ANY> {
00098 protected:
00099 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00100 View2,PC_SET_ANY>::x0;
00101 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00102 View2,PC_SET_ANY>::x1;
00103 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00104 View2,PC_SET_ANY>::x2;
00106 SubOfUnion(Space& home, bool share,SubOfUnion& p);
00108 SubOfUnion(Home home,View0, View1, View2);
00109 public:
00111 virtual Actor* copy(Space& home,bool);
00113 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00115 static ExecStatus post(Home home,View0 x,View1 y,View2 z);
00116 };
00117
00118
00125 template<class View0, class View1, class View2>
00126 class Intersection:
00127 public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00128 View2,PC_SET_ANY> {
00129 protected:
00130 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00131 View2,PC_SET_ANY>::x0;
00132 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00133 View2,PC_SET_ANY>::x1;
00134 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00135 View2,PC_SET_ANY>::x2;
00137 Intersection(Space& home, bool share,Intersection& p);
00139 Intersection(Home home,View0,View1,View2);
00140 public:
00142 virtual Actor* copy(Space& home,bool);
00144 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00146 static ExecStatus post(Home home,View0 x,View1 y,View2 z);
00147 };
00148
00155 template<class View0, class View1, class View2>
00156 class Union:
00157 public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00158 View2,PC_SET_ANY> {
00159 protected:
00160 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00161 View2,PC_SET_ANY>::x0;
00162 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00163 View2,PC_SET_ANY>::x1;
00164 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00165 View2,PC_SET_ANY>::x2;
00167 Union(Space& home, bool share,Union& p);
00169 Union(Home home,View0,View1,View2);
00170 public:
00172 virtual Actor* copy(Space& home,bool);
00174 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00176 static ExecStatus post(Home home,View0 x,View1 y,View2 z);
00177 };
00178
00185 template<class View0, class View1>
00186 class IntersectionN :
00187 public MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY> {
00188 protected:
00189 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
00190 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
00192 bool shared;
00194 LUBndSet intOfDets;
00196 IntersectionN(Space& home, bool share,IntersectionN& p);
00198 IntersectionN(Home home,ViewArray<View0>&, View1);
00200 IntersectionN(Home home,ViewArray<View0>&, const IntSet&, View1);
00201 public:
00202 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00204 virtual Actor* copy(Space& home,bool);
00206 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00208 static ExecStatus post(Home home,ViewArray<View0>& y,View1 x);
00210 static ExecStatus post(Home home,ViewArray<View0>& y,
00211 const IntSet& z,View1 x);
00212 };
00213
00220 template<class View0, class View1>
00221 class UnionN : public MixNaryOnePropagator<View0,PC_SET_ANY,
00222 View1,PC_SET_ANY> {
00223 protected:
00224 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
00225 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
00227 bool shared;
00229 GLBndSet unionOfDets;
00231 UnionN(Space& home, bool share,UnionN& p);
00233 UnionN(Home home,ViewArray<View0>&,View1);
00235 UnionN(Home home,ViewArray<View0>&,const IntSet&,View1);
00236 public:
00238 virtual Actor* copy(Space& home, bool);
00240 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00241 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00243 static ExecStatus post(Home home,ViewArray<View0>& y,View1 x);
00245 static ExecStatus post(Home home,ViewArray<View0>& y,
00246 const IntSet& z,View1 x);
00247 };
00248
00249
00256 template<class View0, class View1>
00257 class PartitionN : public MixNaryOnePropagator<View0,PC_SET_ANY,
00258 View1,PC_SET_ANY> {
00259 protected:
00260 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
00261 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
00263 bool shared;
00265 GLBndSet unionOfDets;
00267 PartitionN(Space& home, bool share,PartitionN& p);
00269 PartitionN(Home home,ViewArray<View0>&, View1);
00271 PartitionN(Home home,ViewArray<View0>&, const IntSet&, View1);
00272 public:
00274 virtual Actor* copy(Space& home,bool);
00276 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00277 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00279 static ExecStatus post(Home home,ViewArray<View0>& y,View1 x);
00281 static ExecStatus post(Home home,ViewArray<View0>& y,
00282 const IntSet& z,View1 x);
00283 };
00284
00285 }}}
00286
00287 #include <gecode/set/rel-op/common.hpp>
00288 #include <gecode/set/rel-op/superofinter.hpp>
00289 #include <gecode/set/rel-op/subofunion.hpp>
00290 #include <gecode/set/rel-op/inter.hpp>
00291 #include <gecode/set/rel-op/union.hpp>
00292 #include <gecode/set/rel-op/partition.hpp>
00293 #include <gecode/set/rel-op/post.hpp>
00294
00295 #endif
00296
00297