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

propagator.hh

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Guido Tack <tack@gecode.org>
00004  *
00005  *  Copyright:
00006  *     Guido Tack, 2006
00007  *
00008  *  Last modified:
00009  *     $Date: 2006-08-17 11:46:13 +0200 (Thu, 17 Aug 2006) $ by $Author: tack $
00010  *     $Revision: 3544 $
00011  *
00012  *  This file is part of Gecode, the generic constraint
00013  *  development environment:
00014  *     http://www.gecode.org
00015  *
00016  *  See the file "LICENSE" for information on usage and
00017  *  redistribution of this file, and for a
00018  *     DISCLAIMER OF ALL WARRANTIES.
00019  *
00020  */
00021 
00022 #ifndef __GECODE_GENERATOR_PROJECOTRS_HH
00023 #define __GECODE_GENERATOR_PROJECTORS_HH
00024 
00025 #include "gecode/set/projectors.hh"
00026 
00027 namespace Gecode { namespace Set { namespace Projection {
00028 
00032   template <bool negated>
00033   class NaryProjection : public Propagator {
00034   protected:
00036     ViewArray<SetView> x;
00038     Support::SharedArray<PropCond> pc;
00040     ProjectorSet ps;
00042     NaryProjection(Space* home, bool share, NaryProjection& p);
00044     NaryProjection(Space* home, ViewArray<SetView>& x, ProjectorSet& ps);
00045   public:
00047     virtual PropCost cost(void) const;
00049     virtual size_t dispose(Space* home);
00051     virtual Actor*      copy(Space* home,bool);
00053     virtual ExecStatus propagate(Space* home);
00054     static  ExecStatus post(Space* home, ViewArray<SetView>& x,
00055                             ProjectorSet& ps);
00056   };
00057 
00061   class ReNaryProjection : public Propagator {
00062   protected:
00064     ViewArray<SetView> x;
00066     Gecode::Int::BoolView b;
00068     ProjectorSet ps;
00070     ReNaryProjection(Space* home, bool share, ReNaryProjection& p);
00072     ReNaryProjection(Space* home,ViewArray<SetView>& x,
00073                      Gecode::Int::BoolView,
00074                      ProjectorSet& ps);
00075   public:
00077     virtual PropCost cost(void) const;
00079     GECODE_SET_EXPORT virtual size_t dispose(Space* home);
00081     GECODE_SET_EXPORT virtual Actor* copy(Space* home,bool);
00083     GECODE_SET_EXPORT virtual ExecStatus propagate(Space* home);
00084     GECODE_SET_EXPORT static  ExecStatus post(Space* home,
00085                                               ViewArray<SetView>& x,
00086                                               Gecode::Int::BoolView b,
00087                                               ProjectorSet& ps);
00088   };
00089 
00093   class CardProjection : public Propagator {
00094   protected:
00096     ViewArray<SetView> x;
00098     Gecode::Int::IntView i;
00100     Support::SharedArray<PropCond> pc;
00102     Projector proj;
00104     CardProjection(Space* home, bool share, CardProjection& p);
00106     CardProjection(Space* home, ViewArray<SetView>& x,
00107                    Gecode::Int::IntView i, Projector& ps);
00108   public:
00110     virtual PropCost cost(void) const;
00112     virtual size_t dispose(Space* home);
00114     virtual Actor*      copy(Space* home,bool);
00116     virtual ExecStatus propagate(Space* home);
00117     static  ExecStatus post(Space* home, ViewArray<SetView>& x,
00118                             Gecode::Int::IntView i, Projector& p);
00119   };
00120   
00121 }}}
00122 
00123 #include "gecode/set/projectors/propagator/nary.icc"
00124 #include "gecode/set/projectors/propagator/re-nary.icc"
00125 #include "gecode/set/projectors/propagator/card.icc"
00126   
00127 #endif