Generated on Thu Apr 11 13:59:07 2019 for Gecode by doxygen 1.6.3

set.hpp

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  *
00006  *  Contributing authors:
00007  *     Christian Schulte <schulte@gecode.org>
00008  *     Gabor Szokoli <szokoli@gecode.org>
00009  *
00010  *  Copyright:
00011  *     Guido Tack, 2004
00012  *     Christian Schulte, 2004
00013  *     Gabor Szokoli, 2004
00014  *
00015  *  This file is part of Gecode, the generic constraint
00016  *  development environment:
00017  *     http://www.gecode.org
00018  *
00019  *  Permission is hereby granted, free of charge, to any person obtaining
00020  *  a copy of this software and associated documentation files (the
00021  *  "Software"), to deal in the Software without restriction, including
00022  *  without limitation the rights to use, copy, modify, merge, publish,
00023  *  distribute, sublicense, and/or sell copies of the Software, and to
00024  *  permit persons to whom the Software is furnished to do so, subject to
00025  *  the following conditions:
00026  *
00027  *  The above copyright notice and this permission notice shall be
00028  *  included in all copies or substantial portions of the Software.
00029  *
00030  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00031  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00032  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00033  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00034  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00035  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00036  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00037  *
00038  */
00039 
00040 namespace Gecode { namespace Set {
00041 
00042   /*
00043    * Constructors and access
00044    *
00045    */
00046 
00047   forceinline
00048   SetView::SetView(void) {}
00049   forceinline
00050   SetView::SetView(const SetVar& y)
00051     : VarImpView<SetVar>(y.varimp()) {}
00052   forceinline
00053   SetView::SetView(SetVarImp* y)
00054     : VarImpView<SetVar>(y) {}
00055 
00056   /*
00057    * Variable information
00058    *
00059    */
00060 
00061   forceinline unsigned int
00062   SetView::glbSize(void) const {
00063     return x->glbSize();
00064   }
00065   forceinline unsigned int
00066   SetView::lubSize(void) const {
00067     return x->lubSize();
00068   }
00069   forceinline unsigned int
00070   SetView::unknownSize(void) const {
00071     return x->lubSize() - x->glbSize();
00072   }
00073   forceinline bool
00074   SetView::contains(int i) const {
00075     return x->knownIn(i);
00076   }
00077   forceinline bool
00078   SetView::notContains(int i) const {
00079     return x->knownOut(i);
00080   }
00081   forceinline unsigned int
00082   SetView::cardMin(void) const {
00083     return x->cardMin();
00084   }
00085   forceinline unsigned int
00086   SetView::cardMax(void) const {
00087     return x->cardMax();
00088   }
00089   forceinline int
00090   SetView::lubMin(void) const {
00091     return x->lubMin();
00092   }
00093   forceinline int
00094   SetView::lubMax(void) const {
00095     return x->lubMax();
00096   }
00097   forceinline int
00098   SetView::lubMinN(unsigned int n) const {
00099     return x->lubMinN(n);
00100   }
00101   forceinline int
00102   SetView::glbMin(void) const {
00103     return x->glbMin();
00104   }
00105   forceinline int
00106   SetView::glbMax(void) const {
00107     return x->glbMax();
00108   }
00109 
00110   /*
00111    * Tells
00112    *
00113    */
00114 
00115   forceinline ModEvent
00116   SetView::cardMin(Space& home, unsigned int m) {
00117     return x->cardMin(home, m);
00118   }
00119 
00120   forceinline ModEvent
00121   SetView::cardMax(Space& home, unsigned int m) {
00122     return x->cardMax(home, m);
00123   }
00124 
00125   forceinline ModEvent
00126   SetView::include(Space& home, int from, int to) {
00127     return x->include(home,from,to);
00128   }
00129 
00130   forceinline ModEvent
00131   SetView::include(Space& home, int n) {
00132     return x->include(home,n);
00133   }
00134 
00135   forceinline ModEvent
00136   SetView::exclude(Space& home, int n) {
00137     return x->exclude(home, n);
00138   }
00139 
00140   forceinline ModEvent
00141   SetView::intersect(Space& home, int from, int to) {
00142     return x->intersect(home,from,to);
00143   }
00144 
00145   forceinline ModEvent
00146   SetView::intersect(Space& home, int n) {
00147     return x->intersect(home,n);
00148   }
00149 
00150   template<class I> ModEvent
00151   SetView::includeI(Space& home, I& iter) {
00152     return x->includeI(home, iter);
00153   }
00154 
00155   forceinline ModEvent
00156   SetView::exclude(Space& home, int from, int to) {
00157     return x->exclude(home,from,to);
00158   }
00159   template<class I> ModEvent
00160   SetView::excludeI(Space& home, I& iter) {
00161     return x->excludeI(home, iter);
00162   }
00163   template<class I> ModEvent
00164   SetView::intersectI(Space& home, I& iter) {
00165     return x->intersectI(home, iter);
00166   }
00167 
00168 
00169   /*
00170    * Delta information for advisors
00171    *
00172    */
00173 
00174   forceinline ModEvent
00175   SetView::modevent(const Delta& d) {
00176     return SetVarImp::modevent(d);
00177   }
00178 
00179   forceinline int
00180   SetView::glbMin(const Delta& d) const {
00181     return SetVarImp::glbMin(d);
00182   }
00183   forceinline int
00184   SetView::glbMax(const Delta& d) const {
00185     return SetVarImp::glbMax(d);
00186   }
00187   forceinline bool
00188   SetView::glbAny(const Delta& d) const {
00189     return SetVarImp::glbAny(d);
00190   }
00191 
00192   forceinline int
00193   SetView::lubMin(const Delta& d) const {
00194     return SetVarImp::lubMin(d);
00195   }
00196   forceinline int
00197   SetView::lubMax(const Delta& d) const {
00198     return SetVarImp::lubMax(d);
00199   }
00200   forceinline bool
00201   SetView::lubAny(const Delta& d) const {
00202     return SetVarImp::lubAny(d);
00203   }
00204 
00205 
00210   template<>
00211   class LubRanges<SetView> : public LubRanges<SetVarImp*> {
00212   public:
00214 
00215 
00216     LubRanges(void);
00218     LubRanges(const SetView& x);
00220     void init(const SetView& x);
00222   };
00223 
00224   forceinline
00225   LubRanges<SetView>::LubRanges(void) {}
00226 
00227   forceinline
00228   LubRanges<SetView>::LubRanges(const SetView& x)
00229     : LubRanges<SetVarImp*>(x.varimp()) {}
00230 
00231   forceinline void
00232   LubRanges<SetView>::init(const SetView& x) {
00233     LubRanges<SetVarImp*>::init(x.varimp());
00234   }
00235 
00236 
00241   template<>
00242   class GlbRanges<SetView> : public GlbRanges<SetVarImp*> {
00243   public:
00245 
00246 
00247     GlbRanges(void);
00249     GlbRanges(const SetView& x);
00251     void init(const SetView& x);
00252   };
00253 
00254   forceinline
00255   GlbRanges<SetView>::GlbRanges(void) {}
00256 
00257   forceinline
00258   GlbRanges<SetView>::GlbRanges(const SetView& x)
00259     : GlbRanges<SetVarImp*>(x.varimp()) {}
00260 
00261   forceinline void
00262   GlbRanges<SetView>::init(const SetView& x) {
00263     GlbRanges<SetVarImp*>::init(x.varimp());
00264   }
00265 
00266 }}
00267 
00268 // STATISTICS: set-var
00269