Generated on Thu Apr 11 13:59:09 2019 for Gecode by doxygen 1.6.3

gcc.hh

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Patrick Pekczynski <pekczynski@ps.uni-sb.de>
00005  *
00006  *  Contributing authors:
00007  *     Christian Schulte <schulte@gecode.org>
00008  *     Guido Tack <tack@gecode.org>
00009  *
00010  *  Copyright:
00011  *     Patrick Pekczynski, 2004/2005
00012  *     Christian Schulte, 2009
00013  *     Guido Tack, 2009
00014  *
00015  *  This file is part of Gecode, the generic constraint
00016  *  development environment:
00017  *     http://www.gecode.org
00018  *
00019  *  Permission is hereby granted, free of charge, to any person obtaining
00020  *  a copy of this software and associated documentation files (the
00021  *  "Software"), to deal in the Software without restriction, including
00022  *  without limitation the rights to use, copy, modify, merge, publish,
00023  *  distribute, sublicense, and/or sell copies of the Software, and to
00024  *  permit persons to whom the Software is furnished to do so, subject to
00025  *  the following conditions:
00026  *
00027  *  The above copyright notice and this permission notice shall be
00028  *  included in all copies or substantial portions of the Software.
00029  *
00030  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00031  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00032  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00033  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00034  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00035  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00036  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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 // STATISTICS: int-prop
00270