Generated on Thu Mar 22 10:39:40 2012 for Gecode by doxygen 1.6.3

precede.hh

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Christopher Mears <Chris.Mears@monash.edu>
00005  *
00006  *  Contributing authors:
00007  *     Christian Schulte <schulte@gecode.org>
00008  *
00009  *  Copyright:
00010  *     Christopher Mears, 2011
00011  *     Christian Schulte, 2011
00012  *
00013  *  Last modified:
00014  *     $Date: 2011-06-30 16:20:54 +0200 (Thu, 30 Jun 2011) $ by $Author: schulte $
00015  *     $Revision: 12138 $
00016  *
00017  *  This file is part of Gecode, the generic constraint
00018  *  development environment:
00019  *     http://www.gecode.org
00020  *
00021  *  Permission is hereby granted, free of charge, to any person obtaining
00022  *  a copy of this software and associated documentation files (the
00023  *  "Software"), to deal in the Software without restriction, including
00024  *  without limitation the rights to use, copy, modify, merge, publish,
00025  *  distribute, sublicense, and/or sell copies of the Software, and to
00026  *  permit persons to whom the Software is furnished to do so, subject to
00027  *  the following conditions:
00028  *
00029  *  The above copyright notice and this permission notice shall be
00030  *  included in all copies or substantial portions of the Software.
00031  *
00032  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00033  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00034  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00035  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00036  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00037  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00038  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00039  *
00040  */
00041 
00042 #ifndef __GECODE_INT_PRECEDE_HH__
00043 #define __GECODE_INT_PRECEDE_HH__
00044 
00045 #include <gecode/int.hh>
00046 
00052 namespace Gecode { namespace Int { namespace Precede {
00053     
00064   template<class View>
00065   class Single : public NaryPropagator<View,PC_INT_NONE> {
00066   protected:
00067     using NaryPropagator<View,PC_INT_NONE>::x;
00069     class Index : public Advisor {
00070     public:
00072       int i;
00074       Index(Space& home, Propagator& p, Council<Index>& c, int i);
00076       Index(Space& home, bool share, Index& a);
00077     };
00079     Council<Index> c;
00081     int s, t;
00083     int alpha, beta, gamma;
00085     ExecStatus updateAlpha(Space& home);
00087     ExecStatus updateBeta(Space& home);
00089     Single(Home home, ViewArray<View>& x, int s, int t, int beta, int gamma);
00091     Single(Space& home, bool share, Single<View>& p);
00092   public:
00094     virtual Propagator* copy(Space& home, bool share);
00096     virtual PropCost cost(const Space&, const ModEventDelta&) const;
00098     virtual size_t dispose(Space& home);
00100     virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
00102     virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00104     static ExecStatus post(Home home, ViewArray<View>& x, int s, int t);
00105   };
00106 
00107 }}}
00108 
00109 #include <gecode/int/precede/single.hpp>
00110 
00111 #endif
00112 
00113 // STATISTICS: int-prop