Generated on Wed Jan 4 17:49:08 2006 for Gecode by doxygen 1.4.6

branch.hh

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Christian Schulte <schulte@gecode.org>
00004  *
00005  *  Copyright:
00006  *     Christian Schulte, 2002
00007  *
00008  *  Last modified:
00009  *     $Date: 2005-10-19 18:05:44 +0200 (Wed, 19 Oct 2005) $ by $Author: tack $
00010  *     $Revision: 2381 $
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 #ifndef __GECODE_INT_BRANCH_HH__
00023 #define __GECODE_INT_BRANCH_HH__
00024 
00025 #include "int.hh"
00026 
00032 namespace Gecode { namespace Int { namespace Branch {
00033 
00034   /*
00035    * Value selection classes
00036    *
00037    */
00045   class ValMin {
00046   public:
00048     int val(IntView x);
00050     ModEvent tell(Space* home, unsigned int a, IntView x, int n);
00051   };
00052 
00060   class ValMed {
00061   public:
00063     int val(IntView x);
00065     ModEvent tell(Space* home, unsigned int a, IntView x, int n);
00066   };
00067 
00075   class ValMax {
00076   public:
00078     int val(IntView x);
00080     ModEvent tell(Space* home, unsigned int a, IntView x, int n);
00081   };
00082 
00090   class ValSplitMin {
00091   public:
00093     int val(IntView x);
00095     ModEvent tell(Space* home, unsigned int a, IntView x, int n);
00096   };
00097 
00105   class ValSplitMax {
00106   public:
00108     int val(IntView x);
00110     ModEvent tell(Space* home, unsigned int a, IntView x, int n);
00111   };
00112 
00114   template <class SelView>
00115   static void
00116   create(Space* home, ViewArray<IntView>&, BvalSel);
00117 
00118 
00119   /*
00120    * Variable selection classes
00121    *
00122    */
00123 
00130   class ByNone {
00131   public:
00133     ViewSelStatus init(IntView x);
00135     ViewSelStatus select(IntView x);
00136   };
00137 
00144   class ByMinMin {
00145   protected:
00147     int min;
00148   public:
00150     ViewSelStatus init(IntView x);
00152     ViewSelStatus select(IntView x);
00153   };
00154 
00161   class ByMinMax {
00162   protected:
00164     int min;
00165   public:
00167     ViewSelStatus init(IntView x);
00169     ViewSelStatus select(IntView x);
00170   };
00171 
00178   class ByMaxMin {
00179   protected:
00181     int max;
00182   public:
00184     ViewSelStatus init(IntView x);
00186     ViewSelStatus select(IntView x);
00187   };
00188 
00195   class ByMaxMax {
00196   protected:
00198     int max;
00199   public:
00201     ViewSelStatus init(IntView x);
00203     ViewSelStatus select(IntView x);
00204   };
00205 
00212   class BySizeMin {
00213   protected:
00215     unsigned int size;
00216   public:
00218     ViewSelStatus init(IntView x);
00220     ViewSelStatus select(IntView x);
00221   };
00222 
00229   class BySizeMax {
00230   protected:
00232     unsigned int size;
00233   public:
00235     ViewSelStatus init(IntView x);
00237     ViewSelStatus select(IntView x);
00238   };
00239 
00246   class ByDegreeMin {
00247   protected:
00249     unsigned int degree;
00251     unsigned int size;
00252   public:
00254     ViewSelStatus init(IntView x);
00256     ViewSelStatus select(IntView x);
00257   };
00258 
00265   class ByDegreeMax {
00266   protected:
00268     unsigned int degree;
00270     unsigned int size;
00271   public:
00273     ViewSelStatus init(IntView x);
00275     ViewSelStatus select(IntView x);
00276   };
00277 
00284   class ByRegretMinMin {
00285   protected:
00287     unsigned int regret;
00288   public:
00290     ViewSelStatus init(IntView x);
00292     ViewSelStatus select(IntView x);
00293   };
00294 
00301   class ByRegretMinMax {
00302   protected:
00304     unsigned int regret;
00305   public:
00307     ViewSelStatus init(IntView x);
00309     ViewSelStatus select(IntView x);
00310   };
00311 
00318   class ByRegretMaxMin {
00319   protected:
00321     unsigned int regret;
00322   public:
00324     ViewSelStatus init(IntView x);
00326     ViewSelStatus select(IntView x);
00327   };
00328 
00335   class ByRegretMaxMax {
00336   protected:
00338     unsigned int regret;
00339   public:
00341     ViewSelStatus init(IntView x);
00343     ViewSelStatus select(IntView x);
00344   };
00345 
00346 
00347   /*
00348    * Classes for assignment
00349    *
00350    */
00351 
00353   class Assign : public Branching {
00354   protected:
00356     ViewArray<IntView> x;
00358     int pos;
00360     Assign(Space* home, bool share, Assign& b);
00361   public:
00363     Assign(Space* home, ViewArray<IntView>& x);
00365     virtual unsigned int branch(void);
00366   };
00367 
00368 
00370   class AssignMin : public Assign {
00371   protected:
00373     AssignMin(Space* home, bool share, AssignMin& b);
00374   public:
00376     AssignMin(Space* home, ViewArray<IntView>& x);
00378     virtual Actor* copy(Space* home, bool share);
00380     virtual BranchingDesc* description(void);
00382     virtual ExecStatus commit(Space* home, unsigned int a, BranchingDesc* d);
00383   };
00384 
00386   class AssignMed : public Assign {
00387   protected:
00389     AssignMed(Space* home, bool share, AssignMed& b);
00390   public:
00392     AssignMed(Space* home, ViewArray<IntView>& x);
00394     virtual Actor* copy(Space* home, bool share);
00396     virtual BranchingDesc* description(void);
00398     virtual ExecStatus commit(Space* home, unsigned int a, BranchingDesc* d);
00399   };
00400 
00402   class AssignMax : public Assign {
00403   protected:
00405     AssignMax(Space* home, bool share, AssignMax& b);
00406   public:
00408     AssignMax(Space* home, ViewArray<IntView>& x);
00410     virtual Actor* copy(Space* home, bool share);
00412     virtual BranchingDesc* description(void);
00414     virtual ExecStatus commit(Space* home, unsigned int a, BranchingDesc* d);
00415   };
00416 
00417 }}}
00418 
00419 #include "int/branch/select-val.icc"
00420 #include "int/branch/select-view.icc"
00421 
00422 #include "int/branch/assign.icc"
00423 
00424 #endif
00425 
00426 // STATISTICS: int-branch
00427