circuit.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
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef __GECODE_INT_CIRCUIT_HH__
00039 #define __GECODE_INT_CIRCUIT_HH__
00040
00041 #include <gecode/int.hh>
00042 #include <gecode/int/distinct.hh>
00043
00049 namespace Gecode { namespace Int { namespace Circuit {
00050
00058 template<class View, class Offset>
00059 class Base : public NaryPropagator<View,Int::PC_INT_DOM> {
00060 protected:
00061 using NaryPropagator<View,Int::PC_INT_DOM>::x;
00063 int start;
00065 ViewArray<View> y;
00067 Offset o;
00069 Base(Space& home, bool share, Base& p);
00071 Base(Home home, ViewArray<View>& x, Offset& o);
00073 ExecStatus connected(Space& home);
00075 ExecStatus path(Space& home);
00076 public:
00078 virtual size_t dispose(Space& home);
00079 };
00080
00091 template<class View, class Offset>
00092 class Val : public Base<View,Offset> {
00093 protected:
00094 using Base<View,Offset>::x;
00095 using Base<View,Offset>::y;
00096 using Base<View,Offset>::connected;
00097 using Base<View,Offset>::path;
00098 using Base<View,Offset>::o;
00100 Val(Space& home, bool share, Val& p);
00102 Val(Home home, ViewArray<View>& x, Offset& o);
00103 public:
00105 virtual Actor* copy(Space& home, bool share);
00107 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00109 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00111 static ExecStatus post(Home home, ViewArray<View>& x, Offset& o);
00112 };
00113
00124 template<class View, class Offset>
00125 class Dom : public Base<View,Offset> {
00126 protected:
00127 using Base<View,Offset>::x;
00128 using Base<View,Offset>::y;
00129 using Base<View,Offset>::connected;
00130 using Base<View,Offset>::path;
00131 using Base<View,Offset>::o;
00133 Int::Distinct::DomCtrl<View> dc;
00135 Dom(Space& home, bool share, Dom& p);
00137 Dom(Home home, ViewArray<View>& x, Offset& o);
00138 public:
00140 virtual Actor* copy(Space& home, bool share);
00147 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00149 virtual void reschedule(Space& home);
00151 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00153 static ExecStatus post(Home home, ViewArray<View>& x, Offset& o);
00154 };
00155
00156 }}}
00157
00158 #include <gecode/int/circuit/base.hpp>
00159 #include <gecode/int/circuit/val.hpp>
00160 #include <gecode/int/circuit/dom.hpp>
00161
00162 #endif
00163
00164