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

channel.hh

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Christian Schulte <schulte@gecode.org>
00004  *
00005  *  Copyright:
00006  *     Christian Schulte, 2006
00007  *
00008  *  Last modified:
00009  *     $Date: 2006-07-12 15:53:12 +0200 (Wed, 12 Jul 2006) $ by $Author: tack $
00010  *     $Revision: 3349 $
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_INT_CHANNEL_HH__
00023 #define __GECODE_INT_CHANNEL_HH__
00024 
00025 #include "gecode/int.hh"
00026 #include "gecode/int/distinct.hh"
00027 
00033 namespace Gecode { namespace Int { namespace Channel {
00034 
00039   template <class Info, PropCond pc>
00040   class Base : public Propagator {
00041   protected:
00043     int n;
00045     int n_na;
00047     Info* xy;
00049     Base(Space* home, bool share, Base<Info,pc>& p);
00051     Base(Space* home, int n, Info* xy, bool fd=false);
00052   public:
00054     virtual PropCost cost(void) const;
00056     virtual size_t dispose(Space* home);
00057   };
00058 
00059 
00064   template <class View> class ValInfo;
00065 
00074   template <class View>
00075   class Val : public Base<ValInfo<View>,PC_INT_VAL> {
00076  protected:
00077     using Base<ValInfo<View>,PC_INT_VAL>::n;
00078     using Base<ValInfo<View>,PC_INT_VAL>::n_na;
00079     using Base<ValInfo<View>,PC_INT_VAL>::xy;
00081     Val(Space* home, bool share, Val& p);
00083     Val(Space* home, int n, ValInfo<View>* xy);
00084   public:
00086     virtual Actor* copy(Space* home, bool share);
00088     virtual ExecStatus propagate(Space* home);
00090     static  ExecStatus post(Space* home, int n, ValInfo<View>* xy);
00091   };
00092 
00097   template <class View> class DomInfo;
00098 
00105   template <class View>
00106   class Dom : public Base<DomInfo<View>,PC_INT_DOM> {
00107   protected:
00108     using Base<DomInfo<View>,PC_INT_DOM>::n;
00109     using Base<DomInfo<View>,PC_INT_DOM>::n_na;
00110     using Base<DomInfo<View>,PC_INT_DOM>::xy;
00112     Distinct::DomCtrl<View> dc;
00114     Dom(Space* home, bool share, Dom& p);
00116     Dom(Space* home, int n, DomInfo<View>* xy);
00117   public:
00119     virtual Actor* copy(Space* home, bool share);
00121     virtual PropCost cost(void) const;
00123     virtual ExecStatus propagate(Space* home);
00125     static  ExecStatus post(Space* home, int n, DomInfo<View>* xy);
00127     virtual void flush(void);
00129     virtual size_t size(void) const;
00131     virtual size_t dispose(Space* home);
00132   };
00133 
00134 }}}
00135 
00136 #include "gecode/int/channel/base.icc"
00137 #include "gecode/int/channel/stack.icc"
00138 #include "gecode/int/channel/val.icc"
00139 #include "gecode/int/channel/dom.icc"
00140 
00141 #endif
00142 
00143 // STATISTICS: int-prop
00144