Generated on Mon Aug 25 11:35:37 2008 for Gecode by doxygen 1.5.6

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  *  Copyright:
00007  *     Patrick Pekczynski, 2004/2005
00008  *
00009  *  Last modified:
00010  *     $Date: 2008-07-11 09:28:48 +0200 (Fri, 11 Jul 2008) $ by $Author: tack $
00011  *     $Revision: 7285 $
00012  *
00013  *  This file is part of Gecode, the generic constraint
00014  *  development environment:
00015  *     http://www.gecode.org
00016  *
00017  *  Permission is hereby granted, free of charge, to any person obtaining
00018  *  a copy of this software and associated documentation files (the
00019  *  "Software"), to deal in the Software without restriction, including
00020  *  without limitation the rights to use, copy, modify, merge, publish,
00021  *  distribute, sublicense, and/or sell copies of the Software, and to
00022  *  permit persons to whom the Software is furnished to do so, subject to
00023  *  the following conditions:
00024  *
00025  *  The above copyright notice and this permission notice shall be
00026  *  included in all copies or substantial portions of the Software.
00027  *
00028  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00029  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00030  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00031  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00032  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00033  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00034  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00035  *
00036  */
00037 
00038 #ifndef __GECODE_INT_GCC_HH__
00039 #define __GECODE_INT_GCC_HH__
00040 
00041 #include "gecode/int.hh"
00042 
00043 #include "gecode/int/gcc/gccbndsup.icc"
00044 #include "gecode/int/gcc/graphsup.icc"
00045 #include "gecode/int/gcc/occur.icc"
00046 
00055 namespace Gecode { namespace Int { namespace GCC {
00056 
00107   template <class View, class Card, bool isView>
00108   class Bnd{
00109   public:
00117     static  ExecStatus  post(Space* home,
00118                              ViewArray<View>& x,
00119                              ViewArray<Card>& k);
00120   };
00121 
00126   template <class View, class Card, bool isView, bool shared>
00127   class BndImp : public Propagator {
00128     friend class Bnd<View, Card, isView>;
00129   protected:
00131     ViewArray<View> x;
00133     ViewArray<Card> k;
00139     PartialSum<Card>* lps;
00141     PartialSum<Card>* ups;
00148     bool card_fixed;
00154     bool skip_lbc;
00156     BndImp(Space* home, ViewArray<View>&, ViewArray<Card>&, bool, bool);
00158     BndImp(Space* home, bool share, BndImp<View, Card, isView, shared>& p);
00159 
00160   public:
00162     virtual size_t dispose(Space* home);
00164     virtual size_t allocated(void) const;
00166     virtual Actor* copy(Space* home, bool share);
00168     virtual Reflection::ActorSpec spec(const Space* home,
00169                                         Reflection::VarMap& m) const;
00171     static void post(Space* home, Reflection::VarMap& vars,
00172                      const Reflection::ActorSpec& spec);
00174     static Support::Symbol ati(void);
00176     virtual PropCost cost(ModEventDelta med) const;
00178     virtual ExecStatus  propagate(Space* home, ModEventDelta med);
00179   };
00180 
00206   template <class View, class Card, bool isView>
00207   class Dom : public Propagator {
00208   protected:
00210     ViewArray<View> x;
00215     ViewArray<View> y;
00217     ViewArray<Card> k;
00219     VarValGraph<View, Card, isView>* vvg;
00226     bool card_fixed;
00228     Dom(Space* home, bool share, Dom<View, Card, isView>& p);
00230     Dom(Space* home, ViewArray<View>&, ViewArray<Card>&, bool);
00231 
00232   public:
00234     virtual size_t dispose(Space* home);
00236     virtual size_t allocated(void) const;
00238     virtual Actor* copy(Space* home, bool share);
00251     virtual PropCost cost(ModEventDelta med) const;
00253     virtual ExecStatus  propagate(Space* home, ModEventDelta med);
00255     virtual Reflection::ActorSpec spec(const Space* home,
00256                                         Reflection::VarMap& m) const;
00258     static void post(Space* home, Reflection::VarMap& vars,
00259                      const Reflection::ActorSpec& spec);
00261     static Support::Symbol ati(void);
00268     static  ExecStatus  post(Space* home,
00269                              ViewArray<View>& x, ViewArray<Card>& k);
00270   };
00271 
00278   template <class View, class Card, bool isView>
00279   class Val : public Propagator {
00280   protected:
00282     ViewArray<View> x;
00284     ViewArray<Card> k;
00286     Val(Space* home, bool share, Val<View, Card, isView>& p );
00288     Val(Space* home, ViewArray<View>&, ViewArray<Card>&);
00289 
00290   public:
00292     virtual size_t dispose(Space* home);
00294     virtual Actor* copy(Space* home, bool share);
00296     virtual PropCost cost(ModEventDelta med) const;
00298     virtual ExecStatus  propagate(Space* home, ModEventDelta med);
00300     virtual Reflection::ActorSpec spec(const Space* home,
00301                                         Reflection::VarMap& m) const;
00303     static void post(Space* home, Reflection::VarMap& vars,
00304                      const Reflection::ActorSpec& spec);
00306     static Support::Symbol ati(void);
00313     static  ExecStatus  post(Space* home,
00314                              ViewArray<View>& x, ViewArray<Card>& k);
00315   };
00316 
00317 }}}
00318 
00319 #include "gecode/int/gcc/ubc.icc"
00320 #include "gecode/int/gcc/lbc.icc"
00321 #include "gecode/int/gcc/val.icc"
00322 #include "gecode/int/gcc/bnd.icc"
00323 #include "gecode/int/gcc/dom.icc"
00324 
00325 #endif
00326 
00327 
00328 // STATISTICS: int-prop
00329