Generated on Wed Nov 1 15:04:28 2006 for Gecode by doxygen 1.4.5

int.hh

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Guido Tack <tack@gecode.org>
00004  *     Christian Schulte <schulte@gecode.org>
00005  *
00006  *  Copyright:
00007  *     Guido Tack, 2004
00008  *     Christian Schulte, 2004
00009  *
00010  *  Last modified:
00011  *     $Date: 2006-05-29 09:42:21 +0200 (Mon, 29 May 2006) $ by $Author: schulte $
00012  *     $Revision: 3246 $
00013  *
00014  *  This file is part of Gecode, the generic constraint
00015  *  development environment:
00016  *     http://www.gecode.org
00017  *
00018  *  See the file "LICENSE" for information on usage and
00019  *  redistribution of this file, and for a
00020  *     DISCLAIMER OF ALL WARRANTIES.
00021  *
00022  */
00023 
00024 #ifndef __GECODE_SET_INT_HH__
00025 #define __GECODE_SET_INT_HH__
00026 
00027 #include "gecode/set.hh"
00028 
00029 namespace Gecode { namespace Set { namespace Int {
00030 
00042   class MinElement :
00043     public IntSetPropagator<SetView,PC_SET_ANY,Gecode::Int::PC_INT_BND> {
00044   protected:
00046     MinElement(Space* home, bool share,MinElement& p);
00048     MinElement(Space* home,SetView, Gecode::Int::IntView);
00049   public:
00051     GECODE_SET_EXPORT virtual Actor*      copy(Space* home,bool);
00053     GECODE_SET_EXPORT virtual ExecStatus propagate(Space* home);
00055     static ExecStatus post(Space* home,SetView s, Gecode::Int::IntView x);
00056   };
00057 
00064   class MaxElement :
00065     public IntSetPropagator<SetView,PC_SET_ANY,Gecode::Int::PC_INT_BND> {
00066   protected:
00068     MaxElement(Space* home, bool share,MaxElement& p);
00070     MaxElement(Space* home,SetView, Gecode::Int::IntView);
00071   public:
00073     GECODE_SET_EXPORT virtual Actor*      copy(Space* home,bool);
00075     GECODE_SET_EXPORT virtual ExecStatus propagate(Space* home);
00077     static ExecStatus post(Space* home,SetView s, Gecode::Int::IntView x);
00078   };
00079 
00086   class Card :
00087     public IntSetPropagator<SetView,PC_SET_CARD,Gecode::Int::PC_INT_BND> {
00088   protected:
00090     Card(Space* home, bool share,Card& p);
00092     Card(Space* home,SetView, Gecode::Int::IntView);
00093   public:
00095     GECODE_SET_EXPORT virtual Actor*      copy(Space* home,bool);
00097     GECODE_SET_EXPORT virtual ExecStatus propagate(Space* home);
00099     static ExecStatus post(Space* home,SetView s, Gecode::Int::IntView x);
00100   };
00101 
00102 
00109   class Match : public Propagator {
00110   protected:
00112     SetView x0;
00114     ViewArray< Gecode::Int::IntView > xs;
00115 
00117     Match(Space* home, bool share,Match& p);
00119     Match(Space* home,SetView, ViewArray< Gecode::Int::IntView >&);
00120   public:
00122     GECODE_SET_EXPORT virtual Actor*   copy(Space* home,bool);
00124     GECODE_SET_EXPORT virtual PropCost cost(void) const;
00126     GECODE_SET_EXPORT virtual size_t dispose(Space* home);
00128     GECODE_SET_EXPORT virtual ExecStatus propagate(Space* home);
00130     static ExecStatus post(Space* home,SetView s,
00131                            ViewArray< Gecode::Int::IntView >& x);
00132   };
00133 
00151   class Channel : public Propagator {
00152   protected:
00154     ViewArray< Gecode::Int::IntView > xs;
00156     ViewArray< SetView > ys;
00157 
00159     Channel(Space* home, bool share,Channel& p);
00161     Channel(Space* home,ViewArray< Gecode::Int::IntView >&,
00162             ViewArray< SetView >&);
00163   public:
00165     GECODE_SET_EXPORT virtual Actor*   copy(Space* home,bool);
00167     GECODE_SET_EXPORT virtual PropCost cost(void) const;
00169     GECODE_SET_EXPORT virtual size_t dispose(Space* home);
00171     GECODE_SET_EXPORT virtual ExecStatus propagate(Space* home);
00173     static ExecStatus post(Space* home,ViewArray< Gecode::Int::IntView >& x,
00174                            ViewArray< SetView >& y);
00175   };
00176 
00183   class Weights : public Propagator {
00184   protected:
00186     Support::SharedArray<int> elements;
00188     Support::SharedArray<int> weights;
00189 
00191     SetView x;
00193     Gecode::Int::IntView y;
00194 
00196     Weights(Space* home, bool share,Weights& p);
00198     Weights(Space* home, const IntArgs&, const IntArgs&,
00199             SetView, Gecode::Int::IntView);
00200   public:
00202     GECODE_SET_EXPORT virtual Actor*   copy(Space* home,bool);
00204     GECODE_SET_EXPORT virtual PropCost cost(void) const;
00206     GECODE_SET_EXPORT virtual size_t dispose(Space* home);
00208     GECODE_SET_EXPORT virtual ExecStatus propagate(Space* home);
00210     static ExecStatus post(Space* home,
00211                            const IntArgs& elements, const IntArgs& weights,
00212                            SetView x, Gecode::Int::IntView y);
00213   };
00214 
00215 }}}
00216 
00217 #include "gecode/set/int/minmax.icc"
00218 #include "gecode/set/int/card.icc"
00219 #include "gecode/set/int/match.icc"
00220 #include "gecode/set/int/channel.icc"
00221 #include "gecode/set/int/weights.icc"
00222 
00223 #endif
00224 
00225 // STATISTICS: set-prop
00226