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_RELOP_HH__
00029 #define __GECODE_SET_RELOP_HH__
00030
00031 #include "gecode/set.hh"
00032 #include "gecode/iter.hh"
00033 #include "gecode/set/rel.hh"
00034
00035 namespace Gecode { namespace Set { namespace RelOp {
00036
00049 template <class View0, class View1, class View2>
00050 class SuperOfInter :
00051 public InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00052 View2,PC_SET_CLUB> {
00053 protected:
00054 using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00055 View2,PC_SET_CLUB>::x0;
00056 using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00057 View2,PC_SET_CLUB>::x1;
00058 using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00059 View2,PC_SET_CLUB>::x2;
00061 SuperOfInter(Space* home, bool share,SuperOfInter& p);
00063 SuperOfInter(Space* home,View0, View1, View2);
00064 public:
00066 virtual Actor* copy(Space* home,bool);
00068 virtual ExecStatus propagate(Space* home);
00070 static ExecStatus post(Space* home, View0 x, View1 y, View2 z);
00071 };
00072
00079 template <class View0, class View1, class View2>
00080 class SubOfUnion :
00081 public InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00082 View2,PC_SET_ANY> {
00083 protected:
00084 using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00085 View2,PC_SET_ANY>::x0;
00086 using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00087 View2,PC_SET_ANY>::x1;
00088 using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00089 View2,PC_SET_ANY>::x2;
00091 SubOfUnion(Space* home, bool share,SubOfUnion& p);
00093 SubOfUnion(Space* home,View0, View1, View2);
00094 public:
00096 virtual Actor* copy(Space* home,bool);
00098 virtual ExecStatus propagate(Space* home);
00100 static ExecStatus post(Space* home,View0 x,View1 y,View2 z);
00101 };
00102
00103
00110 template <class View0, class View1, class View2>
00111 class Intersection:
00112 public InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00113 View2,PC_SET_ANY> {
00114 protected:
00115 using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00116 View2,PC_SET_ANY>::x0;
00117 using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00118 View2,PC_SET_ANY>::x1;
00119 using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00120 View2,PC_SET_ANY>::x2;
00122 Intersection(Space* home, bool share,Intersection& p);
00124 Intersection(Space* home,View0,View1,View2);
00125 public:
00127 virtual Actor* copy(Space* home,bool);
00129 virtual ExecStatus propagate(Space* home);
00131 static ExecStatus post(Space* home,View0 x,View1 y,View2 z);
00132 };
00133
00140 template <class View0, class View1, class View2>
00141 class Union:
00142 public InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00143 View2,PC_SET_ANY> {
00144 protected:
00145 using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00146 View2,PC_SET_ANY>::x0;
00147 using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00148 View2,PC_SET_ANY>::x1;
00149 using InhomTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00150 View2,PC_SET_ANY>::x2;
00152 Union(Space* home, bool share,Union& p);
00154 Union(Space* home,View0,View1,View2);
00155 public:
00157 virtual Actor* copy(Space* home,bool);
00159 virtual ExecStatus propagate(Space* home);
00161 static ExecStatus post(Space* home,View0 x,View1 y,View2 z);
00162 };
00163
00170 template <class View0, class View1>
00171 class IntersectionN : public InhomNaryOnePropagator<View0,PC_SET_ANY,
00172 View1,PC_SET_ANY> {
00173 protected:
00174 using InhomNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
00175 using InhomNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
00177 bool shared;
00179 LUBndSet intOfDets;
00181 IntersectionN(Space* home, bool share,IntersectionN& p);
00183 IntersectionN(Space* home,ViewArray<View0>&, View1);
00184 public:
00185 virtual PropCost cost(void) const;
00187 virtual Actor* copy(Space* home,bool);
00189 virtual ExecStatus propagate(Space* home);
00191 static ExecStatus post(Space* home,ViewArray<View0>& y,View1 x);
00192 };
00193
00200 template <class View0, class View1>
00201 class UnionN : public InhomNaryOnePropagator<View0,PC_SET_ANY,
00202 View1,PC_SET_ANY> {
00203 protected:
00204 using InhomNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
00205 using InhomNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
00207 bool shared;
00209 GLBndSet unionOfDets;
00211 UnionN(Space* home, bool share,UnionN& p);
00213 UnionN(Space* home,ViewArray<View0>&,View1);
00214 public:
00216 virtual Actor* copy(Space* home, bool);
00218 virtual ExecStatus propagate(Space* home);
00219 virtual PropCost cost(void) const;
00221 static ExecStatus post(Space* home,ViewArray<View0>& y,View1 x);
00222 };
00223
00224
00231 template <class View0, class View1>
00232 class PartitionN : public InhomNaryOnePropagator<View0,PC_SET_ANY,
00233 View1,PC_SET_ANY> {
00234 protected:
00235 using InhomNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
00236 using InhomNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
00238 bool shared;
00240 GLBndSet unionOfDets;
00242 PartitionN(Space* home, bool share,PartitionN& p);
00244 PartitionN(Space* home,ViewArray<View0>&, View1);
00245 public:
00247 virtual Actor* copy(Space* home,bool);
00249 virtual ExecStatus propagate(Space* home);
00250 virtual PropCost cost(void) const;
00252 static ExecStatus post(Space* home,ViewArray<View0>& y,View1 x);
00253 };
00254
00255 }}}
00256
00257 #include "gecode/set/rel-op/common.icc"
00258 #include "gecode/set/rel-op/superofinter.icc"
00259 #include "gecode/set/rel-op/subofunion.icc"
00260 #include "gecode/set/rel-op/inter.icc"
00261 #include "gecode/set/rel-op/union.icc"
00262 #include "gecode/set/rel-op/partition.icc"
00263 #include "gecode/set/rel-op/post.icc"
00264
00265 #endif
00266
00267