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 #ifndef __GECODE_INT_GCC_HH__
00039 #define __GECODE_INT_GCC_HH__
00040
00041 #include "gecode/int.hh"
00042
00043 #include "gecode/int/gcc/gccbndsup.icc"
00044 #include "gecode/int/gcc/graphsup.icc"
00045 #include "gecode/int/gcc/occur.icc"
00046
00055 namespace Gecode { namespace Int { namespace GCC {
00056
00107 template <class View, class Card, bool isView>
00108 class Bnd{
00109 public:
00117 static ExecStatus post(Space* home,
00118 ViewArray<View>& x,
00119 ViewArray<Card>& k);
00120 };
00121
00126 template <class View, class Card, bool isView, bool shared>
00127 class BndImp : public Propagator {
00128 friend class Bnd<View, Card, isView>;
00129 protected:
00131 ViewArray<View> x;
00133 ViewArray<Card> k;
00139 PartialSum<Card>* lps;
00141 PartialSum<Card>* ups;
00148 bool card_fixed;
00154 bool skip_lbc;
00156 BndImp(Space* home, ViewArray<View>&, ViewArray<Card>&, bool, bool);
00158 BndImp(Space* home, bool share, BndImp<View, Card, isView, shared>& p);
00159
00160 public:
00162 virtual size_t dispose(Space* home);
00164 virtual size_t allocated(void) const;
00166 virtual Actor* copy(Space* home, bool share);
00168 virtual Reflection::ActorSpec spec(const Space* home,
00169 Reflection::VarMap& m) const;
00171 static void post(Space* home, Reflection::VarMap& vars,
00172 const Reflection::ActorSpec& spec);
00174 static Support::Symbol ati(void);
00176 virtual PropCost cost(ModEventDelta med) const;
00178 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00179 };
00180
00206 template <class View, class Card, bool isView>
00207 class Dom : public Propagator {
00208 protected:
00210 ViewArray<View> x;
00215 ViewArray<View> y;
00217 ViewArray<Card> k;
00219 VarValGraph<View, Card, isView>* vvg;
00226 bool card_fixed;
00228 Dom(Space* home, bool share, Dom<View, Card, isView>& p);
00230 Dom(Space* home, ViewArray<View>&, ViewArray<Card>&, bool);
00231
00232 public:
00234 virtual size_t dispose(Space* home);
00236 virtual size_t allocated(void) const;
00238 virtual Actor* copy(Space* home, bool share);
00251 virtual PropCost cost(ModEventDelta med) const;
00253 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00255 virtual Reflection::ActorSpec spec(const Space* home,
00256 Reflection::VarMap& m) const;
00258 static void post(Space* home, Reflection::VarMap& vars,
00259 const Reflection::ActorSpec& spec);
00261 static Support::Symbol ati(void);
00268 static ExecStatus post(Space* home,
00269 ViewArray<View>& x, ViewArray<Card>& k);
00270 };
00271
00278 template <class View, class Card, bool isView>
00279 class Val : public Propagator {
00280 protected:
00282 ViewArray<View> x;
00284 ViewArray<Card> k;
00286 Val(Space* home, bool share, Val<View, Card, isView>& p );
00288 Val(Space* home, ViewArray<View>&, ViewArray<Card>&);
00289
00290 public:
00292 virtual size_t dispose(Space* home);
00294 virtual Actor* copy(Space* home, bool share);
00296 virtual PropCost cost(ModEventDelta med) const;
00298 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00300 virtual Reflection::ActorSpec spec(const Space* home,
00301 Reflection::VarMap& m) const;
00303 static void post(Space* home, Reflection::VarMap& vars,
00304 const Reflection::ActorSpec& spec);
00306 static Support::Symbol ati(void);
00313 static ExecStatus post(Space* home,
00314 ViewArray<View>& x, ViewArray<Card>& k);
00315 };
00316
00317 }}}
00318
00319 #include "gecode/int/gcc/ubc.icc"
00320 #include "gecode/int/gcc/lbc.icc"
00321 #include "gecode/int/gcc/val.icc"
00322 #include "gecode/int/gcc/bnd.icc"
00323 #include "gecode/int/gcc/dom.icc"
00324
00325 #endif
00326
00327
00328
00329