Generated on Wed Nov 1 15:04:48 2006 for Gecode by doxygen 1.4.5

set.icc

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Guido Tack <tack@gecode.org>
00004  *
00005  *  Contributing authors:
00006  *     Christian Schulte <schulte@gecode.org>
00007  *     Gabor Szokoli <szokoli@gecode.org>
00008  *
00009  *  Copyright:
00010  *     Guido Tack, 2004
00011  *     Christian Schulte, 2004
00012  *     Gabor Szokoli, 2004
00013  *
00014  *  Last modified:
00015  *     $Date: 2006-03-31 16:57:12 +0200 (Fri, 31 Mar 2006) $ by $Author: tack $
00016  *     $Revision: 3146 $
00017  *
00018  *  This file is part of Gecode, the generic constraint
00019  *  development environment:
00020  *     http://www.gecode.org
00021  *
00022  *  See the file "LICENSE" for information on usage and
00023  *  redistribution of this file, and for a
00024  *     DISCLAIMER OF ALL WARRANTIES.
00025  *
00026  */
00027 
00028 namespace Gecode { namespace Set {
00029 
00030   /*
00031    * Constructors and access
00032    *
00033    */
00034 
00035   forceinline
00036   SetView::SetView(void) {}
00037   forceinline
00038   SetView::SetView(const SetVar& y)
00039     : VariableViewBase<SetVarImp>(y.variable()) {}
00040 
00041 
00042   /*
00043    * Variable information
00044    *
00045    */
00046 
00047   forceinline bool
00048   SetView::assigned(void)  const { return var->assigned(); }
00049 
00050   forceinline unsigned int
00051   SetView::glbSize(void) const { return var->glbSize(); }
00052 
00053   forceinline unsigned int
00054   SetView::lubSize(void) const { return var->lubSize(); }
00055 
00056   forceinline unsigned int
00057   SetView::unknownSize(void) const { return var->lubSize() - var->glbSize(); }
00058 
00059   forceinline bool
00060   SetView::contains(int i) const { return (var->knownIn(i)); }
00061 
00062   forceinline bool
00063   SetView::notContains(int i) const { return (var->knownOut(i)); }
00064 
00065   forceinline unsigned int
00066   SetView::cardMin(void) const { return var->cardMin(); }
00067 
00068   forceinline unsigned int
00069   SetView::cardMax(void) const { return var->cardMax(); }
00070 
00071   forceinline int
00072   SetView::lubMin(void) const { return var->lubMin(); }
00073 
00074   forceinline int
00075   SetView::lubMax(void) const { return var->lubMax(); }
00076 
00077   forceinline int
00078   SetView::lubMinN(int n) const { return var->lubMinN(n); }
00079 
00080   forceinline int
00081   SetView::lubMaxN(int n) const { return var->lubMaxN(n); }
00082 
00083   forceinline int
00084   SetView::glbMin(void) const { return var->glbMin(); }
00085 
00086   forceinline int
00087   SetView::glbMax(void) const { return var->glbMax(); }
00088 
00089   /*
00090    * Tells
00091    *
00092    */
00093 
00094   forceinline ModEvent
00095   SetView::cardMin(Space* home, unsigned int m) {
00096     return var-> cardMin(home, m);
00097   }
00098 
00099   forceinline ModEvent
00100   SetView::cardMax(Space* home, unsigned int m) {
00101     return var-> cardMax(home, m);
00102   }
00103 
00104   forceinline ModEvent
00105   SetView::include (Space* home,int from, int to)
00106   { return (var->include(home,from,to)); }
00107 
00108   forceinline ModEvent
00109   SetView::include (Space* home,int n)
00110   { return (var->include(home,n)); }
00111 
00112   forceinline ModEvent
00113   SetView::exclude (Space* home,int n)
00114   { return (var->exclude(home, n)); }
00115 
00116   forceinline ModEvent
00117   SetView::intersect (Space* home,int from, int to)
00118   { return (var->intersect(home,from,to)); }
00119 
00120   forceinline ModEvent
00121   SetView::intersect (Space* home,int n)
00122   { return (var->intersect(home,n)); }
00123 
00124   template <class I> ModEvent
00125   SetView::includeI (Space* home, I& iter)
00126   { return (var->includeI(home, iter)); }
00127 
00128   forceinline ModEvent
00129   SetView::exclude (Space* home,int from, int to)
00130   { return (var->exclude(home,from,to)); }
00131 
00132   template <class I> ModEvent
00133   SetView::excludeI(Space* home, I& iter) {
00134     return var->excludeI(home, iter);
00135   }
00136 
00137   template <class I> ModEvent
00138   SetView::intersectI(Space* home, I& iter) {
00139     return var->intersectI(home, iter);
00140   }
00141 
00142 
00143 
00144   /*
00145    * Cloning
00146    *
00147    */
00148 
00149   forceinline void
00150   SetView::update(Space* home, bool share, SetView& y) {
00151     var = y.var->copy(home,share);
00152   }
00153 
00158   template <>
00159   class LubRanges<SetView> : public LubRanges<SetVarImp*> {
00160   public:
00162 
00163 
00164     LubRanges(void);
00166     LubRanges(const SetView& x);
00168     void init(const SetView& x);
00170   };
00171 
00172   forceinline
00173   LubRanges<SetView>::LubRanges(void) {}
00174 
00175   forceinline
00176   LubRanges<SetView>::LubRanges(const SetView& x)
00177     : LubRanges<SetVarImp*>(x.variable()) {}
00178 
00179   forceinline void
00180   LubRanges<SetView>::init(const SetView& x) {
00181     LubRanges<SetVarImp*>::init(x.variable());
00182   }
00183 
00184 
00189   template <>
00190   class GlbRanges<SetView> : public GlbRanges<SetVarImp*> {
00191   public:
00193 
00194 
00195     GlbRanges(void);
00197     GlbRanges(const SetView& x);
00199     void init(const SetView& x);
00200   };
00201 
00202   forceinline
00203   GlbRanges<SetView>::GlbRanges(void) {}
00204 
00205   forceinline
00206   GlbRanges<SetView>::GlbRanges(const SetView& x)
00207     : GlbRanges<SetVarImp*>(x.variable()) {}
00208 
00209   forceinline void
00210   GlbRanges<SetView>::init(const SetView& x) {
00211     GlbRanges<SetVarImp*>::init(x.variable());
00212   }
00213 
00214 }}
00215 
00216 // STATISTICS: set-var
00217