Generated on Mon Jul 6 18:09:09 2009 for Gecode by doxygen 1.5.9

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: 2009-02-04 13:52:42 +0100 (Wed, 04 Feb 2009) $ by $Author: schulte $
00011  *     $Revision: 8139 $
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.hpp>
00044 #include <gecode/int/gcc/graphsup.hpp>
00045 #include <gecode/int/gcc/occur.hpp>
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 PropCost cost(const Space& home, const ModEventDelta& med) const;
00170     virtual ExecStatus  propagate(Space& home, const ModEventDelta& med);
00171   };
00172 
00198   template <class View, class Card, bool isView>
00199   class Dom : public Propagator {
00200   protected:
00202     ViewArray<View> x;
00207     ViewArray<View> y;
00209     ViewArray<Card> k;
00211     VarValGraph<View, Card, isView>* vvg;
00218     bool card_fixed;
00220     Dom(Space& home, bool share, Dom<View, Card, isView>& p);
00222     Dom(Space& home, ViewArray<View>&, ViewArray<Card>&, bool);
00223 
00224   public:
00226     virtual size_t dispose(Space& home);
00228     virtual size_t allocated(void) const;
00230     virtual Actor* copy(Space& home, bool share);
00243     virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00245     virtual ExecStatus  propagate(Space& home, const ModEventDelta& med);
00252     static  ExecStatus  post(Space& home,
00253                              ViewArray<View>& x, ViewArray<Card>& k);
00254   };
00255 
00262   template <class View, class Card, bool isView>
00263   class Val : public Propagator {
00264   protected:
00266     ViewArray<View> x;
00268     ViewArray<Card> k;
00270     Val(Space& home, bool share, Val<View, Card, isView>& p );
00272     Val(Space& home, ViewArray<View>&, ViewArray<Card>&);
00273 
00274   public:
00276     virtual size_t dispose(Space& home);
00278     virtual Actor* copy(Space& home, bool share);
00280     virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00282     virtual ExecStatus  propagate(Space& home, const ModEventDelta& med);
00289     static  ExecStatus  post(Space& home,
00290                              ViewArray<View>& x, ViewArray<Card>& k);
00291   };
00292 
00293 }}}
00294 
00295 #include <gecode/int/gcc/ubc.hpp>
00296 #include <gecode/int/gcc/lbc.hpp>
00297 #include <gecode/int/gcc/val.hpp>
00298 #include <gecode/int/gcc/bnd.hpp>
00299 #include <gecode/int/gcc/dom.hpp>
00300 
00301 #endif
00302 
00303 
00304 // STATISTICS: int-prop
00305