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: 2010-06-29 10:39:13 +0200 (Tue, 29 Jun 2010) $ by $Author: schulte $ 00011 * $Revision: 11118 $ 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 { n=n; return false; } 00085 bool in(double n) const { n=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 00153 }} 00154 00155 00160 template<> 00161 class ViewArray<Int::Linear::NoView> { 00162 public: 00164 00165 00166 ViewArray(void) {} 00168 ViewArray(Space& home, int m) { (void) home; (void) m; } 00170 ViewArray(const ViewArray<Int::Linear::NoView>&) {} 00172 ViewArray(Space&, const ViewArray<Int::Linear::NoView>&) {} 00174 const ViewArray<Int::Linear::NoView>& operator =(const ViewArray<Int::Linear::NoView>&) { return *this; } 00176 00178 00179 00180 int size(void) const { return 0; } 00182 void size(int n) { (void) n; } 00184 00186 00187 00188 Int::Linear::NoView operator [](int i) { 00189 (void) i; 00190 Int::Linear::NoView n; 00191 return n; 00192 } 00194 00196 00197 00198 void subscribe(Space&, Propagator& p, PropCond pc, bool process=true) { 00199 (void) p; (void) pc; (void) process; 00200 } 00202 void cancel(Space& home, Propagator& p, PropCond pc) { 00203 (void) home; (void) p; (void) pc; 00204 } 00206 00208 00209 00216 void update(Space&, bool share, ViewArray<Int::Linear::NoView>& a) { 00217 (void) share; (void) a; 00218 } 00220 00222 00223 00224 void move_fst(int i) { (void) i; } 00226 void move_lst(int i) { (void) i; } 00228 private: 00229 static void* operator new(size_t); 00230 static void operator delete(void*,size_t); 00231 }; 00232 00233 } 00234 00235 00236 // STATISTICS: int-prop 00237