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_SELECT_HH__
00041 #define __GECODE_SET_SELECT_HH__
00042
00043 #include "gecode/set.hh"
00044
00045 #include "gecode/set/element/idxarray.hh"
00046 #include "gecode/set/rel.hh"
00047 #include "gecode/set/rel-op.hh"
00048
00049 namespace Gecode { namespace Set { namespace Element {
00050
00062 template <class SView, class RView>
00063 class ElementIntersection :
00064 public Propagator {
00065 protected:
00066 IntSet universe;
00067 SView x0;
00068 IdxViewArray<SView> iv;
00069 RView x1;
00070
00072 ElementIntersection(Space* home, bool share,ElementIntersection& p);
00074 ElementIntersection(Space* home,SView,IdxViewArray<SView>&,RView,
00075 const IntSet& universe);
00076 public:
00078 virtual Actor* copy(Space* home,bool);
00079 virtual PropCost cost(ModEventDelta med) const;
00081 virtual size_t dispose(Space* home);
00083 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00085 virtual Reflection::ActorSpec spec(const Space* home,
00086 Reflection::VarMap& m) const;
00088 static void post(Space* home, Reflection::VarMap& vars,
00089 const Reflection::ActorSpec& spec);
00091 static Support::Symbol ati(void);
00097 static ExecStatus post(Space* home,SView z,IdxViewArray<SView>& x,
00098 RView y, const IntSet& u);
00099 };
00100
00107 template <class SView, class RView>
00108 class ElementUnion :
00109 public Propagator {
00110 protected:
00111 SView x0;
00112 IdxViewArray<SView> iv;
00113 RView x1;
00114
00116 ElementUnion(Space* home, bool share,ElementUnion& p);
00118 ElementUnion(Space* home,SView,IdxViewArray<SView>&,RView);
00119 public:
00121 virtual Actor* copy(Space* home,bool);
00122 virtual PropCost cost(ModEventDelta med) const;
00124 virtual size_t dispose(Space* home);
00126 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00128 virtual Reflection::ActorSpec spec(const Space* home,
00129 Reflection::VarMap& m) const;
00131 static void post(Space* home, Reflection::VarMap& vars,
00132 const Reflection::ActorSpec& spec);
00134 static Support::Symbol ati(void);
00140 static ExecStatus post(Space* home,SView z,IdxViewArray<SView>& x,
00141 RView y);
00142 };
00143
00150 template <class SView, class RView>
00151 class ElementUnionConst :
00152 public Propagator {
00153 protected:
00154 SView x0;
00155 SharedArray<IntSet> iv;
00156 RView x1;
00157
00159 ElementUnionConst(Space* home, bool share,ElementUnionConst& p);
00161 ElementUnionConst(Space* home,SView,SharedArray<IntSet>&,RView);
00162 public:
00164 virtual Actor* copy(Space* home,bool);
00165 virtual PropCost cost(ModEventDelta med) const;
00167 virtual size_t dispose(Space* home);
00169 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00171 virtual Reflection::ActorSpec spec(const Space* home,
00172 Reflection::VarMap& m) const;
00174 static void post(Space* home, Reflection::VarMap& vars,
00175 const Reflection::ActorSpec& spec);
00177 static Support::Symbol ati(void);
00183 static ExecStatus post(Space* home,SView z,SharedArray<IntSet>& x,
00184 RView y);
00185 };
00186
00193 class ElementDisjoint :
00194 public Propagator {
00195 protected:
00196 IdxViewArray<SetView> iv;
00197 SetView x1;
00198
00200 ElementDisjoint(Space* home, bool share,ElementDisjoint& p);
00202 ElementDisjoint(Space* home,IdxViewArray<SetView>&,SetView);
00203 public:
00205 GECODE_SET_EXPORT virtual Actor* copy(Space* home,bool);
00206 GECODE_SET_EXPORT virtual PropCost cost(ModEventDelta med) const;
00208 GECODE_SET_EXPORT virtual size_t dispose(Space* home);
00210 GECODE_SET_EXPORT virtual ExecStatus propagate(Space* home, ModEventDelta med);
00212 virtual Reflection::ActorSpec spec(const Space* home,
00213 Reflection::VarMap& m) const;
00215 static void post(Space* home, Reflection::VarMap& vars,
00216 const Reflection::ActorSpec& spec);
00218 static Support::Symbol ati(void);
00220 static ExecStatus post(Space* home,IdxViewArray<SetView>& x,SetView y);
00221 };
00222
00223 }}}
00224
00225 #include "gecode/set/element/inter.icc"
00226 #include "gecode/set/element/union.icc"
00227 #include "gecode/set/element/unionConst.icc"
00228 #include "gecode/set/element/disjoint.icc"
00229
00230 #endif
00231
00232
00233