cumulatives.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_CUMULATIVES_HH__
00039 #define __GECODE_INT_CUMULATIVES_HH__
00040
00041 #include <gecode/int.hh>
00042
00043 namespace Gecode { namespace Int { namespace Cumulatives {
00044
00089 template<class ViewM, class ViewP, class ViewU, class View>
00090 class Val : public Propagator {
00091 protected:
00092 ViewArray<ViewM> m;
00093 ViewArray<View> s;
00094 ViewArray<ViewP> p;
00095 ViewArray<View> e;
00096 ViewArray<ViewU> u;
00097 SharedArray<int> c;
00098 const bool at_most;
00099
00100 Val(Space& home, bool share, Val<ViewM, ViewP, ViewU, View>& p);
00101 Val(Home home, const ViewArray<ViewM>&, const ViewArray<View>&,
00102 const ViewArray<ViewP>&, const ViewArray<View>&,
00103 const ViewArray<ViewU>&, const SharedArray<int>&, bool);
00104
00105 ExecStatus prune(Space& home, int low, int up, int r,
00106 int ntask, int su,
00107 int* contribution,
00108 int* prune_tasks, int& prune_tasks_size);
00109 public:
00111 virtual Actor* copy(Space& home, bool share);
00113 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00115 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00117 static ExecStatus post(Home home, const ViewArray<ViewM>&,
00118 const ViewArray<View>&, const ViewArray<ViewP>&,
00119 const ViewArray<View>&, const ViewArray<ViewU>&,
00120 const SharedArray<int>&, bool);
00122 virtual size_t dispose(Space& home);
00123 };
00124
00125
00126 }}}
00127
00128 #include <gecode/int/cumulatives/val.hpp>
00129
00130 #endif
00131
00132
00133