set.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 namespace Gecode { namespace Set {
00045
00046
00047
00048
00049
00050
00051 forceinline
00052 SetView::SetView(void) {}
00053 forceinline
00054 SetView::SetView(const SetVar& y)
00055 : VarViewBase<SetVarImp>(y.var()) {}
00056 forceinline
00057 SetView::SetView(SetVarImp* y)
00058 : VarViewBase<SetVarImp>(y) {}
00059
00060
00061
00062
00063
00064
00065 forceinline bool
00066 SetView::assigned(void) const {
00067 return varimp->assigned();
00068 }
00069
00070 forceinline unsigned int
00071 SetView::glbSize(void) const { return varimp->glbSize(); }
00072
00073 forceinline unsigned int
00074 SetView::lubSize(void) const { return varimp->lubSize(); }
00075
00076 forceinline unsigned int
00077 SetView::unknownSize(void) const { return varimp->lubSize() - varimp->glbSize(); }
00078
00079 forceinline bool
00080 SetView::contains(int i) const { return (varimp->knownIn(i)); }
00081
00082 forceinline bool
00083 SetView::notContains(int i) const { return (varimp->knownOut(i)); }
00084
00085 forceinline unsigned int
00086 SetView::cardMin(void) const { return varimp->cardMin(); }
00087
00088 forceinline unsigned int
00089 SetView::cardMax(void) const { return varimp->cardMax(); }
00090
00091 forceinline int
00092 SetView::lubMin(void) const { return varimp->lubMin(); }
00093
00094 forceinline int
00095 SetView::lubMax(void) const { return varimp->lubMax(); }
00096
00097 forceinline int
00098 SetView::lubMinN(unsigned int n) const { return varimp->lubMinN(n); }
00099
00100 forceinline int
00101 SetView::glbMin(void) const { return varimp->glbMin(); }
00102
00103 forceinline int
00104 SetView::glbMax(void) const { return varimp->glbMax(); }
00105
00106
00107
00108
00109
00110
00111 forceinline ModEvent
00112 SetView::cardMin(Space& home, unsigned int m) {
00113 return varimp-> cardMin(home, m);
00114 }
00115
00116 forceinline ModEvent
00117 SetView::cardMax(Space& home, unsigned int m) {
00118 return varimp-> cardMax(home, m);
00119 }
00120
00121 forceinline ModEvent
00122 SetView::include (Space& home,int from, int to) {
00123 return (varimp->include(home,from,to));
00124 }
00125
00126 forceinline ModEvent
00127 SetView::include (Space& home,int n) {
00128 return (varimp->include(home,n));
00129 }
00130
00131 forceinline ModEvent
00132 SetView::exclude (Space& home,int n) {
00133 return (varimp->exclude(home, n));
00134 }
00135
00136 forceinline ModEvent
00137 SetView::intersect (Space& home,int from, int to) {
00138 return (varimp->intersect(home,from,to));
00139 }
00140
00141 forceinline ModEvent
00142 SetView::intersect (Space& home,int n) {
00143 return (varimp->intersect(home,n));
00144 }
00145
00146 template<class I> ModEvent
00147 SetView::includeI (Space& home, I& iter) {
00148 Iter::Ranges::IsRangeIter<I>();
00149 return (varimp->includeI(home, iter));
00150 }
00151
00152 forceinline ModEvent
00153 SetView::exclude (Space& home,int from, int to)
00154 { return (varimp->exclude(home,from,to)); }
00155
00156 template<class I> ModEvent
00157 SetView::excludeI(Space& home, I& iter) {
00158 Iter::Ranges::IsRangeIter<I>();
00159 return varimp->excludeI(home, iter);
00160 }
00161
00162 template<class I> ModEvent
00163 SetView::intersectI(Space& home, I& iter) {
00164 Iter::Ranges::IsRangeIter<I>();
00165 return varimp->intersectI(home, iter);
00166 }
00167
00168
00169
00170
00171
00172
00173
00174
00175 forceinline void
00176 SetView::update(Space& home, bool share, SetView& y) {
00177 varimp = y.varimp->copy(home,share);
00178 }
00179
00180
00181
00182
00183
00184
00185
00186 forceinline ModEvent
00187 SetView::modevent(const Delta& d) { return SetVarImp::modevent(d); }
00188
00189 forceinline int
00190 SetView::glbMin(const Delta& d) const { return SetVarImp::glbMin(d); }
00191
00192 forceinline int
00193 SetView::glbMax(const Delta& d) const { return SetVarImp::glbMax(d); }
00194
00195 forceinline bool
00196 SetView::glbAny(const Delta& d) const { return SetVarImp::glbAny(d); }
00197
00198 forceinline int
00199 SetView::lubMin(const Delta& d) const { return SetVarImp::lubMin(d); }
00200
00201 forceinline int
00202 SetView::lubMax(const Delta& d) const { return SetVarImp::lubMax(d); }
00203
00204 forceinline bool
00205 SetView::lubAny(const Delta& d) const { return SetVarImp::lubAny(d); }
00206
00207
00212 template<>
00213 class LubRanges<SetView> : public LubRanges<SetVarImp*> {
00214 public:
00216
00217
00218 LubRanges(void);
00220 LubRanges(const SetView& x);
00222 void init(const SetView& x);
00224 };
00225
00226 forceinline
00227 LubRanges<SetView>::LubRanges(void) {}
00228
00229 forceinline
00230 LubRanges<SetView>::LubRanges(const SetView& x)
00231 : LubRanges<SetVarImp*>(x.var()) {}
00232
00233 forceinline void
00234 LubRanges<SetView>::init(const SetView& x) {
00235 LubRanges<SetVarImp*>::init(x.var());
00236 }
00237
00238
00243 template<>
00244 class GlbRanges<SetView> : public GlbRanges<SetVarImp*> {
00245 public:
00247
00248
00249 GlbRanges(void);
00251 GlbRanges(const SetView& x);
00253 void init(const SetView& x);
00254 };
00255
00256 forceinline
00257 GlbRanges<SetView>::GlbRanges(void) {}
00258
00259 forceinline
00260 GlbRanges<SetView>::GlbRanges(const SetView& x)
00261 : GlbRanges<SetVarImp*>(x.var()) {}
00262
00263 forceinline void
00264 GlbRanges<SetView>::init(const SetView& x) {
00265 GlbRanges<SetVarImp*>::init(x.var());
00266 }
00267
00268 }}
00269
00270
00271