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 ViewArray<View> y;
00065 Offset o;
00067 Base(Space& home, bool share, Base& p);
00069 Base(Home home, ViewArray<View>& x, Offset& o);
00071 ExecStatus connected(Space& home);
00073 ExecStatus path(Space& home);
00074 public:
00076 virtual size_t dispose(Space& home);
00077 };
00078
00089 template<class View, class Offset>
00090 class Val : public Base<View,Offset> {
00091 protected:
00092 using Base<View,Offset>::x;
00093 using Base<View,Offset>::y;
00094 using Base<View,Offset>::connected;
00095 using Base<View,Offset>::path;
00096 using Base<View,Offset>::o;
00098 Val(Space& home, bool share, Val& p);
00100 Val(Home home, ViewArray<View>& x, Offset& o);
00101 public:
00103 virtual Actor* copy(Space& home, bool share);
00105 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00107 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00109 static ExecStatus post(Home home, ViewArray<View>& x, Offset& o);
00110 };
00111
00122 template<class View, class Offset>
00123 class Dom : public Base<View,Offset> {
00124 protected:
00125 using Base<View,Offset>::x;
00126 using Base<View,Offset>::y;
00127 using Base<View,Offset>::connected;
00128 using Base<View,Offset>::path;
00129 using Base<View,Offset>::o;
00131 Int::Distinct::DomCtrl<View> dc;
00133 Dom(Space& home, bool share, Dom& p);
00135 Dom(Home home, ViewArray<View>& x, Offset& o);
00136 public:
00138 virtual Actor* copy(Space& home, bool share);
00145 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
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