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 #ifndef __GECODE_INT_CIRCUIT_HH__
00035 #define __GECODE_INT_CIRCUIT_HH__
00036
00037 #include <gecode/int.hh>
00038 #include <gecode/int/distinct.hh>
00039
00045 namespace Gecode { namespace Int { namespace Circuit {
00046
00054 template<class View, class Offset>
00055 class Base : public NaryPropagator<View,Int::PC_INT_DOM> {
00056 protected:
00057 using NaryPropagator<View,Int::PC_INT_DOM>::x;
00059 int start;
00061 ViewArray<View> y;
00063 Offset o;
00065 Base(Space& home, Base& p);
00067 Base(Home home, ViewArray<View>& x, Offset& o);
00069 ExecStatus connected(Space& home);
00071 ExecStatus path(Space& home);
00072 public:
00074 virtual size_t dispose(Space& home);
00075 };
00076
00087 template<class View, class Offset>
00088 class Val : public Base<View,Offset> {
00089 protected:
00090 using Base<View,Offset>::x;
00091 using Base<View,Offset>::y;
00092 using Base<View,Offset>::connected;
00093 using Base<View,Offset>::path;
00094 using Base<View,Offset>::o;
00096 Val(Space& home, Val& p);
00098 Val(Home home, ViewArray<View>& x, Offset& o);
00099 public:
00101 virtual Actor* copy(Space& home);
00103 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00105 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00107 static ExecStatus post(Home home, ViewArray<View>& x, Offset& o);
00108 };
00109
00120 template<class View, class Offset>
00121 class Dom : public Base<View,Offset> {
00122 protected:
00123 using Base<View,Offset>::x;
00124 using Base<View,Offset>::y;
00125 using Base<View,Offset>::connected;
00126 using Base<View,Offset>::path;
00127 using Base<View,Offset>::o;
00129 Int::Distinct::DomCtrl<View> dc;
00131 Dom(Space& home, Dom& p);
00133 Dom(Home home, ViewArray<View>& x, Offset& o);
00134 public:
00136 virtual Actor* copy(Space& home);
00143 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00145 virtual void reschedule(Space& home);
00147 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00149 static ExecStatus post(Home home, ViewArray<View>& x, Offset& o);
00150 };
00151
00152 }}}
00153
00154 #include <gecode/int/circuit/base.hpp>
00155 #include <gecode/int/circuit/val.hpp>
00156 #include <gecode/int/circuit/dom.hpp>
00157
00158 #endif
00159
00160