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 ExecStatus propagate(Space& home, const ModEventDelta& med);
00085 virtual size_t dispose(Space& home);
00087 static ExecStatus post(Home home,
00088 ViewArray<IntView>& x, ViewArray<Card>& k);
00089 };
00090
00114 template<class Card>
00115 class Bnd : public Propagator {
00116 protected:
00118 ViewArray<IntView> x;
00120 ViewArray<IntView> y;
00122 ViewArray<Card> k;
00128 PartialSum<Card> lps;
00130 PartialSum<Card> ups;
00137 bool card_fixed;
00143 bool skip_lbc;
00145 Bnd(Space& home, bool share, Bnd<Card>& p);
00146
00148 ExecStatus pruneCards(Space& home);
00149
00168 ExecStatus lbc(Space& home, int& nb, HallInfo hall[], Rank rank[],
00169 int mu[], int nu[]);
00170
00189 ExecStatus ubc(Space& home, int& nb, HallInfo hall[], Rank rank[],
00190 int mu[], int nu[]);
00192 Bnd(Home home, ViewArray<IntView>&, ViewArray<Card>&, bool, bool);
00193 public:
00195 virtual Actor* copy(Space& home, bool share);
00197 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00199 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00201 virtual size_t dispose(Space& home);
00203 static ExecStatus post(Home home,
00204 ViewArray<IntView>& x, ViewArray<Card>& k);
00205 };
00206
00218 template<class Card>
00219 class Dom : public Propagator {
00220 protected:
00222 ViewArray<IntView> x;
00227 ViewArray<IntView> y;
00229 ViewArray<Card> k;
00231 VarValGraph<Card>* vvg;
00238 bool card_fixed;
00240 Dom(Space& home, bool share, Dom<Card>& p);
00242 Dom(Home home, ViewArray<IntView>&, ViewArray<Card>&, bool);
00243 public:
00245 virtual Actor* copy(Space& home, bool share);
00247 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00249 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00251 virtual size_t dispose(Space& home);
00253 static ExecStatus post(Home home,
00254 ViewArray<IntView>& x, ViewArray<Card>& k);
00255 };
00256
00257 }}}
00258
00259 #include <gecode/int/gcc/post.hpp>
00260 #include <gecode/int/gcc/val.hpp>
00261 #include <gecode/int/gcc/bnd.hpp>
00262 #include <gecode/int/gcc/dom.hpp>
00263
00264 #endif
00265
00266
00267
00268