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

int.icc

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: 2006-08-04 16:03:26 +0200 (Fri, 04 Aug 2006) $ by $Author: schulte $
00010  *     $Revision: 3512 $
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 namespace Gecode { namespace Int {
00023 
00024   /*
00025    * Constructors and initialization
00026    *
00027    */
00028   forceinline
00029   IntView::IntView(void) {}
00030   forceinline
00031   IntView::IntView(const IntVar& x)
00032     : VariableViewBase<IntVarImp>(x.variable()) {}
00033 
00034 
00035   /*
00036    * Value access
00037    *
00038    */
00039   forceinline int
00040   IntView::min(void) const {
00041     return var->min();
00042   }
00043   forceinline int
00044   IntView::max(void) const {
00045     return var->max();
00046   }
00047   forceinline int
00048   IntView::med(void) const {
00049     return var->med();
00050   }
00051   forceinline int
00052   IntView::val(void) const {
00053     return var->val();
00054   }
00055 
00056   forceinline unsigned int
00057   IntView::size(void) const {
00058     return var->size();
00059   }
00060   forceinline unsigned int
00061   IntView::width(void) const {
00062     return var->width();
00063   }
00064   forceinline unsigned int
00065   IntView::regret_min(void) const {
00066     return var->regret_min();
00067   }
00068   forceinline unsigned int
00069   IntView::regret_max(void) const {
00070     return var->regret_max();
00071   }
00072 
00073 
00074   /*
00075    * Domain tests
00076    *
00077    */
00078   forceinline bool
00079   IntView::range(void) const {
00080     return var->range();
00081   }
00082   forceinline bool
00083   IntView::assigned(void) const {
00084     return var->assigned();
00085   }
00086 
00087   forceinline bool
00088   IntView::in(int n) const {
00089     return var->in(n);
00090   }
00091   forceinline bool
00092   IntView::in(double n) const {
00093     return var->in(n);
00094   }
00095 
00096 
00097   /*
00098    * Domain update by value
00099    *
00100    */
00101   forceinline ModEvent
00102   IntView::lq(Space* home, int n) {
00103     return var->lq(home,n);
00104   }
00105   forceinline ModEvent
00106   IntView::lq(Space* home, double n) {
00107     return var->lq(home,n);
00108   }
00109 
00110   forceinline ModEvent
00111   IntView::le(Space* home, int n) {
00112     return var->lq(home,n-1);
00113   }
00114   forceinline ModEvent
00115   IntView::le(Space* home, double n) {
00116     return lq(home,n-1.0);
00117   }
00118 
00119   forceinline ModEvent
00120   IntView::gq(Space* home, int n) {
00121     return var->gq(home,n);
00122   }
00123   forceinline ModEvent
00124   IntView::gq(Space* home, double n) {
00125     return var->gq(home,n);
00126   }
00127 
00128   forceinline ModEvent
00129   IntView::gr(Space* home, int n) {
00130     return var->gq(home,n+1);
00131   }
00132   forceinline ModEvent
00133   IntView::gr(Space* home, double n) {
00134     return gq(home,n+1.0);
00135   }
00136 
00137   forceinline ModEvent
00138   IntView::nq(Space* home, int n) {
00139     return var->nq(home,n);
00140   }
00141   forceinline ModEvent
00142   IntView::nq(Space* home, double n) {
00143     return var->nq(home,n);
00144   }
00145 
00146   forceinline ModEvent
00147   IntView::eq(Space* home, int n) {
00148     return var->eq(home,n);
00149   }
00150   forceinline ModEvent
00151   IntView::eq(Space* home, double n) {
00152     return var->eq(home,n);
00153   }
00154 
00155 
00156   /*
00157    * Domain update by range iterator
00158    *
00159    */
00160   template <class I>
00161   forceinline ModEvent
00162   IntView::narrow(Space* home, I& i) {
00163     return var->narrow(home,i);
00164   }
00165   template <class I>
00166   forceinline ModEvent
00167   IntView::inter(Space* home, I& i) {
00168     return var->inter(home,i);
00169   }
00170   template <class I>
00171   forceinline ModEvent
00172   IntView::minus(Space* home, I& i) {
00173     return var->minus(home,i);
00174   }
00175 
00176 
00177   /*
00178    * Cloning
00179    *
00180    */
00181   forceinline void
00182   IntView::update(Space* home, bool share, IntView& x) {
00183     var = x.var->copy(home,share);
00184   }
00185 
00186 
00187 
00192   template <>
00193   class ViewRanges<IntView> : public IntVarImpFwd {
00194   public:
00196 
00197 
00198     ViewRanges(void);
00200     ViewRanges(const IntView& x);
00202     void init(const IntView& x);
00204   };
00205 
00206   forceinline
00207   ViewRanges<IntView>::ViewRanges(void) {}
00208 
00209   forceinline
00210   ViewRanges<IntView>::ViewRanges(const IntView& x)
00211     : IntVarImpFwd(x.variable()) {}
00212 
00213   forceinline void
00214   ViewRanges<IntView>::init(const IntView& x) {
00215     IntVarImpFwd::init(x.variable());
00216   }
00217 
00218 }}
00219 
00220 // STATISTICS: int-var
00221