Generated on Sat Feb 7 2015 02:01:18 for Gecode by doxygen 1.8.9.1
view.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  * Contributing authors:
7  * Christian Schulte <schulte@gecode.org>
8  *
9  * Copyright:
10  * Guido Tack, 2004
11  * Christian Schulte, 2004
12  *
13  * Last modified:
14  * $Date: 2011-08-19 16:47:28 +0200 (Fri, 19 Aug 2011) $ by $Author: tack $
15  * $Revision: 12318 $
16  *
17  * This file is part of Gecode, the generic constraint
18  * development environment:
19  * http://www.gecode.org
20  *
21  * Permission is hereby granted, free of charge, to any person obtaining
22  * a copy of this software and associated documentation files (the
23  * "Software"), to deal in the Software without restriction, including
24  * without limitation the rights to use, copy, modify, merge, publish,
25  * distribute, sublicense, and/or sell copies of the Software, and to
26  * permit persons to whom the Software is furnished to do so, subject to
27  * the following conditions:
28  *
29  * The above copyright notice and this permission notice shall be
30  * included in all copies or substantial portions of the Software.
31  *
32  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
33  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
35  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
36  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
37  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
38  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39  *
40  */
41 
42 #include <iostream>
43 
44 namespace Gecode { namespace Set {
45 
60  class SetView : public VarImpView<SetVar> {
61  protected:
63  public:
65 
66  SetView(void);
69  SetView(const SetVar& y);
71  SetView(SetVarImp* y);
73 
75 
76 
78  unsigned int cardMin(void) const;
80  unsigned int cardMax(void) const;
82  int lubMin(void) const;
84  int lubMax(void) const;
86  int lubMinN(unsigned int n) const;
88  int glbMin(void) const;
90  int glbMax(void) const;
91 
93  unsigned int glbSize(void) const;
95  unsigned int lubSize(void) const;
97  unsigned int unknownSize(void) const;
99 
101 
102  bool contains(int i) const;
105  bool notContains(int i) const;
107 
108 
110 
111  ModEvent cardMin(Space& home, unsigned int m);
114  ModEvent cardMax(Space& home, unsigned int m);
119  ModEvent include(Space& home,int i,int j);
124  ModEvent exclude(Space& home,int i,int j);
126  ModEvent include(Space& home,int i);
128  ModEvent exclude(Space& home,int i);
133  ModEvent intersect(Space& home,int i,int j);
135  ModEvent intersect(Space& home,int i);
137 
139 
140 
142  template<class I> ModEvent excludeI(Space& home, I& i);
144  template<class I> ModEvent includeI(Space& home, I& i);
146  template<class I> ModEvent intersectI(Space& home, I& iter);
148 
150 
151  static ModEvent modevent(const Delta& d);
154  int glbMin(const Delta& d) const;
156  int glbMax(const Delta& d) const;
158  bool glbAny(const Delta& d) const;
160  int lubMin(const Delta& d) const;
162  int lubMax(const Delta& d) const;
164  bool lubAny(const Delta& d) const;
166  };
167 
172  template<class Char, class Traits>
173  std::basic_ostream<Char,Traits>&
174  operator <<(std::basic_ostream<Char,Traits>& os, const SetView& x);
175 
176 
177 
178  // Forward declarations for friends
179  class ConstSetView;
180  bool same(const ConstSetView&, const ConstSetView&);
181  bool before(const ConstSetView&, const ConstSetView&);
182 
190  class ConstSetView : public ConstView<SetView> {
191  friend class LubRanges<ConstSetView>;
192  friend class GlbRanges<ConstSetView>;
193  friend bool Gecode::Set::same(const Gecode::Set::ConstSetView&,
197  private:
198  int *ranges;
199  int size;
200  unsigned int domSize;
201  public:
203 
204  ConstSetView(void);
207  ConstSetView(Space& home, const IntSet& s);
209 
211 
212  unsigned int cardMin(void) const;
215  unsigned int cardMax(void) const;
217  int lubMin(void) const;
219  int lubMax(void) const;
221  int lubMinN(unsigned int n) const;
223  int glbMin(void) const;
225  int glbMax(void) const;
226 
228  unsigned int glbSize(void) const;
230  unsigned int lubSize(void) const;
232  unsigned int unknownSize(void) const;
234 
236 
237  bool contains(int i) const;
240  bool notContains(int i) const;
242 
243 
245 
246  ModEvent cardMin(Space& home, unsigned int m);
249  ModEvent cardMax(Space& home, unsigned int m);
254  ModEvent include(Space& home,int i,int j);
259  ModEvent exclude(Space& home,int i,int j);
261  ModEvent include(Space& home,int i);
263  ModEvent exclude(Space& home,int i);
268  ModEvent intersect(Space& home,int i,int j);
270  ModEvent intersect(Space& home,int i);
272 
274 
275 
277  template<class I> ModEvent excludeI(Space& home, I& i);
279  template<class I> ModEvent includeI(Space& home, I& i);
281  template<class I> ModEvent intersectI(Space& home, I& iter);
283 
285 
286  void update(Space& home, bool share, ConstSetView& y);
289 
291 
292  int glbMin(const Delta& d) const;
295  int glbMax(const Delta& d) const;
297  bool glbAny(const Delta& d) const;
299  int lubMin(const Delta& d) const;
301  int lubMax(const Delta& d) const;
303  bool lubAny(const Delta& d) const;
305 
306  };
307 
312  template<class Char, class Traits>
313  std::basic_ostream<Char,Traits>&
314  operator <<(std::basic_ostream<Char,Traits>& os, const ConstSetView& x);
315 
320  bool same(const ConstSetView& x, const ConstSetView& y);
323  bool before(const ConstSetView& x, const ConstSetView& y);
325 
326 
335  class EmptyView : public ConstView<SetView> {
336  public:
338 
339  EmptyView(void);
342 
344 
345  unsigned int cardMin(void) const;
348  unsigned int cardMax(void) const;
350  int lubMin(void) const;
352  int lubMax(void) const;
354  int lubMinN(unsigned int n) const;
356  int glbMin(void) const;
358  int glbMax(void) const;
359 
361  unsigned int glbSize(void) const;
363  unsigned int lubSize(void) const;
365  unsigned int unknownSize(void) const;
367 
369 
370  bool contains(int i) const;
373  bool notContains(int i) const;
375 
376 
378 
379  ModEvent cardMin(Space& home, unsigned int m);
382  ModEvent cardMax(Space& home, unsigned int m);
387  ModEvent include(Space& home,int i,int j);
392  ModEvent exclude(Space& home,int i,int j);
394  ModEvent include(Space& home,int i);
396  ModEvent exclude(Space& home,int i);
401  ModEvent intersect(Space& home,int i,int j);
403  ModEvent intersect(Space& home,int i);
405 
407 
408 
410  template<class I> ModEvent excludeI(Space& home, I& i);
412  template<class I> ModEvent includeI(Space& home, I& i);
414  template<class I> ModEvent intersectI(Space& home, I& iter);
416 
418 
419  int glbMin(const Delta& d) const;
422  int glbMax(const Delta& d) const;
424  bool glbAny(const Delta& d) const;
426  int lubMin(const Delta& d) const;
428  int lubMax(const Delta& d) const;
430  bool lubAny(const Delta& d) const;
432 
433  };
434 
439  template<class Char, class Traits>
440  std::basic_ostream<Char,Traits>&
441  operator <<(std::basic_ostream<Char,Traits>& os, const EmptyView& x);
442 
443 
448  bool same(const EmptyView& x, const EmptyView& y);
451 
452 
461  class UniverseView : public ConstView<SetView> {
462  public:
464 
465  UniverseView(void);
468 
470 
471 
473  unsigned int cardMin(void) const;
475  unsigned int cardMax(void) const;
477  int lubMin(void) const;
479  int lubMax(void) const;
481  int lubMinN(unsigned int n) const;
483  int glbMin(void) const;
485  int glbMax(void) const;
486 
488  unsigned int glbSize(void) const;
490  unsigned int lubSize(void) const;
492  unsigned int unknownSize(void) const;
494 
496 
497  bool contains(int i) const;
500  bool notContains(int i) const;
502 
503 
505 
506  ModEvent cardMin(Space& home, unsigned int m);
509  ModEvent cardMax(Space& home, unsigned int m);
514  ModEvent include(Space& home,int i,int j);
519  ModEvent exclude(Space& home,int i,int j);
521  ModEvent include(Space& home,int i);
523  ModEvent exclude(Space& home,int i);
528  ModEvent intersect(Space& home,int i,int j);
530  ModEvent intersect(Space& home,int i);
532 
534 
535 
537  template<class I> ModEvent excludeI(Space& home, I& i);
539  template<class I> ModEvent includeI(Space& home, I& i);
541  template<class I> ModEvent intersectI(Space& home, I& iter);
543 
545 
546  int glbMin(const Delta& d) const;
549  int glbMax(const Delta& d) const;
551  bool glbAny(const Delta& d) const;
553  int lubMin(const Delta& d) const;
555  int lubMax(const Delta& d) const;
557  bool lubAny(const Delta& d) const;
559 
560  };
561 
566  template<class Char, class Traits>
567  std::basic_ostream<Char,Traits>&
568  operator <<(std::basic_ostream<Char,Traits>& os, const UniverseView& x);
569 
570 
575  bool same(const UniverseView& x, const UniverseView& y);
578 
579 
580 
590  public DerivedView<Gecode::Int::IntView> {
591  protected:
593 
595  static PropCond pc_settoint(PropCond pc);
599  static ModEvent me_settoint(ModEvent me);
600 
601  public:
603 
604  SingletonView(void);
609  SingletonView(const Gecode::IntVar& y);
611 
613 
614 
616  unsigned int cardMin(void) const;
618  unsigned int cardMax(void) const;
620  int lubMin(void) const;
622  int lubMax(void) const;
624  int lubMinN(unsigned int n) const;
626  int glbMin(void) const;
628  int glbMax(void) const;
629 
631  unsigned int glbSize(void) const;
633  unsigned int lubSize(void) const;
635  unsigned int unknownSize(void) const;
637 
639 
640  bool contains(int i) const;
643  bool notContains(int i) const;
645 
646 
648 
649  ModEvent cardMin(Space& home, unsigned int m);
652  ModEvent cardMax(Space& home, unsigned int m);
657  ModEvent include(Space& home,int i,int j);
662  ModEvent exclude(Space& home,int i,int j);
664  ModEvent include(Space& home,int i);
666  ModEvent exclude(Space& home,int i);
671  ModEvent intersect(Space& home,int i,int j);
673  ModEvent intersect(Space& home,int i);
675 
677 
678 
680  template<class I> ModEvent excludeI(Space& home, I& i);
682  template<class I> ModEvent includeI(Space& home, I& i);
684  template<class I> ModEvent intersectI(Space& home, I& iter);
686 
688 
689  static void schedule(Space& home, Propagator& p, ModEvent me);
692  static ModEvent me(const ModEventDelta& med);
694  static ModEventDelta med(ModEvent);
696 
698 
699 
706  void subscribe(Space& home, Propagator& p, PropCond pc, bool schedule=true);
708  void cancel(Space& home, Propagator& p, PropCond pc);
710  void subscribe(Space& home, Advisor& a);
712  void cancel(Space& home, Advisor& a);
714 
716 
717  static ModEvent modevent(const Delta& d);
720  int glbMin(const Delta& d) const;
722  int glbMax(const Delta& d) const;
724  bool glbAny(const Delta& d) const;
726  int lubMin(const Delta& d) const;
728  int lubMax(const Delta& d) const;
730  bool lubAny(const Delta& d) const;
732 
733  };
734 
739  template<class Char, class Traits>
740  std::basic_ostream<Char,Traits>&
741  operator <<(std::basic_ostream<Char,Traits>& os, const SingletonView& x);
742 
743 
753  template<class View>
755  : public DerivedView<View> {
756  protected:
757  using DerivedView<View>::x;
758 
759  public:
761  static PropCond pc_negateset(PropCond pc);
764 
766 
767  ComplementView(void);
770  explicit ComplementView(View& y);
772 
774 
775 
777  unsigned int cardMin(void) const;
779  unsigned int cardMax(void) const;
781  int lubMin(void) const;
783  int lubMax(void) const;
785  int lubMinN(unsigned int n) const;
787  int glbMin(void) const;
789  int glbMax(void) const;
790 
792  unsigned int glbSize(void) const;
794  unsigned int lubSize(void) const;
796  unsigned int unknownSize(void) const;
798 
800 
801  bool contains(int i) const;
804  bool notContains(int i) const;
806 
807 
809 
810  ModEvent cardMin(Space& home, unsigned int m);
813  ModEvent cardMax(Space& home, unsigned int m);
818  ModEvent include(Space& home,int i,int j);
823  ModEvent exclude(Space& home,int i,int j);
825  ModEvent include(Space& home,int i);
827  ModEvent exclude(Space& home,int i);
832  ModEvent intersect(Space& home,int i,int j);
834  ModEvent intersect(Space& home,int i);
836 
838 
839 
841  template<class I> ModEvent excludeI(Space& home, I& i);
843  template<class I> ModEvent includeI(Space& home, I& i);
845  template<class I> ModEvent intersectI(Space& home, I& iter);
847 
849 
850  static void schedule(Space& home, Propagator& p, ModEvent me);
853  static ModEvent me(const ModEventDelta& med);
855  static ModEventDelta med(ModEvent);
857 
859 
860 
867  void subscribe(Space& home, Propagator& p, PropCond pc, bool schedule=true);
869  void cancel(Space& home, Propagator& p, PropCond pc);
871  void subscribe(Space& home, Advisor& a);
873  void cancel(Space& home, Advisor& a);
875 
877 
878  static ModEvent modevent(const Delta& d);
881  int glbMin(const Delta& d) const;
883  int glbMax(const Delta& d) const;
885  bool glbAny(const Delta& d) const;
887  int lubMin(const Delta& d) const;
889  int lubMax(const Delta& d) const;
891  bool lubAny(const Delta& d) const;
893 
894  };
895 
900  template<class Char, class Traits, class View>
901  std::basic_ostream<Char,Traits>&
902  operator <<(std::basic_ostream<Char,Traits>& os,
903  const ComplementView<View>& x);
904 
905 
906  template<class View> class LubDiffRanges;
907  template<class View> class GlbDiffRanges;
908 
920  template<class View>
922  : public DerivedView<View> {
923  friend class LubDiffRanges<View>;
924  friend class GlbDiffRanges<View>;
925  protected:
926  using DerivedView<View>::x;
927 
932 
933  public:
934 
936 
937  CachedView(void);
940  explicit CachedView(const View& y);
942 
944 
945 
947  unsigned int cardMin(void) const;
949  unsigned int cardMax(void) const;
951  int lubMin(void) const;
953  int lubMax(void) const;
955  int lubMinN(unsigned int n) const;
957  int glbMin(void) const;
959  int glbMax(void) const;
960 
962  unsigned int glbSize(void) const;
964  unsigned int lubSize(void) const;
966  unsigned int unknownSize(void) const;
968 
970 
971  bool contains(int i) const;
974  bool notContains(int i) const;
976 
977 
979 
980  ModEvent cardMin(Space& home, unsigned int m);
983  ModEvent cardMax(Space& home, unsigned int m);
988  ModEvent include(Space& home,int i,int j);
993  ModEvent exclude(Space& home,int i,int j);
995  ModEvent include(Space& home,int i);
997  ModEvent exclude(Space& home,int i);
1002  ModEvent intersect(Space& home,int i,int j);
1004  ModEvent intersect(Space& home,int i);
1006 
1008 
1009 
1011  template<class I> ModEvent excludeI(Space& home, I& i);
1013  template<class I> ModEvent includeI(Space& home, I& i);
1015  template<class I> ModEvent intersectI(Space& home, I& iter);
1017 
1019 
1020  static void schedule(Space& home, Propagator& p, ModEvent me);
1023  static ModEvent me(const ModEventDelta& med);
1025  static ModEventDelta med(ModEvent);
1027 
1029 
1030 
1037  void subscribe(Space& home, Propagator& p, PropCond pc, bool schedule=true);
1039  void cancel(Space& home, Propagator& p, PropCond pc);
1041  void subscribe(Space& home, Advisor& a);
1043  void cancel(Space& home, Advisor& a);
1045 
1047 
1048  static ModEvent modevent(const Delta& d);
1051  int glbMin(const Delta& d) const;
1053  int glbMax(const Delta& d) const;
1055  bool glbAny(const Delta& d) const;
1057  int lubMin(const Delta& d) const;
1059  int lubMax(const Delta& d) const;
1061  bool lubAny(const Delta& d) const;
1063 
1065 
1066  void initCache(Space& home, const IntSet& glb, const IntSet& lub);
1069  void cacheGlb(Space& home);
1071  void cacheLub(Space& home);
1073  bool glbModified(void) const;
1075  bool lubModified(void) const;
1077 
1079 
1080  void update(Space& home, bool share, CachedView<View>& y);
1083  };
1084 
1089  template<class Char, class Traits, class View>
1090  std::basic_ostream<Char,Traits>&
1091  operator <<(std::basic_ostream<Char,Traits>& os,
1092  const CachedView<View>& x);
1093 
1098  template<class View>
1099  class GlbDiffRanges
1100  : public Iter::Ranges::Diff<GlbRanges<View>,BndSetRanges> {
1101  protected:
1106  public:
1109  };
1110 
1115  template<class View>
1116  class LubDiffRanges
1117  : public Iter::Ranges::Diff<BndSetRanges,LubRanges<View> > {
1118  protected:
1123  public:
1126  };
1127 
1128 }}
1129 
1130 #include <gecode/set/var/set.hpp>
1131 
1132 #include <gecode/set/view/set.hpp>
1133 
1134 #include <gecode/set/view/const.hpp>
1137 #include <gecode/set/view/cached.hpp>
1138 
1139 #include <gecode/set/view/print.hpp>
1140 #include <gecode/set/var/print.hpp>
1141 
1142 // STATISTICS: set-var
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: const.hpp:272
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: cached.hpp:59
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
void cacheGlb(Space &home)
Update greatest lower bound cache to current domain.
Definition: cached.hpp:294
static ModEvent modevent(const Delta &d)
Return modification event.
Definition: singleton.hpp:272
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: cached.hpp:264
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: const.hpp:397
static ModEvent modevent(const Delta &d)
Return modification event.
Definition: complement.hpp:289
unsigned int cardMin(void) const
Return minimum cardinality.
Definition: set.hpp:86
static ModEventDelta med(ModEvent)
Translate modification event me to modification event delta for view.
Definition: singleton.hpp:258
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: singleton.hpp:115
static ModEvent modevent(const Delta &d)
Return modification event.
Definition: view.hpp:585
ModEvent include(Space &home, int i, int j)
Update greatest lower bound to include all elements between and including i and j.
Definition: set.hpp:130
unsigned int cardMin(void) const
Return minimum cardinality.
Definition: const.hpp:423
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: const.hpp:283
bool glbModified(void) const
Check whether greatest lower bound cache differs from current domain.
Definition: cached.hpp:308
void update(Space &home, bool share, ConstSetView &y)
Update this view to be a clone of view y.
Definition: const.hpp:221
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition: singleton.hpp:209
ComplementView(void)
Default constructor.
Definition: complement.hpp:48
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
ConstSetView(void)
Default constructor.
Definition: const.hpp:85
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: singleton.hpp:292
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: const.hpp:295
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: set.hpp:66
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: cached.hpp:71
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition: singleton.hpp:225
unsigned int cardMax(void) const
Return maximum cardinality.
Definition: const.hpp:134
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition: set.hpp:74
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: cached.hpp:246
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: singleton.hpp:283
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition: set.hpp:106
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: const.hpp:286
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: const.hpp:257
Shrinking sets of integers.
Definition: var-imp.hpp:247
SingletonView(void)
Default constructor.
Definition: singleton.hpp:45
ModEvent include(Space &home, int i, int j)
Update greatest lower bound to include all elements between and including i and j.
Definition: singleton.hpp:181
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
static void schedule(Space &home, Propagator &p, ModEvent me)
Schedule propagator p with modification event me.
Definition: view.hpp:548
int ModEvent
Type for modification events.
Definition: core.hpp:146
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:341
unsigned int cardMax(void) const
Return maximum cardinality.
Definition: set.hpp:90
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p with propagation condition pc to view.
Definition: view.hpp:570
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: singleton.hpp:98
Base-class for propagators.
Definition: core.hpp:755
Base-class for advisors.
Definition: core.hpp:926
int lubMin(void) const
Return minimum of the least upper bound.
Definition: const.hpp:429
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition: const.hpp:485
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: set.hpp:145
BndSetRanges cr
Cached lower bound.
Definition: view.hpp:1105
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
Range iterator for the greatest lower bound.
Definition: var-imp.hpp:363
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition: complement.hpp:235
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition: const.hpp:414
Finite integer set variable implementation.
Definition: var-imp.hpp:434
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: const.hpp:417
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:338
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: singleton.hpp:111
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition: set.hpp:164
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: cached.hpp:75
bool lubModified(void) const
Check whether least upper bound cache differs from current domain.
Definition: cached.hpp:314
Base-class for constant views.
Definition: view.hpp:45
Computation spaces.
Definition: core.hpp:1362
static PropCond pc_settoint(PropCond pc)
Convert set variable PropCond pc to a PropCond for integer variables.
Definition: singleton.hpp:56
static ModEvent modevent(const Delta &d)
Return modification event.
Definition: set.hpp:179
Base-class for derived views.
Definition: view.hpp:208
Range iterator for the least upper bound.
Definition: var-imp.hpp:321
int lubMin(void) const
Return minimum of the least upper bound.
UniverseView(void)
Default constructor.
Definition: const.hpp:405
ModEvent exclude(Space &home, View &x, int s)
Prune view x to exclude all values from s.
Definition: set-op.hpp:141
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition: const.hpp:469
Gecode::IntSet d(v, 7)
int med(void) const
Return median of domain (greatest element not greater than the median)
Definition: cached.hpp:70
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition: const.hpp:289
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: const.hpp:510
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition: const.hpp:112
unsigned int cardMax(void) const
Return maximum cardinality.
Definition: const.hpp:301
GlbDiffRanges(const CachedView< View > &x)
Constructor.
Definition: cached.hpp:385
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition: const.hpp:203
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition: const.hpp:209
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition: complement.hpp:91
unsigned int cardMax(void) const
Return maximum cardinality.
Definition: complement.hpp:111
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition: const.hpp:313
Gecode::IntArgs i(4, 1, 2, 3, 4)
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition: const.hpp:435
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
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:466
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p with propagation condition pc to view.
Definition: complement.hpp:249
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition: singleton.hpp:130
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition: singleton.hpp:106
unsigned int cardMax(void) const
Return maximum cardinality.
Definition: singleton.hpp:121
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: complement.hpp:203
static ModEventDelta med(ModEvent)
Translate modification event me to modification event delta for view.
Definition: complement.hpp:278
static ModEvent me(const ModEventDelta &med)
Return modification event for view type in med.
Definition: singleton.hpp:254
int lubMin(void) const
Return minimum of the least upper bound.
Definition: set.hpp:94
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition: const.hpp:147
Constant view for the universe.
Definition: view.hpp:461
FloatVal intersect(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:507
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: const.hpp:528
static ModEvent me_negateset(ModEvent me)
Negate the modification event me.
Definition: complement.hpp:57
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: const.hpp:126
int PropCond
Type for propagation conditions.
Definition: core.hpp:156
int lubMin(void) const
Return minimum of the least upper bound.
Definition: singleton.hpp:124
static ModEvent me_inttoset(ModEvent me)
Convert integer variable ModEvent me to a ModEvent for set variables.
Definition: singleton.hpp:68
int lubMax(void) const
Return maximum of the least upper bound.
Definition: const.hpp:432
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition: set.hpp:110
SetView(void)
Default constructor.
Definition: set.hpp:52
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: const.hpp:109
GLBndSet glbCache
The cached greatest lower bound.
Definition: view.hpp:931
unsigned int size(I &i)
Size of all ranges of range iterator i.
unsigned int cardMax(void) const
Return maximum cardinality.
EmptyView(void)
Default constructor.
Definition: const.hpp:278
unsigned int cardMax(void) const
Return maximum cardinality.
Definition: const.hpp:426
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition: complement.hpp:142
Range iterator for integer sets.
Definition: var-imp.hpp:189
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: singleton.hpp:103
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:195
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
Definition: set.hpp:102
Base-class for variable implementation views.
Definition: view.hpp:117
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: complement.hpp:79
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: set.hpp:78
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition: const.hpp:348
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: complement.hpp:97
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: const.hpp:115
CachedView(void)
Default constructor.
Definition: cached.hpp:46
Range iterator for difference of greatest lower bound and cache
Definition: view.hpp:907
Integer sets.
Definition: int.hh:171
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition: complement.hpp:229
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition: set.hpp:155
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: set.hpp:82
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p with propagation condition pc to view.
Definition: singleton.hpp:235
int lubMax(void) const
Return maximum of the least upper bound.
int lubMax(void) const
Return maximum of the least upper bound.
Definition: const.hpp:142
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition: const.hpp:474
int lubMax(void) const
Return maximum of the least upper bound.
Definition: set.hpp:98
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: const.hpp:411
int lubMax(void) const
Return maximum of the least upper bound.
Definition: const.hpp:307
bool same(const ConstSetView &x, const ConstSetView &y)
Definition: const.hpp:688
Singleton set view.
Definition: view.hpp:589
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: complement.hpp:85
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: const.hpp:379
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition: singleton.hpp:204
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:479
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition: set.hpp:168
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: const.hpp:106
void update(Space &home, bool share, CachedView< View > &y)
Update this view to be a clone of view y.
Definition: cached.hpp:269
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:345
unsigned int cardMin(void) const
Return minimum cardinality.
Definition: complement.hpp:105
Set view for set variables
Definition: view.hpp:60
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition: singleton.hpp:134
int lubMax(void) const
Return maximum of the least upper bound.
Definition: complement.hpp:129
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition: complement.hpp:223
Integer view for integer variables.
Definition: view.hpp:129
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to view.
Definition: complement.hpp:242
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to view.
Definition: singleton.hpp:230
void cacheLub(Space &home)
Update least upper bound cache to current domain.
Definition: cached.hpp:301
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: cached.hpp:53
Constant view.
Definition: view.hpp:190
unsigned int cardMin(void) const
Return minimum cardinality.
Definition: singleton.hpp:118
Node * x
Pointer to corresponding Boolean expression node.
Definition: bool-expr.cpp:253
Generic domain change information to be supplied to advisors.
Definition: core.hpp:275
Set variables
Definition: set.hh:129
LUBndSet lubCache
The cached least upper bound.
Definition: view.hpp:929
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: complement.hpp:307
ModEvent include(Space &home, View &x, int s)
Prune view x to only include values from s.
Definition: set-op.hpp:127
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition: const.hpp:353
Integer variables.
Definition: int.hh:350
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:463
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: const.hpp:408
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition: const.hpp:358
int lubMin(void) const
Return minimum of the least upper bound.
Definition: const.hpp:137
Cached integer view.
Definition: view.hpp:1107
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition: complement.hpp:154
Growing sets of integers.
Definition: var-imp.hpp:209
int glbMax(void) const
Return maximum of the greatest lower bound.
int lubMax(void) const
Return maximum of the least upper bound.
Definition: singleton.hpp:127
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: singleton.hpp:158
static void schedule(Space &home, Propagator &p, ModEvent me)
Schedule propagator p with modification event me.
Definition: singleton.hpp:250
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:181
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to view.
Definition: view.hpp:564
static ModEvent me(const ModEventDelta &med)
Return modification event for view type in med.
Definition: view.hpp:553
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
ModEvent exclude(Space &home, int i, int j)
Restrict least upper bound to not contain all elements between and including i and j...
Definition: singleton.hpp:186
int glbMin(void) const
Return minimum of the greatest lower bound.
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
ModEvent exclude(Space &home, int i, int j)
Restrict least upper bound to not contain all elements between and including i and j...
Definition: set.hpp:160
Complement set view.
Definition: view.hpp:754
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: const.hpp:420
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Gecode toplevel namespace
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: complement.hpp:325
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:187
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: set.hpp:188
LubRanges< View > lr
Upper bound iterator.
Definition: view.hpp:1122
Range iterator for computing set difference.
Definition: ranges-diff.hpp:47
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition: const.hpp:438
LubDiffRanges(const CachedView< View > &x)
Constructor.
Definition: cached.hpp:392
static void schedule(Space &home, Propagator &p, ModEvent me)
Schedule propagator p with modification event me.
Definition: complement.hpp:267
static PropCond pc_negateset(PropCond pc)
Negate the propagation condition pc.
Definition: complement.hpp:69
GlbRanges< View > gr
Lower bound iterator.
Definition: view.hpp:1103
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition: cached.hpp:65
Constant view for the empty set.
Definition: view.hpp:335
int ModEventDelta
Modification event deltas.
Definition: core.hpp:173
bool before(const ConstSetView &x, const ConstSetView &y)
Definition: const.hpp:698
void initCache(Space &home, const IntSet &s)
Initialize cache to set s.
Definition: cached.hpp:295
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition: const.hpp:150
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: set.hpp:70
Range iterator for difference of least upper bound and cache
Definition: view.hpp:906
unsigned int cardMin(void) const
Return minimum cardinality.
Definition: const.hpp:131
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition: const.hpp:310
unsigned int cardMin(void) const
Return minimum cardinality.
Definition: const.hpp:298
unsigned int cardMin(void) const
Return minimum cardinality.
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: set.hpp:197
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition: const.hpp:215
int lubMin(void) const
Return minimum of the least upper bound.
Definition: complement.hpp:117
ModEvent exclude(Space &home, int i, int j)
Restrict least upper bound to not contain all elements between and including i and j...
Definition: complement.hpp:217
static ModEvent me_settoint(ModEvent me)
Convert set variable ModEvent me to a ModEvent for integer variables.
Definition: singleton.hpp:84
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: const.hpp:292
static ModEvent me(const ModEventDelta &med)
Return modification event for view type in med.
Definition: complement.hpp:272
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: complement.hpp:101
int lubMin(void) const
Return minimum of the least upper bound.
Definition: const.hpp:304
BndSetRanges cr
Cached upper bound.
Definition: view.hpp:1120
ModEvent include(Space &home, int i, int j)
Update greatest lower bound to include all elements between and including i and j.
Definition: complement.hpp:211