Generated on Thu Apr 11 13:59:07 2019 for Gecode by doxygen 1.6.3

cumulatives.hh

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Mikael Lagerkvist <lagerkvist@gecode.org>
00005  *
00006  *  Copyright:
00007  *     Mikael Lagerkvist, 2005
00008  *
00009  *  This file is part of Gecode, the generic constraint
00010  *  development environment:
00011  *     http://www.gecode.org
00012  *
00013  *  Permission is hereby granted, free of charge, to any person obtaining
00014  *  a copy of this software and associated documentation files (the
00015  *  "Software"), to deal in the Software without restriction, including
00016  *  without limitation the rights to use, copy, modify, merge, publish,
00017  *  distribute, sublicense, and/or sell copies of the Software, and to
00018  *  permit persons to whom the Software is furnished to do so, subject to
00019  *  the following conditions:
00020  *
00021  *  The above copyright notice and this permission notice shall be
00022  *  included in all copies or substantial portions of the Software.
00023  *
00024  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00025  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00026  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00027  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00028  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00029  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00030  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00031  *
00032  */
00033 
00034 #ifndef __GECODE_INT_CUMULATIVES_HH__
00035 #define __GECODE_INT_CUMULATIVES_HH__
00036 
00037 #include <gecode/int.hh>
00038 
00039 namespace Gecode { namespace Int { namespace Cumulatives {
00040 
00085   template<class ViewM, class ViewP, class ViewU, class View>
00086   class Val : public Propagator {
00087   protected:
00088     ViewArray<ViewM>  m;
00089     ViewArray<View>   s;
00090     ViewArray<ViewP>  p;
00091     ViewArray<View>   e;
00092     ViewArray<ViewU>  u;
00093     SharedArray<int>  c;
00094     const bool        at_most;
00095 
00096     Val(Space& home, Val<ViewM, ViewP, ViewU, View>& p);
00097     Val(Home home, const ViewArray<ViewM>&, const ViewArray<View>&,
00098         const ViewArray<ViewP>&, const ViewArray<View>&,
00099         const ViewArray<ViewU>&, const SharedArray<int>&, bool);
00100 
00101     ExecStatus prune(Space& home, int low, int up, int r,
00102                      int ntask, int su,
00103                      int* contribution,
00104                      int* prune_tasks, int& prune_tasks_size);
00105   public:
00107     virtual Actor* copy(Space& home);
00109     virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00111     virtual void reschedule(Space& home);
00113     virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00115     static ExecStatus post(Home home, const ViewArray<ViewM>&,
00116                            const ViewArray<View>&, const ViewArray<ViewP>&,
00117                            const ViewArray<View>&, const ViewArray<ViewU>&,
00118                            const SharedArray<int>&, bool);
00120     virtual size_t dispose(Space& home);
00121   };
00122 
00123 
00124 }}}
00125 
00126 #include <gecode/int/cumulatives/val.hpp>
00127 
00128 #endif
00129 
00130 // STATISTICS: int-prop
00131