Generated on Wed Nov 1 15:04:33 2006 for Gecode by doxygen 1.4.5

cumulatives.hh

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Mikael Lagerkvist <lagerkvist@gecode.org>
00004  *
00005  *  Copyright:
00006  *     Mikael Lagerkvist, 2005
00007  *
00008  *  Last modified:
00009  *     $Date: 2006-08-04 16:03:26 +0200 (Fri, 04 Aug 2006) $ by $Author: schulte $
00010  *     $Revision: 3512 $
00011  *
00012  *  This file is part of Gecode, the generic constraint
00013  *  development environment:
00014  *     http://www.gecode.org
00015  *
00016  *  See the file "LICENSE" for information on usage and
00017  *  redistribution of this file, and for a
00018  *     DISCLAIMER OF ALL WARRANTIES.
00019  *
00020  */
00021 
00022 /*
00023  */
00024 
00025 #ifndef __GECODE_INT_CUMULATIVES_HH__
00026 #define __GECODE_INT_CUMULATIVES_HH__
00027 
00028 #include "gecode/int.hh"
00029 
00030 #include "gecode/support/shared-array.hh"
00031 #include <vector>
00032 #include <list>
00033 
00034 namespace Gecode { namespace Int { namespace Cumulatives {
00035 
00080   template <class ViewM, class ViewD, class ViewH, class View>
00081   class Val : public Propagator {
00082     ViewArray<ViewM>  machine;
00083     ViewArray<View>   start;
00084     ViewArray<ViewD>  duration;
00085     ViewArray<View>   end;
00086     ViewArray<ViewH>  height;
00087     Support::SharedArray<int>  limit;
00088     const bool        at_most;
00089 
00090     Val(Space* home, bool share, Val<ViewM, ViewD, ViewH, View>& p);
00091     Val(Space* home, const ViewArray<ViewM>&, const ViewArray<View>&,
00092         const ViewArray<ViewD>&, const ViewArray<View>&,
00093         const ViewArray<ViewH>&, const IntArgs&, bool);
00094 
00095     ExecStatus prune(Space * home, int low, int up, int r,
00096                      int ntask, int sheight,
00097                      const std::vector<int>& contribution,
00098                      std::list<int>& prune_tasks);
00099   public:
00100     virtual size_t dispose(Space* home);
00101     virtual Actor*     copy(Space* home, bool share);
00102     virtual PropCost   cost(void) const;
00103     virtual ExecStatus propagate(Space* home);
00104     static  ExecStatus post(Space* home, const ViewArray<ViewM>&,
00105                             const ViewArray<View>&, const ViewArray<ViewD>&,
00106                             const ViewArray<View>&, const ViewArray<ViewH>&,
00107                             const IntArgs&, bool);
00108   };
00109 
00110 
00111 }}}
00112 
00113 #include "gecode/int/cumulatives/val.icc"
00114 
00115 #endif
00116 
00117 // STATISTICS: int-prop
00118