gecode » int » linear

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: 2009-09-08 21:10:29 +0200 (Tue, 08 Sep 2009) $ by $Author: schulte $ 00011 * $Revision: 9692 $ 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 ConstViewBase { 00047 public: 00049 00050 00051 NoView(void) {} 00053 void init(void) {} 00055 00057 00058 00059 int min(void) const { return 0; } 00061 int max(void) const { return 0; } 00063 int med(void) const { return 0; } 00065 int val(void) const { return 0; } 00066 00068 unsigned int size(void) const { return 1; } 00070 unsigned int width(void) const { return 1; } 00072 unsigned int regret_min(void) const { return 0; } 00074 unsigned int regret_max(void) const { return 0; } 00076 00078 00079 00080 bool range(void) const { return true; } 00082 bool assigned(void) const { return true; } 00083 00085 bool in(int n) const { n=n; return false; } 00087 bool in(double n) const { n=n; return false; } 00089 00091 00092 00093 ModEvent lq(Space& home, int n) { 00094 (void) home; (void) n; 00095 return ME_INT_NONE; 00096 } 00098 ModEvent lq(Space& home, double n) { 00099 (void) home; (void) n; 00100 return ME_INT_NONE; 00101 } 00103 ModEvent le(Space& home, int n) { 00104 (void) home; (void) n; 00105 return ME_INT_NONE; 00106 } 00108 ModEvent le(Space& home, double n) { 00109 (void) home; (void) n; 00110 return ME_INT_NONE; 00111 } 00113 ModEvent gq(Space& home, int n) { 00114 (void) home; (void) n; 00115 return ME_INT_NONE; 00116 } 00118 ModEvent gq(Space& home, double n) { 00119 (void) home; (void) n; 00120 return ME_INT_NONE; 00121 } 00123 ModEvent gr(Space& home, int n) { 00124 (void) home; (void) n; 00125 return ME_INT_NONE; 00126 } 00128 ModEvent gr(Space& home, double n) { 00129 (void) home; (void) n; 00130 return ME_INT_NONE; 00131 } 00133 ModEvent nq(Space& home, int n) { 00134 (void) home; (void) n; 00135 return ME_INT_NONE; 00136 } 00138 ModEvent nq(Space& home, double n) { 00139 (void) home; (void) n; 00140 return ME_INT_NONE; 00141 } 00143 ModEvent eq(Space& home, int n) { 00144 (void) home; (void) n; 00145 return ME_INT_NONE; 00146 } 00148 ModEvent eq(Space& home, double n) { 00149 (void) home; (void) n; 00150 return ME_INT_NONE; 00151 } 00153 00155 00156 00157 static void schedule(Space& home, Propagator& p, ModEvent me) { 00158 (void) home; (void) p; (void) me; 00159 } 00161 static ModEvent med(const Propagator& p) { 00162 (void) p; 00163 return ME_INT_NONE; 00164 } 00166 static ModEventDelta med(ModEvent me) { 00167 (void) me; 00168 return ME_INT_NONE; 00169 } 00171 00173 00174 00175 void subscribe(Space& home, Propagator& p, PropCond pc, 00176 bool process=true) { 00177 (void) home; (void) p; (void) pc; (void) process; 00178 } 00180 void cancel(Space& home, Propagator& p, PropCond pc) { 00181 (void) home; (void) p; (void) pc; 00182 } 00184 void subscribe(Space&, Advisor&) {}; 00186 void cancel(Space&, Advisor&) {}; 00188 00190 00191 00192 void update(Space& home, bool share, NoView& x) { 00193 (void) home; (void) share; (void) x; 00194 } 00196 00198 00199 00200 bool operator ==(const NoView& x) const { (void) x; return true; } 00202 bool operator !=(const NoView& x) const { (void) x; return false; } 00204 bool operator < (const NoView& x) const { (void) x; return false; } 00206 bool operator > (const NoView& x) const { (void) x; return false; } 00208 }; 00209 00210 }} 00211 00212 00217 template<> 00218 class ViewArray<Int::Linear::NoView> { 00219 public: 00221 00222 00223 ViewArray(void) {} 00225 ViewArray(Space& home, int m) { (void) home; (void) m; } 00227 ViewArray(const ViewArray<Int::Linear::NoView>&) {} 00229 ViewArray(Space&, const ViewArray<Int::Linear::NoView>&) {} 00231 const ViewArray<Int::Linear::NoView>& operator =(const ViewArray<Int::Linear::NoView>&) { return *this; } 00233 00235 00236 00237 int size(void) const { return 0; } 00239 void size(int n) { (void) n; } 00241 00243 00244 00245 Int::Linear::NoView operator [](int i) { 00246 (void) i; 00247 Int::Linear::NoView n; 00248 return n; 00249 } 00251 00253 00254 00255 void subscribe(Space&, Propagator& p, PropCond pc, bool process=true) { 00256 (void) p; (void) pc; (void) process; 00257 } 00259 void cancel(Space& home, Propagator& p, PropCond pc) { 00260 (void) home; (void) p; (void) pc; 00261 } 00263 00265 00266 00273 void update(Space&, bool share, ViewArray<Int::Linear::NoView>& a) { 00274 (void) share; (void) a; 00275 } 00277 00279 00280 00281 void move_fst(int i) { (void) i; } 00283 void move_lst(int i) { (void) i; } 00289 void move_fst(int i, Propagator& p, PropCond pc) { 00290 (void) i; (void) p; (void) pc; 00291 } 00297 void move_lst(int i, Propagator& p, PropCond pc) { 00298 (void) i; (void) p; (void) pc; 00299 } 00301 00303 00304 00305 void drop_fst(int i); 00307 void drop_lst(int i); 00313 void drop_fst(int i, Propagator& p, PropCond pc) { 00314 (void) i; (void) p; (void) pc; 00315 } 00322 void drop_lst(int i, Propagator& p, PropCond pc) { 00323 (void) i; (void) p; (void) pc; 00324 } 00326 00328 00329 00330 bool equal(void) const { return false; } 00332 bool equal(const Int::Linear::NoView& y) const { 00333 (void) y; 00334 return false; 00335 } 00337 void unique(void) {} 00339 00341 00342 00343 bool shared(void) const { return false; } 00345 bool shared(const Int::Linear::NoView& y) const { 00346 (void) y; 00347 return false; 00348 } 00350 00351 private: 00352 static void* operator new(size_t); 00353 static void operator delete(void*,size_t); 00354 }; 00355 00356 } 00357 00358 00359 // STATISTICS: int-prop 00360