Generated on Thu Mar 22 10:39:39 2012 for Gecode by doxygen 1.6.3

int-noview.hpp

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Christian Schulte <schulte@gecode.org>
00005  *
00006  *  Copyright:
00007  *     Christian Schulte, 2002
00008  *
00009  *  Last modified:
00010  *     $Date: 2011-09-28 14:14:32 +0200 (Wed, 28 Sep 2011) $ by $Author: tack $
00011  *     $Revision: 12417 $
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 namespace Gecode {
00039 
00040   namespace Int { namespace Linear {
00041 
00046     class NoView : public ConstView<IntView> {
00047     public:
00049 
00050 
00051       NoView(void) {}
00053 
00055 
00056 
00057       int min(void) const { return 0; }
00059       int max(void) const { return 0; }
00061       int med(void) const { return 0; }
00063       int val(void) const { return 0; }
00064 
00066       unsigned int size(void) const { return 1; }
00068       unsigned int width(void) const { return 1; }
00070       unsigned int regret_min(void) const { return 0; }
00072       unsigned int regret_max(void) const { return 0; }
00074 
00076 
00077 
00078       bool range(void) const { return true; }
00080       bool assigned(void) const { return true; }
00081 
00083       bool in(int n) const { (void) n; return false; }
00085       bool in(double n) const { (void) n; return false; }
00087 
00089 
00090 
00091       ModEvent lq(Space& home, int n) {
00092         (void) home; (void) n;
00093         return ME_INT_NONE;
00094       }
00096       ModEvent lq(Space& home, double n) {
00097         (void) home; (void) n;
00098         return ME_INT_NONE;
00099       }
00101       ModEvent le(Space& home, int n) {
00102         (void) home; (void) n;
00103         return ME_INT_NONE;
00104       }
00106       ModEvent le(Space& home, double n) {
00107         (void) home; (void) n;
00108         return ME_INT_NONE;
00109       }
00111       ModEvent gq(Space& home, int n) {
00112         (void) home; (void) n;
00113         return ME_INT_NONE;
00114       }
00116       ModEvent gq(Space& home, double n) {
00117         (void) home; (void) n;
00118         return ME_INT_NONE;
00119       }
00121       ModEvent gr(Space& home, int n) {
00122         (void) home; (void) n;
00123         return ME_INT_NONE;
00124       }
00126       ModEvent gr(Space& home, double n) {
00127         (void) home; (void) n;
00128         return ME_INT_NONE;
00129       }
00131       ModEvent nq(Space& home, int n) {
00132         (void) home; (void) n;
00133         return ME_INT_NONE;
00134       }
00136       ModEvent nq(Space& home, double n) {
00137         (void) home; (void) n;
00138         return ME_INT_NONE;
00139       }
00141       ModEvent eq(Space& home, int n) {
00142         (void) home; (void) n;
00143         return ME_INT_NONE;
00144       }
00146       ModEvent eq(Space& home, double n) {
00147         (void) home; (void) n;
00148         return ME_INT_NONE;
00149       }
00151     };
00152 
00157     template<class Char, class Traits>
00158     std::basic_ostream<Char,Traits>&
00159     operator <<(std::basic_ostream<Char,Traits>& os, const NoView&) { return os; }
00160 
00161   }}
00162 
00163 
00168   template<>
00169   class ViewArray<Int::Linear::NoView> {
00170   public:
00172 
00173 
00174     ViewArray(void) {}
00176     ViewArray(Space& home, int m) { (void) home; (void) m; }
00178     ViewArray(const ViewArray<Int::Linear::NoView>&) {}
00180     ViewArray(Space&, const ViewArray<Int::Linear::NoView>&) {}
00182     const ViewArray<Int::Linear::NoView>& operator =(const ViewArray<Int::Linear::NoView>&) { return *this; }
00184 
00186 
00187 
00188     int size(void) const { return 0; }
00190     void size(int n) { (void) n; }
00192 
00194 
00195 
00196     Int::Linear::NoView operator [](int i) {
00197       (void)  i;
00198       Int::Linear::NoView n;
00199       return n;
00200     }
00202     const Int::Linear::NoView operator [](int i) const {
00203       (void)  i;
00204       Int::Linear::NoView n;
00205       return n;
00206     }
00208 
00210 
00211 
00212     void subscribe(Space&, Propagator& p, PropCond pc, bool process=true) {
00213       (void) p; (void) pc; (void) process;
00214     }
00216     void cancel(Space& home, Propagator& p, PropCond pc) {
00217       (void) home; (void) p; (void) pc;
00218     }
00220 
00222 
00223 
00230     void update(Space&, bool share, ViewArray<Int::Linear::NoView>& a) {
00231       (void) share; (void) a;
00232     }
00234 
00236 
00237 
00238     void move_fst(int i) { (void) i; }
00240     void move_lst(int i) { (void) i; }
00242   private:
00243     static void* operator new(size_t);
00244     static void  operator delete(void*,size_t);
00245   };
00246 
00247 }
00248 
00249 
00250 // STATISTICS: int-prop
00251