00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __GECODE_INT_GCC_HH__
00023 #define __GECODE_INT_GCC_HH__
00024
00025 #include "gecode/int.hh"
00026 #include "gecode/support/sort.hh"
00027 #include "gecode/support/static-stack.hh"
00028 #include "gecode/int/gcc/gccbndsup.icc"
00029 #include "gecode/int/gcc/graphsup.icc"
00030 #include "gecode/int/gcc/occur.icc"
00031
00040 namespace Gecode { namespace Int { namespace GCC {
00041
00093 template <class View, class Card, bool isView>
00094 class Bnd{
00095 public:
00103 static ExecStatus post(Space* home,
00104 ViewArray<View>& x,
00105 ViewArray<Card>& k,
00106 bool all);
00107 };
00108
00113 template <class View, class Card, bool isView, bool shared>
00114 class BndImp : public Propagator {
00115 friend class Bnd<View, Card, isView>;
00116 protected:
00118 ViewArray<View> x;
00120 ViewArray<Card> k;
00126 PartialSum<Card>* lps;
00128 PartialSum<Card>* ups;
00135 bool card_fixed;
00140 bool card_all;
00146 bool skip_lbc;
00148 BndImp(Space* home, ViewArray<View>&, ViewArray<Card>&, bool, bool, bool);
00150 BndImp(Space* home, bool share, BndImp<View, Card, isView, shared>& p);
00151
00152 public:
00154 virtual size_t dispose(Space* home);
00156 virtual void flush(void);
00158 virtual Actor* copy(Space* home, bool share);
00160 virtual PropCost cost (void) const;
00162 virtual ExecStatus propagate(Space* home);
00163 };
00164
00174 template <class View, class Card, bool isView, bool shared>
00175 ExecStatus prop_bnd(Space* home, ViewArray<View>&, ViewArray<Card>&,
00176 PartialSum<Card>*&, PartialSum<Card>*&,
00177 bool, bool, bool);
00178
00205 template <class View, class Card, bool isView>
00206 class Dom : public Propagator {
00207 protected:
00209 ViewArray<View> x;
00214 ViewArray<View> y;
00216 ViewArray<Card> k;
00218 VarValGraph<View, Card, isView>* vvg;
00225 bool card_fixed;
00230 bool card_all;
00232 Dom(Space* home, bool share, Dom<View, Card, isView>& p);
00234 Dom(Space* home, ViewArray<View>&, ViewArray<Card>&, bool, bool);
00235
00236 public:
00238 virtual size_t dispose(Space* home);
00240 virtual void flush(void);
00242 virtual Actor* copy(Space* home, bool share);
00255 virtual PropCost cost (void) const;
00257 virtual ExecStatus propagate(Space* home);
00264 static ExecStatus post(Space* home,
00265 ViewArray<View>& x, ViewArray<Card>& k,
00266 bool all);
00267 };
00268
00277 template <class View, class Card, bool isView>
00278 class Val : public Propagator {
00279 protected:
00281 ViewArray<View> x;
00283 ViewArray<Card> k;
00288 bool card_all;
00290 Val(Space* home, bool share, Val<View, Card, isView>& p );
00292 Val(Space* home, ViewArray<View>&, ViewArray<Card>&, bool);
00293
00294 public:
00296 virtual size_t dispose(Space* home);
00298 virtual Actor* copy(Space* home, bool share);
00300 virtual PropCost cost (void) const;
00302 virtual ExecStatus propagate(Space* home);
00309 static ExecStatus post(Space* home,
00310 ViewArray<View>& x, ViewArray<Card>& k,
00311 bool all);
00312 };
00313
00322 template <class View, class Card, bool isView>
00323 ExecStatus prop_val(Space* home, ViewArray<View>&, ViewArray<Card>&,
00324 bool&);
00325
00326 }}}
00327
00328 #include "gecode/int/gcc/ubc.icc"
00329 #include "gecode/int/gcc/lbc.icc"
00330 #include "gecode/int/gcc/val.icc"
00331 #include "gecode/int/gcc/bnd.icc"
00332 #include "gecode/int/gcc/dom.icc"
00333
00334 #endif
00335
00336
00337
00338