distinct.hh
Go to the documentation of this file.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_INT_DISTINCT_HH__
00029 #define __GECODE_INT_DISTINCT_HH__
00030
00031 #include "int.hh"
00032
00033 #include "int/rel.hh"
00034
00040 namespace Gecode { namespace Int { namespace Distinct {
00041
00050 template <class View>
00051 class Val : public NaryPropagator<View,PC_INT_VAL> {
00052 protected:
00053 using NaryPropagator<View,PC_INT_VAL>::x;
00054
00056 Val(Space* home, ViewArray<View>& x);
00058 Val(Space* home, bool share, Val<View>& p);
00059 public:
00061 virtual Actor* copy(Space* home, bool share);
00063 virtual ExecStatus propagate(Space* home);
00065 static ExecStatus post(Space* home, ViewArray<View>& y);
00066 };
00067
00082 template <class View, bool complete>
00083 ExecStatus prop_val(Space* home, ViewArray<View>&);
00084
00085
00086
00115 template <class View>
00116 class Bnd {
00117 public:
00119 static ExecStatus post(Space* home, ViewArray<View>& x);
00120 };
00121
00128 template <class View, bool shared>
00129 class BndImp : public Propagator {
00130 friend class Bnd<View>;
00131 protected:
00133 ViewArray<View> x;
00135 ViewArray<View> y;
00137 BndImp(Space* home, ViewArray<View>& x);
00139 BndImp(Space* home, bool share, BndImp<View,shared>& p);
00140 public:
00142 virtual ExecStatus propagate(Space* home);
00149 virtual PropCost cost(void) const;
00151 virtual Actor* copy(Space* home, bool share);
00153 virtual ~BndImp(void);
00154 };
00155
00167 template <class View, bool shared>
00168 ExecStatus prop_bnd(Space* home, ViewArray<View>& x);
00169
00170
00171
00187 template <class View>
00188 class Dom : public NaryPropagator<View,PC_INT_DOM> {
00189 protected:
00190 using NaryPropagator<View,PC_INT_DOM>::x;
00191
00193 class ViewValGraph;
00195 ViewValGraph* vvg;
00197 Dom(Space* home, bool share, Dom<View>& p);
00199 Dom(Space* home, ViewArray<View>& x);
00200 public:
00202 virtual ExecStatus propagate(Space* home);
00209 virtual PropCost cost(void) const;
00211 virtual Actor* copy(Space* home, bool share);
00213 virtual ~Dom(void);
00215 virtual void flush(void);
00217 virtual size_t size(void) const;
00219 static ExecStatus post(Space* home, ViewArray<View>& x);
00220 };
00221
00222 }}}
00223
00224 #include "int/distinct/val.icc"
00225 #include "int/distinct/bnd.icc"
00226 #include "int/distinct/dom.icc"
00227
00228 #endif
00229
00230
00231