Generated on Fri Jan 28 2022 04:43:06 for Gecode by doxygen 1.8.13
const.hpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Guido Tack <tack@gecode.org>
5  *
6  * Copyright:
7  * Guido Tack, 2004
8  *
9  * This file is part of Gecode, the generic constraint
10  * development environment:
11  * http://www.gecode.org
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining
14  * a copy of this software and associated documentation files (the
15  * "Software"), to deal in the Software without restriction, including
16  * without limitation the rights to use, copy, modify, merge, publish,
17  * distribute, sublicense, and/or sell copies of the Software, and to
18  * permit persons to whom the Software is furnished to do so, subject to
19  * the following conditions:
20  *
21  * The above copyright notice and this permission notice shall be
22  * included in all copies or substantial portions of the Software.
23  *
24  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31  *
32  */
33 
34 namespace Gecode { namespace Set {
35 
40  class ArrayRanges {
41  private:
42  int *_ranges;
43  int _size;
44  int _pos;
45  public:
47 
48  ArrayRanges(void) : _ranges(NULL), _size(0), _pos(0) {}
51  ArrayRanges(int *ranges, int size)
52  : _ranges(ranges), _size(size), _pos(0) {}
54  void init(int* ranges, int size) {
55  _ranges = ranges; _size = size; _pos = 0;
56  }
58 
60 
61  bool operator ()(void) const { return _pos<_size; }
64  void operator ++(void) { _pos++; }
66 
68 
69  int min(void) const { return _ranges[_pos*2]; }
72  int max(void) const { return _ranges[_pos*2+1]; }
74  unsigned int width(void) const {
75  return static_cast<unsigned int>(_ranges[_pos*2+1]-_ranges[_pos*2]+1);
76  }
78  };
79 
81  ConstSetView::ConstSetView(void) : ranges(NULL), size(0), domSize(0) {}
82 
85  size = dom.ranges();
86  domSize = 0;
87  if (size > 0) {
88  ranges = home.alloc<int>(2*size);
89  IntSetRanges dr(dom);
90  for (int i=0; dr(); ++dr, i+=2) {
91  int min = dr.min(); int max = dr.max();
92  ranges[i] = min;
93  ranges[i+1] = max;
94  domSize += static_cast<unsigned int>(max-min+1);
95  }
96  } else {
97  ranges = NULL;
98  }
99  }
100 
101  forceinline unsigned int
102  ConstSetView::glbSize(void) const { return domSize; }
103 
104  forceinline unsigned int
105  ConstSetView::lubSize(void) const { return domSize; }
106 
107  forceinline unsigned int
108  ConstSetView::unknownSize(void) const { return 0; }
109 
110  forceinline bool
112  for (int j=size; j--; ) {
113  if (ranges[2*j+1] < i)
114  return false;
115  if (ranges[2*j] >= i)
116  return true;
117  }
118  return false;
119  }
120 
121  forceinline bool
123  return !contains(i);
124  }
125 
126  forceinline unsigned int
127  ConstSetView::cardMin(void) const { return domSize; }
128 
129  forceinline unsigned int
130  ConstSetView::cardMax(void) const { return domSize; }
131 
132  forceinline int
133  ConstSetView::lubMin(void) const {
134  return size==0 ? BndSet::MIN_OF_EMPTY : ranges[0];
135  }
136 
137  forceinline int
138  ConstSetView::lubMax(void) const {
139  return size==0 ? BndSet::MAX_OF_EMPTY : ranges[size*2-1];
140  }
141 
142  forceinline int
143  ConstSetView::glbMin(void) const { return lubMin(); }
144 
145  forceinline int
146  ConstSetView::glbMax(void) const { return lubMax(); }
147 
149  ConstSetView::cardMin(Space&,unsigned int c) {
150  return c<=domSize ? ME_SET_NONE : ME_SET_FAILED;
151  }
152 
154  ConstSetView::cardMax(Space&,unsigned int c) {
155  return c>=domSize ? ME_SET_NONE : ME_SET_FAILED;
156  }
157 
160  return contains(c) ? ME_SET_NONE : ME_SET_FAILED;
161  }
162 
165  return contains(c) ? ME_SET_FAILED : ME_SET_NONE;
166  }
167 
170  return (size==0 ||
171  (size==1 &&
172  ranges[0]==ranges[1] && ranges[0]==c)) ?
174  }
175 
178  return (glbMin()>=i && glbMax()<=j) ?
180  }
181 
184  Iter::Ranges::Singleton single(i,j);
185  ArrayRanges ar(ranges, size);
186  return (single() && Iter::Ranges::subset(single, ar)) ?
188  }
189 
192  Iter::Ranges::Singleton single(i,j);
193  ArrayRanges ar(ranges, size);
194  return (single() && Iter::Ranges::subset(single, ar)) ?
196  }
197 
198  template<class I> ModEvent
200  ArrayRanges ar(ranges, size);
201  return (i() && Iter::Ranges::subset(i, ar)) ? ME_SET_FAILED : ME_SET_NONE;
202  }
203 
204  template<class I> ModEvent
206  ArrayRanges ar(ranges, size);
208  }
209 
210  template<class I> ModEvent
212  ArrayRanges ar(ranges, size);
214  }
215 
216  forceinline void
219  // dispose old ranges
220  if (size > 0)
221  home.free<int>(ranges, 2);
222 
223  domSize = p.domSize;
224  size = p.size;
225  if (size == 0) {
226  ranges = NULL;
227  } else {
228  // copy ranges from p
229  ranges = home.alloc<int>(2*size);
230  for (int i=size; i--; ) {
231  ranges[2*i] = p.ranges[2*i];
232  ranges[2*i+1] = p.ranges[2*i+1];
233  }
234  }
235  }
236 
237 
238  /*
239  * Delta information for advisors
240  *
241  */
242  forceinline int
243  ConstSetView::glbMin(const Delta&) const {
244  GECODE_NEVER;
245  return 0;
246  }
247  forceinline int
248  ConstSetView::glbMax(const Delta&) const {
249  GECODE_NEVER;
250  return 0;
251  }
252  forceinline bool
253  ConstSetView::glbAny(const Delta&) const {
254  GECODE_NEVER;
255  return false;
256  }
257  forceinline int
258  ConstSetView::lubMin(const Delta&) const {
259  GECODE_NEVER;
260  return 0;
261  }
262  forceinline int
263  ConstSetView::lubMax(const Delta&) const {
264  GECODE_NEVER;
265  return 0;
266  }
267  forceinline bool
268  ConstSetView::lubAny(const Delta&) const {
269  GECODE_NEVER;
270  return false;
271  }
272 
275 
276 
277 
278  forceinline unsigned int
279  EmptyView::glbSize(void) const { return 0; }
280 
281  forceinline unsigned int
282  EmptyView::lubSize(void) const { return 0; }
283 
284  forceinline unsigned int
285  EmptyView::unknownSize(void) const { return 0; }
286 
287  forceinline bool
288  EmptyView::contains(int) const { return false; }
289 
290  forceinline bool
291  EmptyView::notContains(int) const { return true; }
292 
293  forceinline unsigned int
294  EmptyView::cardMin(void) const { return 0; }
295 
296  forceinline unsigned int
297  EmptyView::cardMax(void) const { return 0; }
298 
299  forceinline int
300  EmptyView::lubMin(void) const { return 0; }
301 
302  forceinline int
303  EmptyView::lubMax(void) const { return 0; }
304 
305  forceinline int
306  EmptyView::glbMin(void) const { return 0; }
307 
308  forceinline int
309  EmptyView::glbMax(void) const { return 0; }
310 
312  EmptyView::cardMin(Space&,unsigned int c) {
313  return c==0 ? ME_SET_NONE : ME_SET_FAILED;
314  }
315 
317  EmptyView::cardMax(Space&,unsigned int) {
318  return ME_SET_NONE;
319  }
320 
321 
324  return ME_SET_FAILED;
325  }
326 
329 
332 
334  EmptyView::intersect(Space&,int,int) { return ME_SET_NONE; }
335 
338  return ME_SET_FAILED; }
339 
341  EmptyView::exclude(Space&,int,int) { return ME_SET_NONE; }
342 
343  template<class I> ModEvent
345  return ME_SET_NONE;
346  }
347 
348  template<class I> ModEvent
350  return i() ? ME_SET_FAILED : ME_SET_NONE;
351  }
352 
353  template<class I> ModEvent
355  return ME_SET_NONE;
356  }
357 
358  /*
359  * Delta information for advisors
360  *
361  */
362  forceinline int
363  EmptyView::glbMin(const Delta&) const {
364  GECODE_NEVER;
365  return 0;
366  }
367 
368  forceinline int
369  EmptyView::glbMax(const Delta&) const {
370  GECODE_NEVER;
371  return 0;
372  }
373 
374  forceinline bool
375  EmptyView::glbAny(const Delta&) const {
376  GECODE_NEVER;
377  return false;
378  }
379 
380  forceinline int
381  EmptyView::lubMin(const Delta&) const {
382  GECODE_NEVER;
383  return 0;
384  }
385 
386  forceinline int
387  EmptyView::lubMax(const Delta&) const {
388  GECODE_NEVER;
389  return 0;
390  }
391 
392  forceinline bool
393  EmptyView::lubAny(const Delta&) const {
394  GECODE_NEVER;
395  return false;
396  }
397 
398  // Constant universe variable
399 
402 
403  forceinline unsigned int
404  UniverseView::glbSize(void) const { return Set::Limits::card; }
405 
406  forceinline unsigned int
407  UniverseView::lubSize(void) const { return Set::Limits::card; }
408 
409  forceinline unsigned int
410  UniverseView::unknownSize(void) const { return 0; }
411 
412  forceinline bool
413  UniverseView::contains(int) const { return true; }
414 
415  forceinline bool
416  UniverseView::notContains(int) const { return false; }
417 
418  forceinline unsigned int
419  UniverseView::cardMin(void) const { return Set::Limits::card; }
420 
421  forceinline unsigned int
422  UniverseView::cardMax(void) const { return Limits::card; }
423 
424  forceinline int
425  UniverseView::lubMin(void) const { return Limits::card; }
426 
427  forceinline int
428  UniverseView::lubMax(void) const { return Limits::card; }
429 
430  forceinline int
431  UniverseView::glbMin(void) const { return Limits::card; }
432 
433  forceinline int
434  UniverseView::glbMax(void) const { return Limits::card; }
435 
437  UniverseView::cardMin(Space&,unsigned int c) {
439  }
440 
442  UniverseView::cardMax(Space&,unsigned int c) {
443  return c>=Limits::card ? ME_SET_NONE : ME_SET_FAILED;
444  }
445 
446 
449  return ME_SET_NONE;
450  }
451 
454 
457 
460 
463 
464  template<class I> ModEvent
466  return i() ? ME_SET_FAILED : ME_SET_NONE;
467  }
468 
469  template<class I> forceinline ModEvent
471  return ME_SET_NONE;
472  }
473 
476  return (i>Limits::min ||
478  }
479 
480  template<class I> forceinline ModEvent
482  return (i() &&
483  (i.min()>Limits::min ||
484  i.max()<Limits::max) ) ?
486  }
487 
488 
489  /*
490  * Delta information for advisors
491  *
492  */
493  forceinline int
494  UniverseView::glbMin(const Delta&) const {
495  GECODE_NEVER;
496  return 0;
497  }
498 
499  forceinline int
500  UniverseView::glbMax(const Delta&) const {
501  GECODE_NEVER;
502  return 0;
503  }
504 
505  forceinline bool
506  UniverseView::glbAny(const Delta&) const {
507  GECODE_NEVER;
508  return false;
509  }
510 
511  forceinline int
512  UniverseView::lubMin(const Delta&) const {
513  GECODE_NEVER;
514  return 0;
515  }
516 
517  forceinline int
518  UniverseView::lubMax(const Delta&) const {
519  GECODE_NEVER;
520  return 0;
521  }
522 
523  forceinline bool
524  UniverseView::lubAny(const Delta&) const {
525  GECODE_NEVER;
526  return false;
527  }
528 
529  /*
530  * Iterators
531  *
532  */
533 
538  template<>
540  public:
542 
543  LubRanges(void) {}
546  LubRanges(const EmptyView& x) { (void)x; }
548  void init(const EmptyView& x) { (void)x; }
550  };
551 
556  template<>
558  public:
560 
561  GlbRanges(void) {}
564  GlbRanges(const EmptyView& x) { (void)x; }
566  void init(const EmptyView& x) { (void)x; }
568  };
569 
574  template<>
576  public:
578 
579  LubRanges(void)
582  Limits::max) {}
585  : Iter::Ranges::Singleton(Limits::min,
586  Limits::max) {
587  (void)x;
588  }
590  void init(const UniverseView& x) { (void)x; }
592  };
593 
598  template<>
600  public:
602 
603  GlbRanges(void)
606  Limits::max) {}
609  : Iter::Ranges::Singleton(Limits::min,
610  Limits::max) {
611  (void)x;
612  }
614  void init(const UniverseView& x) { (void)x; }
616  };
617 
618 
623  template<>
625  private:
626  ArrayRanges ar;
627  public:
629 
630  LubRanges(void) {}
633  LubRanges(const ConstSetView& x) : ar(x.ranges,x.size) {}
635  void init(const ConstSetView& x) {
636  ar.init(x.ranges,x.size);
637  }
639 
641 
642  bool operator ()(void) const { return ar(); }
645  void operator ++(void) { ++ar; }
647 
649 
650  int min(void) const { return ar.min(); }
653  int max(void) const { return ar.max(); }
655  unsigned int width(void) const { return ar.width(); }
657  };
658 
663  template<>
664  class GlbRanges<ConstSetView> : public LubRanges<ConstSetView> {
665  public:
667 
668  GlbRanges(void) {}
673  void init(const ConstSetView& x) {
675  }
677  };
678 
679  forceinline bool
681  if (size < y.size)
682  return true;
683  if (size > y.size)
684  return false;
685  if (domSize < y.domSize)
686  return true;
687  if (domSize > y.domSize)
688  return false;
689  for (int i=size; i--; ) {
690  if (ranges[2*i] < y.ranges[2*i])
691  return true;
692  if (ranges[2*i] > y.ranges[2*i])
693  return false;
694  if (ranges[2*i+1] < y.ranges[2*i+1])
695  return true;
696  if (ranges[2*i+1] > y.ranges[2*i+1])
697  return false;
698  }
699  return false;
700  }
701 
702  /*
703  * Testing
704  *
705  */
706  forceinline bool
708  if ((x.size != y.size) || (x.domSize != y.domSize))
709  return false;
710  for (int i=x.size; i--; )
711  if ((x.ranges[2*i] != y.ranges[2*i]) ||
712  (x.ranges[2*i+1] != y.ranges[2*i+1]))
713  return false;
714  return true;
715  }
716  forceinline bool
718  return !(x == y);
719  }
720 
721 
722  forceinline bool
723  operator ==(const EmptyView&, const EmptyView&) {
724  return true;
725  }
726  forceinline bool
727  operator !=(const EmptyView&, const EmptyView&) {
728  return false;
729  }
730 
731  forceinline bool
733  return true;
734  }
735  forceinline bool
737  return false;
738  }
739 
740 }}
741 
742 // STATISTICS: set-var
743 
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: const.hpp:404
unsigned int cardMax(void) const
Return maximum cardinality.
Definition: const.hpp:297
const Gecode::ModEvent ME_SET_FAILED
Domain operation has resulted in failure.
Definition: var-type.hpp:138
ConstSetView(void)
Default constructor.
Definition: const.hpp:81
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition: const.hpp:434
Range iterator for singleton range.
ArrayRanges(void)
Default constructor.
Definition: const.hpp:49
const int min
Smallest allowed integer in integer set.
Definition: set.hh:99
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition: const.hpp:108
Range iterator for integer sets.
Definition: int.hh:292
unsigned int cardMax(void) const
Return maximum cardinality.
Definition: const.hpp:130
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: const.hpp:413
LubRanges(const ConstSetView &x)
Initialize with ranges for view x.
Definition: const.hpp:633
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:49
unsigned int cardMin(void) const
Return minimum cardinality.
Definition: const.hpp:127
void init(const UniverseView &x)
Initialize with ranges for view x.
Definition: const.hpp:614
void init(const EmptyView &x)
Initialize with ranges for view x.
Definition: const.hpp:548
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: const.hpp:253
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition: dom.cpp:40
int ModEvent
Type for modification events.
Definition: core.hpp:62
ModEvent include(Space &home, int i, int j)
Update greatest lower bound to include all elements between and including i and j.
Definition: const.hpp:337
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition: const.hpp:306
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition: const.hpp:481
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition: const.hpp:410
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition: const.hpp:285
Range iterator for the greatest lower bound.
Definition: var-imp.hpp:359
void init(const ConstSetView &x)
Initialize with ranges for view x.
Definition: const.hpp:635
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: const.hpp:102
ModEvent intersect(Space &home, int i, int j)
Update least upper bound to contain at most all elements between and including i and j...
Definition: const.hpp:334
static const int MIN_OF_EMPTY
Returned by empty sets when asked for their minimum element.
Definition: var-imp.hpp:112
int max(void) const
Return largest value of range.
Definition: const.hpp:72
#define forceinline
Definition: config.hpp:185
const unsigned int card
Maximum cardinality of an integer set.
Definition: set.hh:101
const int max
Largest allowed integer in integer set.
Definition: set.hh:97
Computation spaces.
Definition: core.hpp:1701
Range iterator for the least upper bound.
Definition: var-imp.hpp:317
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: const.hpp:282
UniverseView(void)
Default constructor.
Definition: const.hpp:401
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
Definition: const.hpp:74
int lubMin(void) const
Return minimum of the least upper bound.
Definition: const.hpp:425
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition: const.hpp:465
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition: const.hpp:143
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
Definition: core.hpp:2794
ArrayRanges(int *ranges, int size)
Initialize with ranges for array ranges which is of size size.
Definition: const.hpp:51
void init(const UniverseView &x)
Initialize with ranges for view x.
Definition: const.hpp:590
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: const.hpp:506
int lubMax(void) const
Return maximum of the least upper bound.
Definition: const.hpp:138
static const int MAX_OF_EMPTY
Returned by empty sets when asked for their maximum element.
Definition: var-imp.hpp:110
Gecode::FloatVal c(-8, 8)
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition: const.hpp:199
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition: const.hpp:205
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:232
GlbRanges(const ConstSetView &x)
Initialize with ranges for view x.
Definition: const.hpp:671
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition: const.hpp:146
ModEvent exclude(Space &home, int i, int j)
Restrict least upper bound to not contain all elements between and including i and j...
Definition: const.hpp:462
Gecode::IntArgs i({1, 2, 3, 4})
bool operator<(const ConstSetView &y) const
Whether this view comes before view y (arbitray order)
Definition: const.hpp:680
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: const.hpp:279
Constant view for the universe.
Definition: view.hpp:464
int lubMax(void) const
Return maximum of the least upper bound.
Definition: const.hpp:303
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: const.hpp:375
unsigned int size(I &i)
Size of all ranges of range iterator i.
EmptyView(void)
Default constructor.
Definition: const.hpp:274
ModEvent exclude(Space &home, int i, int j)
Restrict least upper bound to not contain all elements between and including i and j...
Definition: const.hpp:191
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition: const.hpp:344
Integer sets.
Definition: int.hh:174
const Gecode::ModEvent ME_SET_NONE
Domain operation has not changed domain.
Definition: var-type.hpp:140
void init(const ConstSetView &x)
Initialize with ranges for view x.
Definition: const.hpp:673
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition: const.hpp:470
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: const.hpp:407
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: const.hpp:416
bool operator()(void) const
Test whether iterator is still at a range or done.
Definition: const.hpp:62
LubRanges(const EmptyView &x)
Initialize with ranges for view x.
Definition: const.hpp:546
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: const.hpp:288
ModEvent intersect(Space &home, int i, int j)
Update least upper bound to contain at most all elements between and including i and j...
Definition: const.hpp:475
GlbRanges(const UniverseView &x)
Initialize with ranges for view x.
Definition: const.hpp:608
ModEvent exclude(Space &home, int i, int j)
Restrict least upper bound to not contain all elements between and including i and j...
Definition: const.hpp:341
LubRanges(const UniverseView &x)
Initialize with ranges for view x.
Definition: const.hpp:584
void free(T *b, long unsigned int n)
Delete n objects allocated from space heap starting at b.
Definition: core.hpp:2820
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:67
void init(int *ranges, int size)
Initialize with ranges for array ranges which is of size size.
Definition: const.hpp:54
void update(Space &home, ConstSetView &y)
Update this view to be a clone of view y.
Definition: const.hpp:217
int max(void) const
Return largest value of range.
Definition: const.hpp:653
int lubMin(void) const
Return minimum of the least upper bound.
Definition: const.hpp:133
Post propagator for SetVar SetOpType SetVar y
Definition: set.hh:767
Constant view.
Definition: view.hpp:186
Generic domain change information to be supplied to advisors.
Definition: core.hpp:203
void init(const EmptyView &x)
Initialize with ranges for view x.
Definition: const.hpp:566
GlbRanges(const EmptyView &x)
Initialize with ranges for view x.
Definition: const.hpp:564
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition: const.hpp:349
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: const.hpp:268
ModEvent include(Space &home, int i, int j)
Update greatest lower bound to include all elements between and including i and j.
Definition: const.hpp:459
unsigned int cardMin(void) const
Return minimum cardinality.
Definition: const.hpp:419
bool operator==(const ConstSetView &x, const ConstSetView &y)
Test whether views x and y are the same.
Definition: const.hpp:707
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition: const.hpp:354
void init(const T &x)
Initialize with least upper bound ranges for set variable x.
Definition: set.hpp:465
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition: const.hpp:431
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: const.hpp:122
ModEvent intersect(Space &home, int i, int j)
Update least upper bound to contain at most all elements between and including i and j...
Definition: const.hpp:177
Post propagator for SetVar x
Definition: set.hh:767
unsigned int cardMin(void) const
Return minimum cardinality.
Definition: const.hpp:294
int ranges(void) const
Return number of ranges of the specification.
Definition: int-set-1.hpp:168
void update(Space &home, ConstView &y)
Update this view to be a clone of view y.
Definition: view.hpp:461
bool subset(I &i, J &j)
Check whether range iterator i is subset of range iterator j.
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: const.hpp:291
Range iterator for a two-dimensional array
Definition: const.hpp:40
Gecode toplevel namespace
ModEvent include(Space &home, int i, int j)
Update greatest lower bound to include all elements between and including i and j.
Definition: const.hpp:183
int lubMax(void) const
Return maximum of the least upper bound.
Definition: const.hpp:428
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: const.hpp:111
Range iterator for empty range.
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: const.hpp:393
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: const.hpp:524
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition: const.hpp:309
int min(void) const
Return smallest value of range.
Definition: const.hpp:70
Constant view for the empty set.
Definition: view.hpp:336
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
Definition: const.hpp:655
int lubMin(void) const
Return minimum of the least upper bound.
Definition: const.hpp:300
void operator++(void)
Move iterator to next range (if possible)
Definition: const.hpp:64
#define GECODE_NEVER
Assert that this command is never executed.
Definition: macros.hpp:56
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition: const.hpp:211
unsigned int cardMax(void) const
Return maximum cardinality.
Definition: const.hpp:422
bool operator!=(const ConstSetView &x, const ConstSetView &y)
Test whether views x and y are not the same.
Definition: const.hpp:717
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: const.hpp:105