Generated on Mon Aug 25 11:35:33 2008 for Gecode by doxygen 1.5.6

branch.hh

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Guido Tack <tack@gecode.org>
00005  *     Christian Schulte <schulte@gecode.org>
00006  *
00007  *  Contributing authors:
00008  *     Gabor Szokoli <szokoli@gecode.org>
00009  *
00010  *  Copyright:
00011  *     Guido Tack, 2004
00012  *     Christian Schulte, 2004
00013  *     Gabor Szokoli, 2004
00014  *
00015  *  Last modified:
00016  *     $Date: 2008-02-16 10:42:26 +0100 (Sat, 16 Feb 2008) $ by $Author: tack $
00017  *     $Revision: 6185 $
00018  *
00019  *  This file is part of Gecode, the generic constraint
00020  *  development environment:
00021  *     http://www.gecode.org
00022  *
00023  *  Permission is hereby granted, free of charge, to any person obtaining
00024  *  a copy of this software and associated documentation files (the
00025  *  "Software"), to deal in the Software without restriction, including
00026  *  without limitation the rights to use, copy, modify, merge, publish,
00027  *  distribute, sublicense, and/or sell copies of the Software, and to
00028  *  permit persons to whom the Software is furnished to do so, subject to
00029  *  the following conditions:
00030  *
00031  *  The above copyright notice and this permission notice shall be
00032  *  included in all copies or substantial portions of the Software.
00033  *
00034  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00035  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00036  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00037  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00038  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00039  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00040  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00041  *
00042  */
00043 
00044 #ifndef __GECODE_SET_BRANCH_HH__
00045 #define __GECODE_SET_BRANCH_HH__
00046 
00047 #include "gecode/set.hh"
00048 
00054 namespace Gecode { namespace Set { namespace Branch {
00055 
00056   /*
00057    * Value selection classes
00058    *
00059    */
00060 
00061 
00069   class ValMin {
00070   public:
00072     int val(const Space* home, SetView x) const;
00074     ModEvent tell(Space* home, unsigned int a, SetView x, int v);
00076     static Support::Symbol type(void);
00078     void branchingSpec(const Space* home,
00079                        Reflection::VarMap& m, Reflection::BranchingSpec& bs,
00080                        int alt, SetView x, int n) const;
00081   };
00082 
00090   class ValMax {
00091   public:
00093     int val(const Space* home, SetView x) const;
00095     ModEvent tell(Space* home, unsigned int a, SetView x, int v);
00097     static Support::Symbol type(void);
00099     void branchingSpec(const Space* home,
00100                        Reflection::VarMap& m, Reflection::BranchingSpec& bs,
00101                        int alt, SetView x, int n) const;
00102   };
00103 
00105   template <class SelView>
00106   static void
00107   create(Space* home, ViewArray<SetView>&, SetValBranch);
00108 
00109   /*
00110    * View selection classes
00111    *
00112    */
00113 
00120   class ByNone {
00121   public:
00123     ViewSelStatus init(const Space* home, SetView x);
00125     ViewSelStatus select(const Space* home, SetView x);
00127     static Support::Symbol type(void);
00128   };
00129 
00136   class ByMinCard {
00137   private:
00139     unsigned int minCard;
00140   public:
00142     ViewSelStatus init(const Space* home, SetView x);
00144     ViewSelStatus select(const Space* home, SetView x);
00146     static Support::Symbol type(void);
00147   };
00148 
00155   class ByMaxCard {
00156   private:
00158     unsigned int maxCard;
00159   public:
00161     ViewSelStatus init(const Space* home, SetView x);
00163     ViewSelStatus select(const Space* home, SetView x);
00165     static Support::Symbol type(void);
00166   };
00167 
00174   class ByMinUnknown {
00175   private:
00177     int minUnknown;
00178   public:
00180     ViewSelStatus init(const Space* home, SetView x);
00182     ViewSelStatus select(const Space* home, SetView x);
00184     static Support::Symbol type(void);
00185   };
00186 
00193   class ByMaxUnknown {
00194   private:
00196     int maxUnknown;
00197   public:
00199     ViewSelStatus init(const Space* home, SetView x);
00201     ViewSelStatus select(const Space* home, SetView x);
00203     static Support::Symbol type(void);
00204   };
00205 
00206 }}}
00207 
00208 #include "gecode/set/branch/select-val.icc"
00209 #include "gecode/set/branch/select-view.icc"
00210 
00211 #endif
00212 // STATISTICS: set-branch
00213