gcc.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
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #ifndef __GECODE_INT_GCC_HH__
00045 #define __GECODE_INT_GCC_HH__
00046
00047 #include <gecode/int.hh>
00048
00054 #include <gecode/int/gcc/view.hpp>
00055 #include <gecode/int/gcc/bnd-sup.hpp>
00056 #include <gecode/int/gcc/dom-sup.hpp>
00057
00058 namespace Gecode { namespace Int { namespace GCC {
00059
00066 template<class Card>
00067 class Val : public Propagator {
00068 protected:
00070 ViewArray<IntView> x;
00072 ViewArray<Card> k;
00074 Val(Home home, ViewArray<IntView>& x, ViewArray<Card>& k);
00076 Val(Space& home, bool share, Val<Card>& p);
00077 public:
00079 virtual Actor* copy(Space& home, bool share);
00081 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00083 virtual void reschedule(Space& home);
00085 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00087 virtual size_t dispose(Space& home);
00089 static ExecStatus post(Home home,
00090 ViewArray<IntView>& x, ViewArray<Card>& k);
00091 };
00092
00116 template<class Card>
00117 class Bnd : public Propagator {
00118 protected:
00120 ViewArray<IntView> x;
00122 ViewArray<IntView> y;
00124 ViewArray<Card> k;
00130 PartialSum<Card> lps;
00132 PartialSum<Card> ups;
00139 bool card_fixed;
00145 bool skip_lbc;
00147 Bnd(Space& home, bool share, Bnd<Card>& p);
00148
00150 ExecStatus pruneCards(Space& home);
00151
00170 ExecStatus lbc(Space& home, int& nb, HallInfo hall[], Rank rank[],
00171 int mu[], int nu[]);
00172
00191 ExecStatus ubc(Space& home, int& nb, HallInfo hall[], Rank rank[],
00192 int mu[], int nu[]);
00194 Bnd(Home home, ViewArray<IntView>&, ViewArray<Card>&, bool, bool);
00195 public:
00197 virtual Actor* copy(Space& home, bool share);
00199 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00201 virtual void reschedule(Space& home);
00203 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00205 virtual size_t dispose(Space& home);
00207 static ExecStatus post(Home home,
00208 ViewArray<IntView>& x, ViewArray<Card>& k);
00209 };
00210
00222 template<class Card>
00223 class Dom : public Propagator {
00224 protected:
00226 ViewArray<IntView> x;
00231 ViewArray<IntView> y;
00233 ViewArray<Card> k;
00235 VarValGraph<Card>* vvg;
00242 bool card_fixed;
00244 Dom(Space& home, bool share, Dom<Card>& p);
00246 Dom(Home home, ViewArray<IntView>&, ViewArray<Card>&, bool);
00247 public:
00249 virtual Actor* copy(Space& home, bool share);
00251 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00253 virtual void reschedule(Space& home);
00255 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00257 virtual size_t dispose(Space& home);
00259 static ExecStatus post(Home home,
00260 ViewArray<IntView>& x, ViewArray<Card>& k);
00261 };
00262
00263 }}}
00264
00265 #include <gecode/int/gcc/post.hpp>
00266 #include <gecode/int/gcc/val.hpp>
00267 #include <gecode/int/gcc/bnd.hpp>
00268 #include <gecode/int/gcc/dom.hpp>
00269
00270 #endif
00271
00272
00273
00274