Generated on Thu Jan 31 2019 20:56:34 for Gecode by doxygen 1.8.15
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: 2016-09-02 15:36:56 +0200 (Fri, 02 Sep 2016) $ by $Author: schulte $
15  * $Revision: 15162 $
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);
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);
600 
601  public:
603 
604  SingletonView(void);
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 reschedule(Space& home, Propagator& p, PropCond pc);
712  void subscribe(Space& home, Advisor& a);
714  void cancel(Space& home, Advisor& a);
716 
718 
719  static ModEvent modevent(const Delta& d);
722  int glbMin(const Delta& d) const;
724  int glbMax(const Delta& d) const;
726  bool glbAny(const Delta& d) const;
728  int lubMin(const Delta& d) const;
730  int lubMax(const Delta& d) const;
732  bool lubAny(const Delta& d) const;
734 
735  };
736 
741  template<class Char, class Traits>
742  std::basic_ostream<Char,Traits>&
743  operator <<(std::basic_ostream<Char,Traits>& os, const SingletonView& x);
744 
745 
755  template<class View>
757  : public DerivedView<View> {
758  protected:
759  using DerivedView<View>::x;
760 
761  public:
763  static PropCond pc_negateset(PropCond pc);
766 
768 
769  ComplementView(void);
772  explicit ComplementView(View& y);
774 
776 
777 
779  unsigned int cardMin(void) const;
781  unsigned int cardMax(void) const;
783  int lubMin(void) const;
785  int lubMax(void) const;
787  int lubMinN(unsigned int n) const;
789  int glbMin(void) const;
791  int glbMax(void) const;
792 
794  unsigned int glbSize(void) const;
796  unsigned int lubSize(void) const;
798  unsigned int unknownSize(void) const;
800 
802 
803  bool contains(int i) const;
806  bool notContains(int i) const;
808 
809 
811 
812  ModEvent cardMin(Space& home, unsigned int m);
815  ModEvent cardMax(Space& home, unsigned int m);
820  ModEvent include(Space& home,int i,int j);
825  ModEvent exclude(Space& home,int i,int j);
827  ModEvent include(Space& home,int i);
829  ModEvent exclude(Space& home,int i);
834  ModEvent intersect(Space& home,int i,int j);
836  ModEvent intersect(Space& home,int i);
838 
840 
841 
843  template<class I> ModEvent excludeI(Space& home, I& i);
845  template<class I> ModEvent includeI(Space& home, I& i);
847  template<class I> ModEvent intersectI(Space& home, I& iter);
849 
851 
852  static void schedule(Space& home, Propagator& p, ModEvent me);
855  static ModEvent me(const ModEventDelta& med);
857  static ModEventDelta med(ModEvent);
859 
861 
862 
869  void subscribe(Space& home, Propagator& p, PropCond pc, bool schedule=true);
871  void cancel(Space& home, Propagator& p, PropCond pc);
873  void subscribe(Space& home, Advisor& a);
875  void cancel(Space& home, Advisor& a);
877 
879 
880  static ModEvent modevent(const Delta& d);
883  int glbMin(const Delta& d) const;
885  int glbMax(const Delta& d) const;
887  bool glbAny(const Delta& d) const;
889  int lubMin(const Delta& d) const;
891  int lubMax(const Delta& d) const;
893  bool lubAny(const Delta& d) const;
895 
896  };
897 
902  template<class Char, class Traits, class View>
903  std::basic_ostream<Char,Traits>&
904  operator <<(std::basic_ostream<Char,Traits>& os,
905  const ComplementView<View>& x);
906 
907 
908  template<class View> class LubDiffRanges;
909  template<class View> class GlbDiffRanges;
910 
922  template<class View>
924  : public DerivedView<View> {
925  friend class LubDiffRanges<View>;
926  friend class GlbDiffRanges<View>;
927  protected:
928  using DerivedView<View>::x;
929 
934 
935  public:
936 
938 
939  CachedView(void);
942  explicit CachedView(const View& y);
944 
946 
947 
949  unsigned int cardMin(void) const;
951  unsigned int cardMax(void) const;
953  int lubMin(void) const;
955  int lubMax(void) const;
957  int lubMinN(unsigned int n) const;
959  int glbMin(void) const;
961  int glbMax(void) const;
962 
964  unsigned int glbSize(void) const;
966  unsigned int lubSize(void) const;
968  unsigned int unknownSize(void) const;
970 
972 
973  bool contains(int i) const;
976  bool notContains(int i) const;
978 
979 
981 
982  ModEvent cardMin(Space& home, unsigned int m);
985  ModEvent cardMax(Space& home, unsigned int m);
990  ModEvent include(Space& home,int i,int j);
995  ModEvent exclude(Space& home,int i,int j);
997  ModEvent include(Space& home,int i);
999  ModEvent exclude(Space& home,int i);
1004  ModEvent intersect(Space& home,int i,int j);
1006  ModEvent intersect(Space& home,int i);
1008 
1010 
1011 
1013  template<class I> ModEvent excludeI(Space& home, I& i);
1015  template<class I> ModEvent includeI(Space& home, I& i);
1017  template<class I> ModEvent intersectI(Space& home, I& iter);
1019 
1021 
1022  static void schedule(Space& home, Propagator& p, ModEvent me);
1025  static ModEvent me(const ModEventDelta& med);
1027  static ModEventDelta med(ModEvent);
1029 
1031 
1032 
1039  void subscribe(Space& home, Propagator& p, PropCond pc, bool schedule=true);
1041  void cancel(Space& home, Propagator& p, PropCond pc);
1043  void subscribe(Space& home, Advisor& a);
1045  void cancel(Space& home, Advisor& a);
1047 
1049 
1050  static ModEvent modevent(const Delta& d);
1053  int glbMin(const Delta& d) const;
1055  int glbMax(const Delta& d) const;
1057  bool glbAny(const Delta& d) const;
1059  int lubMin(const Delta& d) const;
1061  int lubMax(const Delta& d) const;
1063  bool lubAny(const Delta& d) const;
1065 
1067 
1068  void initCache(Space& home, const IntSet& glb, const IntSet& lub);
1071  void cacheGlb(Space& home);
1073  void cacheLub(Space& home);
1075  bool glbModified(void) const;
1077  bool lubModified(void) const;
1079 
1081 
1082  void update(Space& home, bool share, CachedView<View>& y);
1085  };
1086 
1091  template<class Char, class Traits, class View>
1092  std::basic_ostream<Char,Traits>&
1093  operator <<(std::basic_ostream<Char,Traits>& os,
1094  const CachedView<View>& x);
1095 
1100  template<class View>
1101  class GlbDiffRanges
1102  : public Iter::Ranges::Diff<GlbRanges<View>,BndSetRanges> {
1103  protected:
1108  public:
1111  };
1112 
1117  template<class View>
1118  class LubDiffRanges
1119  : public Iter::Ranges::Diff<BndSetRanges,LubRanges<View> > {
1120  protected:
1125  public:
1128  };
1129 
1130 }}
1131 
1132 #include <gecode/set/var/set.hpp>
1133 
1134 #include <gecode/set/view/set.hpp>
1135 
1136 #include <gecode/set/view/const.hpp>
1139 #include <gecode/set/view/cached.hpp>
1140 
1141 #include <gecode/set/view/print.hpp>
1142 #include <gecode/set/var/print.hpp>
1143 
1144 // STATISTICS: set-var
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: const.hpp:408
unsigned int cardMax(void) const
Return maximum cardinality.
Definition: const.hpp:301
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: complement.hpp:79
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:276
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: complement.hpp:101
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: cached.hpp:71
static ModEvent modevent(const Delta &d)
Return modification event.
Definition: complement.hpp:289
static ModEventDelta med(ModEvent)
Translate modification event me to modification event delta for view.
Definition: singleton.hpp:262
unsigned int cardMax(void) const
Return maximum cardinality.
Definition: set.hpp:90
static ModEvent modevent(const Delta &d)
Return modification event.
Definition: view.hpp:625
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
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.
unsigned int cardMin(void) const
Return minimum cardinality.
Definition: cached.hpp:79
ConstSetView(void)
Default constructor.
Definition: const.hpp:85
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition: const.hpp:438
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:134
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: const.hpp:417
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition: singleton.hpp:225
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
int lubMin(void) const
Return minimum of the least upper bound.
Definition: singleton.hpp:124
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition: singleton.hpp:130
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition: complement.hpp:142
unsigned int cardMax(void) const
Return maximum cardinality.
Definition: singleton.hpp:121
unsigned int cardMin(void) const
Return minimum cardinality.
Definition: const.hpp:131
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
unsigned int cardMax(void) const
Return maximum cardinality.
Definition: complement.hpp:111
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: const.hpp:257
static void schedule(Space &home, Propagator &p, ModEvent me)
Schedule propagator p with modification event me.
Definition: view.hpp:583
int ModEvent
Type for modification events.
Definition: core.hpp:142
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
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p with propagation condition pc to view.
Definition: view.hpp:605
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: cached.hpp:75
Base-class for propagators.
Definition: core.hpp:1092
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition: const.hpp:310
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition: cached.hpp:65
Base-class for advisors.
Definition: core.hpp:1294
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition: const.hpp:485
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition: set.hpp:106
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition: const.hpp:414
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
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: complement.hpp:325
BndSetRanges cr
Cached lower bound.
Definition: view.hpp:1107
unsigned int cardMin(void) const
Return minimum cardinality.
Definition: set.hpp:86
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: set.hpp:188
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition: const.hpp:289
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 glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: const.hpp:106
Finite integer set variable implementation.
Definition: var-imp.hpp:434
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
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition: set.hpp:164
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: cached.hpp:264
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition: cached.hpp:103
Base-class for constant views.
Definition: view.hpp:45
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: cached.hpp:246
Computation spaces.
Definition: core.hpp:1748
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: singleton.hpp:98
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:222
Range iterator for the least upper bound.
Definition: var-imp.hpp:321
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: const.hpp:286
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
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition: complement.hpp:154
int lubMin(void) const
Return minimum of the least upper bound.
Definition: const.hpp:429
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition: const.hpp:469
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: singleton.hpp:287
Gecode::IntSet d(v, 7)
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition: const.hpp:147
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition: set.hpp:74
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: singleton.hpp:103
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: complement.hpp:85
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: const.hpp:510
int lubMax(void) const
Return maximum of the least upper bound.
Definition: const.hpp:142
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
int lubMax(void) const
Return maximum of the least upper bound.
Definition: cached.hpp:97
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 lubMin(void) const
Return minimum of the least upper bound.
Definition: complement.hpp:117
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: cached.hpp:53
Gecode::IntArgs i(4, 1, 2, 3, 4)
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition: const.hpp:150
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
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:258
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: const.hpp:283
Constant view for the universe.
Definition: view.hpp:461
FloatVal intersect(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:507
static ModEvent me_negateset(ModEvent me)
Negate the modification event me.
Definition: complement.hpp:57
int lubMax(void) const
Return maximum of the least upper bound.
Definition: singleton.hpp:127
unsigned int cardMin(void) const
Return minimum cardinality.
Definition: singleton.hpp:118
int PropCond
Type for propagation conditions.
Definition: core.hpp:152
static ModEvent me_inttoset(ModEvent me)
Convert integer variable ModEvent me to a ModEvent for set variables.
Definition: singleton.hpp:68
SetView(void)
Default constructor.
Definition: set.hpp:52
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition: cached.hpp:109
GLBndSet glbCache
The cached greatest lower bound.
Definition: view.hpp:933
int lubMax(void) const
Return maximum of the least upper bound.
Definition: const.hpp:307
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: const.hpp:379
unsigned int size(I &i)
Size of all ranges of range iterator i.
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition: singleton.hpp:134
EmptyView(void)
Default constructor.
Definition: const.hpp:278
Range iterator for integer sets.
Definition: var-imp.hpp:189
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
Base-class for variable implementation views.
Definition: view.hpp:123
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition: const.hpp:348
int lubMax(void) const
Return maximum of the least upper bound.
Definition: complement.hpp:129
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: set.hpp:70
CachedView(void)
Default constructor.
Definition: cached.hpp:46
Range iterator for difference of greatest lower bound and cache
Definition: view.hpp:909
Integer sets.
Definition: int.hh:174
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
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p with propagation condition pc to view.
Definition: singleton.hpp:235
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition: const.hpp:474
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: const.hpp:411
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: const.hpp:420
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: const.hpp:292
bool same(const ConstSetView &x, const ConstSetView &y)
Definition: const.hpp:688
Singleton set view.
Definition: view.hpp:589
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
void update(Space &home, bool share, CachedView< View > &y)
Update this view to be a clone of view y.
Definition: cached.hpp:269
int med(void) const
Return median of domain (greatest element not greater than the median)
Definition: cached.hpp:70
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
bool glbModified(void) const
Check whether greatest lower bound cache differs from current domain.
Definition: cached.hpp:308
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: complement.hpp:97
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition: complement.hpp:91
Set view for set variables
Definition: view.hpp:60
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition: complement.hpp:223
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition: complement.hpp:307
Integer view for integer variables.
Definition: view.hpp:129
int lubMin(void) const
Return minimum of the least upper bound.
Definition: const.hpp:137
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to view.
Definition: complement.hpp:242
Post propagator for SetVar SetOpType SetVar y
Definition: set.hh:784
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
Constant view.
Definition: view.hpp:190
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
Generic domain change information to be supplied to advisors.
Definition: core.hpp:281
Set variables
Definition: set.hh:131
LUBndSet lubCache
The cached least upper bound.
Definition: view.hpp:931
unsigned int cardMin(void) const
Return minimum cardinality.
Definition: complement.hpp:105
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
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: const.hpp:272
Integer variables.
Definition: int.hh:353
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 cardMin(void) const
Return minimum cardinality.
Definition: const.hpp:423
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition: const.hpp:358
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition: set.hpp:110
Cached integer view.
Definition: view.hpp:1107
Growing sets of integers.
Definition: var-imp.hpp:209
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
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition: const.hpp:435
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: const.hpp:126
static void schedule(Space &home, Propagator &p, ModEvent me)
Schedule propagator p with modification event me.
Definition: singleton.hpp:254
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const CachedView< View > &x)
Definition: cached.hpp:378
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
Post propagator for SetVar x
Definition: set.hh:784
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to view.
Definition: view.hpp:599
unsigned int cardMin(void) const
Return minimum cardinality.
Definition: const.hpp:298
static ModEvent me(const ModEventDelta &med)
Return modification event for view type in med.
Definition: view.hpp:588
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: singleton.hpp:115
unsigned int cardMax(void) const
Return maximum cardinality.
Definition: cached.hpp:85
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
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition: singleton.hpp:106
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: const.hpp:295
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:756
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition: set.hpp:82
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:187
int lubMax(void) const
Return maximum of the least upper bound.
Definition: const.hpp:432
void reschedule(Space &home, Propagator &p, PropCond pc)
Re-schedule propagator p with propagation condition pc.
Definition: singleton.hpp:239
LubRanges< View > lr
Upper bound iterator.
Definition: view.hpp:1124
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: const.hpp:115
Range iterator for computing set difference.
Definition: ranges-diff.hpp:47
LubDiffRanges(const CachedView< View > &x)
Constructor.
Definition: cached.hpp:392
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: set.hpp:197
static void schedule(Space &home, Propagator &p, ModEvent me)
Schedule propagator p with modification event me.
Definition: complement.hpp:267
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: set.hpp:78
static PropCond pc_negateset(PropCond pc)
Negate the propagation condition pc.
Definition: complement.hpp:69
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: const.hpp:397
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: const.hpp:528
GlbRanges< View > gr
Lower bound iterator.
Definition: view.hpp:1105
int lubMinN(unsigned int n) const
Return n-th smallest element of the least upper bound.
Definition: set.hpp:102
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition: const.hpp:313
Constant view for the empty set.
Definition: view.hpp:335
int ModEventDelta
Modification event deltas.
Definition: core.hpp:169
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
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition: singleton.hpp:296
int lubMin(void) const
Return minimum of the least upper bound.
Definition: set.hpp:94
Range iterator for difference of least upper bound and cache
Definition: view.hpp:908
int lubMin(void) const
Return minimum of the least upper bound.
Definition: const.hpp:304
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition: singleton.hpp:111
int lubMin(void) const
Return minimum of the least upper bound.
Definition: cached.hpp:91
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition: const.hpp:215
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
unsigned int cardMax(void) const
Return maximum cardinality.
Definition: const.hpp:426
static ModEvent me_settoint(ModEvent me)
Convert set variable ModEvent me to a ModEvent for integer variables.
Definition: singleton.hpp:84
static ModEvent me(const ModEventDelta &med)
Return modification event for view type in med.
Definition: complement.hpp:272
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition: set.hpp:66
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: cached.hpp:59
int lubMax(void) const
Return maximum of the least upper bound.
Definition: set.hpp:98
BndSetRanges cr
Cached upper bound.
Definition: view.hpp:1122
bool lubModified(void) const
Check whether least upper bound cache differs from current domain.
Definition: cached.hpp:314
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
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition: const.hpp:109