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  *     Patrick Pekczynski <pekczynski@ps.uni-sb.de>
00005  *
00006  *  Copyright:
00007  *     Patrick Pekczynski, 2006
00008  *
00009  *  Last modified:
00010  *     $Date: 2008-02-16 10:42:26 +0100 (Sat, 16 Feb 2008) $ by $Author: tack $
00011  *     $Revision: 6185 $
00012  *
00013  *  This file is part of Gecode, the generic constraint
00014  *  development environment:
00015  *     http://www.gecode.org
00016  *
00017  *  Permission is hereby granted, free of charge, to any person obtaining
00018  *  a copy of this software and associated documentation files (the
00019  *  "Software"), to deal in the Software without restriction, including
00020  *  without limitation the rights to use, copy, modify, merge, publish,
00021  *  distribute, sublicense, and/or sell copies of the Software, and to
00022  *  permit persons to whom the Software is furnished to do so, subject to
00023  *  the following conditions:
00024  *
00025  *  The above copyright notice and this permission notice shall be
00026  *  included in all copies or substantial portions of the Software.
00027  *
00028  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00029  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00030  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00031  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00032  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00033  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00034  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00035  *
00036  */
00037 
00038 #ifndef __GECODE_CPLTSET_BRANCH_HH__
00039 #define __GECODE_CPLTSET_BRANCH_HH__
00040 
00041 #include "gecode/cpltset.hh"
00042 
00048 namespace Gecode { namespace CpltSet { namespace Branch {
00049 
00050   /*
00051    * Value selection classes
00052    *
00053    */
00054 
00062   template <bool exclude>
00063   class ValMinUnknown {
00064   public:
00066     int val(const Space*, CpltSetView x) const;
00068     ModEvent tell(Space* home, unsigned int a, CpltSetView x, int v);
00070     static Support::Symbol type(void);
00072     void branchingSpec(const Space* home,
00073                        Reflection::VarMap& m, Reflection::BranchingSpec& bs,
00074                        int alt, CpltSetView x, int n) const;
00075   };
00076 
00084   template <bool exclude>
00085   class ValMaxUnknown {
00086   public:
00088     int val(const Space*, CpltSetView x) const;
00090     ModEvent tell(Space* home, unsigned int a, CpltSetView x, int v);
00092     static Support::Symbol type(void);
00094     void branchingSpec(const Space* home,
00095                        Reflection::VarMap& m, Reflection::BranchingSpec& bs,
00096                        int alt, CpltSetView x, int n) const;
00097   };
00098 
00100   template <class SelView>
00101   static void
00102   create(Space* home, ViewArray<CpltSetView>&, CpltSetValBranch);
00103 
00104   /*
00105    * View selection classes
00106    *
00107    */
00108 
00115   class ByNone {
00116   public:
00118     ViewSelStatus init(const Space*, CpltSetView);
00120     ViewSelStatus select(const Space*, CpltSetView);
00122     static Support::Symbol type(void);
00123   };
00124 
00131   class ByMinCard {
00132   private:
00134     unsigned int minCard;
00135   public:
00137     ViewSelStatus init(const Space*, CpltSetView x);
00139     ViewSelStatus select(const Space*, CpltSetView x);
00141     static Support::Symbol type(void);
00142   };
00143 
00150   class ByMaxCard {
00151   private:
00153     unsigned int maxCard;
00154   public:
00156     ViewSelStatus init(const Space*, CpltSetView x);
00158     ViewSelStatus select(const Space*, CpltSetView x);
00160     static Support::Symbol type(void);
00161   };
00162 
00169   class ByMinUnknown {
00170   private:
00172     int minUnknown;
00173   public:
00175     ViewSelStatus init(const Space*, CpltSetView x);
00177     ViewSelStatus select(const Space*, CpltSetView x);
00179     static Support::Symbol type(void);
00180   };
00181 
00188   class ByMaxUnknown {
00189   private:
00191     int maxUnknown;
00192   public:
00194     ViewSelStatus init(const Space*, CpltSetView x);
00196     ViewSelStatus select(const Space*, CpltSetView x);
00198     static Support::Symbol type(void);
00199   };
00200 
00201 }}}
00202 
00203 #include "gecode/cpltset/branch/select-val.icc"
00204 #include "gecode/cpltset/branch/select-view.icc"
00205 
00206 #endif
00207 
00208 // STATISTICS: cpltset-branch