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 #ifndef __GECODE_INT_GCC_HH__
00041 #define __GECODE_INT_GCC_HH__
00042
00043 #include <gecode/int.hh>
00044
00050 #include <gecode/int/gcc/view.hpp>
00051 #include <gecode/int/gcc/bnd-sup.hpp>
00052 #include <gecode/int/gcc/dom-sup.hpp>
00053
00054 namespace Gecode { namespace Int { namespace GCC {
00055
00062 template<class Card>
00063 class Val : public Propagator {
00064 protected:
00066 ViewArray<IntView> x;
00068 ViewArray<Card> k;
00070 Val(Home home, ViewArray<IntView>& x, ViewArray<Card>& k);
00072 Val(Space& home, Val<Card>& p);
00073 public:
00075 virtual Actor* copy(Space& home);
00077 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00079 virtual void reschedule(Space& home);
00081 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00083 virtual size_t dispose(Space& home);
00085 static ExecStatus post(Home home,
00086 ViewArray<IntView>& x, ViewArray<Card>& k);
00087 };
00088
00112 template<class Card>
00113 class Bnd : public Propagator {
00114 protected:
00116 ViewArray<IntView> x;
00118 ViewArray<IntView> y;
00120 ViewArray<Card> k;
00126 PartialSum<Card> lps;
00128 PartialSum<Card> ups;
00135 bool card_fixed;
00141 bool skip_lbc;
00143 Bnd(Space& home, Bnd<Card>& p);
00144
00146 ExecStatus pruneCards(Space& home);
00147
00166 ExecStatus lbc(Space& home, int& nb, HallInfo hall[], Rank rank[],
00167 int mu[], int nu[]);
00168
00187 ExecStatus ubc(Space& home, int& nb, HallInfo hall[], Rank rank[],
00188 int mu[], int nu[]);
00190 Bnd(Home home, ViewArray<IntView>&, ViewArray<Card>&, bool, bool);
00191 public:
00193 virtual Actor* copy(Space& home);
00195 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00197 virtual void reschedule(Space& home);
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, Dom<Card>& p);
00242 Dom(Home home, ViewArray<IntView>&, ViewArray<Card>&, bool);
00243 public:
00245 virtual Actor* copy(Space& home);
00247 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00249 virtual void reschedule(Space& home);
00251 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00253 virtual size_t dispose(Space& home);
00255 static ExecStatus post(Home home,
00256 ViewArray<IntView>& x, ViewArray<Card>& k);
00257 };
00258
00259 }}}
00260
00261 #include <gecode/int/gcc/post.hpp>
00262 #include <gecode/int/gcc/val.hpp>
00263 #include <gecode/int/gcc/bnd.hpp>
00264 #include <gecode/int/gcc/dom.hpp>
00265
00266 #endif
00267
00268
00269
00270