channel.hh
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
00144