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.hpp>
00044 #include <gecode/int/gcc/graphsup.hpp>
00045 #include <gecode/int/gcc/occur.hpp>
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 PropCost cost(const Space& home, const ModEventDelta& med) const;
00170 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00171 };
00172
00198 template <class View, class Card, bool isView>
00199 class Dom : public Propagator {
00200 protected:
00202 ViewArray<View> x;
00207 ViewArray<View> y;
00209 ViewArray<Card> k;
00211 VarValGraph<View, Card, isView>* vvg;
00218 bool card_fixed;
00220 Dom(Space& home, bool share, Dom<View, Card, isView>& p);
00222 Dom(Space& home, ViewArray<View>&, ViewArray<Card>&, bool);
00223
00224 public:
00226 virtual size_t dispose(Space& home);
00228 virtual size_t allocated(void) const;
00230 virtual Actor* copy(Space& home, bool share);
00243 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00245 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00252 static ExecStatus post(Space& home,
00253 ViewArray<View>& x, ViewArray<Card>& k);
00254 };
00255
00262 template <class View, class Card, bool isView>
00263 class Val : public Propagator {
00264 protected:
00266 ViewArray<View> x;
00268 ViewArray<Card> k;
00270 Val(Space& home, bool share, Val<View, Card, isView>& p );
00272 Val(Space& home, ViewArray<View>&, ViewArray<Card>&);
00273
00274 public:
00276 virtual size_t dispose(Space& home);
00278 virtual Actor* copy(Space& home, bool share);
00280 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00282 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00289 static ExecStatus post(Space& home,
00290 ViewArray<View>& x, ViewArray<Card>& k);
00291 };
00292
00293 }}}
00294
00295 #include <gecode/int/gcc/ubc.hpp>
00296 #include <gecode/int/gcc/lbc.hpp>
00297 #include <gecode/int/gcc/val.hpp>
00298 #include <gecode/int/gcc/bnd.hpp>
00299 #include <gecode/int/gcc/dom.hpp>
00300
00301 #endif
00302
00303
00304
00305