Generated on Tue Mar 5 2013 22:37:23 for Gecode by doxygen 1.8.3.1
int-noview.hpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Christian Schulte <schulte@gecode.org>
5  *
6  * Copyright:
7  * Christian Schulte, 2002
8  *
9  * Last modified:
10  * $Date: 2011-09-28 22:14:32 +1000 (Wed, 28 Sep 2011) $ by $Author: tack $
11  * $Revision: 12417 $
12  *
13  * This file is part of Gecode, the generic constraint
14  * development environment:
15  * http://www.gecode.org
16  *
17  * Permission is hereby granted, free of charge, to any person obtaining
18  * a copy of this software and associated documentation files (the
19  * "Software"), to deal in the Software without restriction, including
20  * without limitation the rights to use, copy, modify, merge, publish,
21  * distribute, sublicense, and/or sell copies of the Software, and to
22  * permit persons to whom the Software is furnished to do so, subject to
23  * the following conditions:
24  *
25  * The above copyright notice and this permission notice shall be
26  * included in all copies or substantial portions of the Software.
27  *
28  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35  *
36  */
37 
38 namespace Gecode {
39 
40  namespace Int { namespace Linear {
41 
46  class NoView : public ConstView<IntView> {
47  public:
49 
50 
51  NoView(void) {}
53 
55 
56 
57  int min(void) const { return 0; }
59  int max(void) const { return 0; }
61  int med(void) const { return 0; }
63  int val(void) const { return 0; }
64 
66  unsigned int size(void) const { return 1; }
68  unsigned int width(void) const { return 1; }
70  unsigned int regret_min(void) const { return 0; }
72  unsigned int regret_max(void) const { return 0; }
74 
76 
77 
78  bool range(void) const { return true; }
80  bool assigned(void) const { return true; }
81 
83  bool in(int n) const { (void) n; return false; }
85  bool in(double n) const { (void) n; return false; }
87 
89 
90 
91  ModEvent lq(Space& home, int n) {
92  (void) home; (void) n;
93  return ME_INT_NONE;
94  }
96  ModEvent lq(Space& home, double n) {
97  (void) home; (void) n;
98  return ME_INT_NONE;
99  }
101  ModEvent le(Space& home, int n) {
102  (void) home; (void) n;
103  return ME_INT_NONE;
104  }
106  ModEvent le(Space& home, double n) {
107  (void) home; (void) n;
108  return ME_INT_NONE;
109  }
111  ModEvent gq(Space& home, int n) {
112  (void) home; (void) n;
113  return ME_INT_NONE;
114  }
116  ModEvent gq(Space& home, double n) {
117  (void) home; (void) n;
118  return ME_INT_NONE;
119  }
121  ModEvent gr(Space& home, int n) {
122  (void) home; (void) n;
123  return ME_INT_NONE;
124  }
126  ModEvent gr(Space& home, double n) {
127  (void) home; (void) n;
128  return ME_INT_NONE;
129  }
131  ModEvent nq(Space& home, int n) {
132  (void) home; (void) n;
133  return ME_INT_NONE;
134  }
136  ModEvent nq(Space& home, double n) {
137  (void) home; (void) n;
138  return ME_INT_NONE;
139  }
141  ModEvent eq(Space& home, int n) {
142  (void) home; (void) n;
143  return ME_INT_NONE;
144  }
146  ModEvent eq(Space& home, double n) {
147  (void) home; (void) n;
148  return ME_INT_NONE;
149  }
151  };
152 
157  template<class Char, class Traits>
158  std::basic_ostream<Char,Traits>&
159  operator <<(std::basic_ostream<Char,Traits>& os, const NoView&) { return os; }
160 
161  }}
162 
163 
168  template<>
169  class ViewArray<Int::Linear::NoView> {
170  public:
172 
173 
174  ViewArray(void) {}
176  ViewArray(Space& home, int m) { (void) home; (void) m; }
184 
186 
187 
188  int size(void) const { return 0; }
190  void size(int n) { (void) n; }
192 
194 
195 
197  (void) i;
199  return n;
200  }
202  const Int::Linear::NoView operator [](int i) const {
203  (void) i;
205  return n;
206  }
208 
210 
211 
212  void subscribe(Space&, Propagator& p, PropCond pc, bool process=true) {
213  (void) p; (void) pc; (void) process;
214  }
216  void cancel(Space& home, Propagator& p, PropCond pc) {
217  (void) home; (void) p; (void) pc;
218  }
220 
222 
223 
231  (void) share; (void) a;
232  }
234 
236 
237 
238  void move_fst(int i) { (void) i; }
240  void move_lst(int i) { (void) i; }
242  private:
243  static void* operator new(size_t);
244  static void operator delete(void*,size_t);
245  };
246 
247 }
248 
249 
250 // STATISTICS: int-prop
251