Generated on Fri Oct 19 11:25:07 2018 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  *  This file is part of Gecode, the generic constraint
00010  *  development environment:
00011  *     http://www.gecode.org
00012  *
00013  *  Permission is hereby granted, free of charge, to any person obtaining
00014  *  a copy of this software and associated documentation files (the
00015  *  "Software"), to deal in the Software without restriction, including
00016  *  without limitation the rights to use, copy, modify, merge, publish,
00017  *  distribute, sublicense, and/or sell copies of the Software, and to
00018  *  permit persons to whom the Software is furnished to do so, subject to
00019  *  the following conditions:
00020  *
00021  *  The above copyright notice and this permission notice shall be
00022  *  included in all copies or substantial portions of the Software.
00023  *
00024  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00025  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00026  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00027  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00028  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00029  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00030  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00031  *
00032  */
00033 
00034 namespace Gecode {
00035 
00036   namespace Int { namespace Linear {
00037 
00042     class NoView : public ConstView<IntView> {
00043     public:
00045 
00046 
00047       NoView(void) {}
00049 
00051 
00052 
00053       int min(void) const { return 0; }
00055       int max(void) const { return 0; }
00057       int med(void) const { return 0; }
00059       int val(void) const { return 0; }
00060 
00062       unsigned int size(void) const { return 1; }
00064       unsigned int width(void) const { return 1; }
00066       unsigned int regret_min(void) const { return 0; }
00068       unsigned int regret_max(void) const { return 0; }
00070 
00072 
00073 
00074       bool range(void) const { return true; }
00076       bool assigned(void) const { return true; }
00077 
00079       bool in(int n) const { (void) n; return false; }
00081       bool in(long long int n) const { (void) n; return false; }
00083 
00085 
00086 
00087       ModEvent lq(Space& home, int n) {
00088         (void) home; (void) n;
00089         return ME_INT_NONE;
00090       }
00092       ModEvent lq(Space& home, long long int n) {
00093         (void) home; (void) n;
00094         return ME_INT_NONE;
00095       }
00097       ModEvent le(Space& home, int n) {
00098         (void) home; (void) n;
00099         return ME_INT_NONE;
00100       }
00102       ModEvent le(Space& home, long long int n) {
00103         (void) home; (void) n;
00104         return ME_INT_NONE;
00105       }
00107       ModEvent gq(Space& home, int n) {
00108         (void) home; (void) n;
00109         return ME_INT_NONE;
00110       }
00112       ModEvent gq(Space& home, long long int n) {
00113         (void) home; (void) n;
00114         return ME_INT_NONE;
00115       }
00117       ModEvent gr(Space& home, int n) {
00118         (void) home; (void) n;
00119         return ME_INT_NONE;
00120       }
00122       ModEvent gr(Space& home, long long int n) {
00123         (void) home; (void) n;
00124         return ME_INT_NONE;
00125       }
00127       ModEvent nq(Space& home, int n) {
00128         (void) home; (void) n;
00129         return ME_INT_NONE;
00130       }
00132       ModEvent nq(Space& home, long long int n) {
00133         (void) home; (void) n;
00134         return ME_INT_NONE;
00135       }
00137       ModEvent eq(Space& home, int n) {
00138         (void) home; (void) n;
00139         return ME_INT_NONE;
00140       }
00142       ModEvent eq(Space& home, long long int n) {
00143         (void) home; (void) n;
00144         return ME_INT_NONE;
00145       }
00147     };
00148 
00153     template<class Char, class Traits>
00154     std::basic_ostream<Char,Traits>&
00155     operator <<(std::basic_ostream<Char,Traits>& os, const NoView&) { return os; }
00156 
00157   }}
00158 
00159 
00164   template<>
00165   class ViewArray<Int::Linear::NoView> {
00166   public:
00168 
00169 
00170     ViewArray(void) {}
00172     ViewArray(Space& home, int m) { (void) home; (void) m; }
00174     ViewArray(const ViewArray<Int::Linear::NoView>&) {}
00176     ViewArray(Space&, const ViewArray<Int::Linear::NoView>&) {}
00178     const ViewArray<Int::Linear::NoView>& operator =(const ViewArray<Int::Linear::NoView>&) { return *this; }
00180 
00182 
00183 
00184     int size(void) const { return 0; }
00186     void size(int n) { (void) n; }
00188 
00190 
00191 
00192     Int::Linear::NoView operator [](int i) {
00193       (void)  i;
00194       Int::Linear::NoView n;
00195       return n;
00196     }
00198     const Int::Linear::NoView operator [](int i) const {
00199       (void)  i;
00200       Int::Linear::NoView n;
00201       return n;
00202     }
00204 
00206 
00207 
00208     void subscribe(Space&, Propagator& p, PropCond pc, bool process=true) {
00209       (void) p; (void) pc; (void) process;
00210     }
00212     void cancel(Space& home, Propagator& p, PropCond pc) {
00213       (void) home; (void) p; (void) pc;
00214     }
00216     void reschedule(Space& home, Propagator& p, PropCond pc) {
00217       (void) home; (void) p; (void) pc;
00218     }
00220 
00222 
00223 
00224     void update(Space& home, ViewArray<Int::Linear::NoView>& a) {
00225       (void) home; (void) a;
00226     }
00228 
00230 
00231 
00232     void move_fst(int i) { (void) i; }
00234     void move_lst(int i) { (void) i; }
00236   private:
00237     static void* operator new(size_t);
00238     static void  operator delete(void*,size_t);
00239   };
00240 
00241 }
00242 
00243 
00244 // STATISTICS: int-prop
00245