const.hpp
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Guido Tack <tack@gecode.org>
*
* Copyright:
* Guido Tack, 2004
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
namespace Gecode { namespace Set {
class ArrayRanges {
private:
int *_ranges;
int _size;
int _pos;
public:
ArrayRanges(void) : _ranges(NULL), _size(0), _pos(0) {}
ArrayRanges(int *ranges, int size)
: _ranges(ranges), _size(size), _pos(0) {}
void init(int* ranges, int size) {
_ranges = ranges; _size = size; _pos = 0;
}
bool operator ()(void) const { return _pos<_size; }
void operator ++(void) { _pos++; }
int min(void) const { return _ranges[_pos*2]; }
int max(void) const { return _ranges[_pos*2+1]; }
unsigned int width(void) const {
return static_cast<unsigned int>(_ranges[_pos*2+1]-_ranges[_pos*2]+1);
}
};
forceinline
ConstSetView::ConstSetView(void) : ranges(NULL), size(0), domSize(0) {}
forceinline
ConstSetView::ConstSetView(Space& home, const IntSet& dom) {
size = dom.ranges();
domSize = 0;
if (size > 0) {
ranges = home.alloc<int>(2*size);
IntSetRanges dr(dom);
for (int i=0; dr(); ++dr, i+=2) {
int min = dr.min(); int max = dr.max();
ranges[i] = min;
ranges[i+1] = max;
domSize += static_cast<unsigned int>(max-min+1);
}
} else {
ranges = NULL;
}
}
forceinline unsigned int
ConstSetView::glbSize(void) const { return domSize; }
forceinline unsigned int
ConstSetView::lubSize(void) const { return domSize; }
forceinline unsigned int
ConstSetView::unknownSize(void) const { return 0; }
forceinline bool
ConstSetView::contains(int i) const {
for (int j=size; j--; ) {
if (ranges[2*j+1] < i)
return false;
if (ranges[2*j] >= i)
return true;
}
return false;
}
forceinline bool
ConstSetView::notContains(int i) const {
return !contains(i);
}
forceinline unsigned int
ConstSetView::cardMin(void) const { return domSize; }
forceinline unsigned int
ConstSetView::cardMax(void) const { return domSize; }
forceinline int
ConstSetView::lubMin(void) const {
return size==0 ? BndSet::MIN_OF_EMPTY : ranges[0];
}
forceinline int
ConstSetView::lubMax(void) const {
return size==0 ? BndSet::MAX_OF_EMPTY : ranges[size*2-1];
}
forceinline int
ConstSetView::glbMin(void) const { return lubMin(); }
forceinline int
ConstSetView::glbMax(void) const { return lubMax(); }
forceinline ModEvent
ConstSetView::cardMin(Space&,unsigned int c) {
return c<=domSize ? ME_SET_NONE : ME_SET_FAILED;
}
forceinline ModEvent
ConstSetView::cardMax(Space&,unsigned int c) {
return c>=domSize ? ME_SET_NONE : ME_SET_FAILED;
}
forceinline ModEvent
ConstSetView::include(Space&,int c) {
return contains(c) ? ME_SET_NONE : ME_SET_FAILED;
}
forceinline ModEvent
ConstSetView::exclude(Space&,int c) {
return contains(c) ? ME_SET_FAILED : ME_SET_NONE;
}
forceinline ModEvent
ConstSetView::intersect(Space&,int c) {
return (size==0 ||
(size==1 &&
ranges[0]==ranges[1] && ranges[0]==c)) ?
ME_SET_NONE : ME_SET_FAILED;
}
forceinline ModEvent
ConstSetView::intersect(Space&,int i,int j) {
return (glbMin()>=i && glbMax()<=j) ?
ME_SET_NONE : ME_SET_FAILED;
}
forceinline ModEvent
ConstSetView::include(Space&,int i,int j) {
Iter::Ranges::Singleton single(i,j);
ArrayRanges ar(ranges, size);
return (single() && Iter::Ranges::subset(single, ar)) ?
ME_SET_NONE : ME_SET_FAILED;
}
forceinline ModEvent
ConstSetView::exclude(Space&,int i,int j) {
Iter::Ranges::Singleton single(i,j);
ArrayRanges ar(ranges, size);
return (single() && Iter::Ranges::subset(single, ar)) ?
ME_SET_FAILED : ME_SET_NONE;
}
template<class I> ModEvent
ConstSetView::excludeI(Space&,I& i) {
ArrayRanges ar(ranges, size);
return (i() && Iter::Ranges::subset(i, ar)) ? ME_SET_FAILED : ME_SET_NONE;
}
template<class I> ModEvent
ConstSetView::includeI(Space&,I& i) {
ArrayRanges ar(ranges, size);
return Iter::Ranges::subset(i, ar) ? ME_SET_NONE : ME_SET_FAILED;
}
template<class I> ModEvent
ConstSetView::intersectI(Space&,I& i) {
ArrayRanges ar(ranges, size);
return Iter::Ranges::subset(ar, i) ? ME_SET_NONE : ME_SET_FAILED;
}
forceinline void
ConstSetView::update(Space& home, ConstSetView& p) {
ConstView<SetView>::update(home,p);
// dispose old ranges
if (size > 0)
home.free<int>(ranges, 2);
domSize = p.domSize;
size = p.size;
if (size == 0) {
ranges = NULL;
} else {
// copy ranges from p
ranges = home.alloc<int>(2*size);
for (int i=size; i--; ) {
ranges[2*i] = p.ranges[2*i];
ranges[2*i+1] = p.ranges[2*i+1];
}
}
}
/*
* Delta information for advisors
*
*/
forceinline int
ConstSetView::glbMin(const Delta&) const {
GECODE_NEVER;
return 0;
}
forceinline int
ConstSetView::glbMax(const Delta&) const {
GECODE_NEVER;
return 0;
}
forceinline bool
ConstSetView::glbAny(const Delta&) const {
GECODE_NEVER;
return false;
}
forceinline int
ConstSetView::lubMin(const Delta&) const {
GECODE_NEVER;
return 0;
}
forceinline int
ConstSetView::lubMax(const Delta&) const {
GECODE_NEVER;
return 0;
}
forceinline bool
ConstSetView::lubAny(const Delta&) const {
GECODE_NEVER;
return false;
}
forceinline
EmptyView::EmptyView(void) {}
forceinline unsigned int
EmptyView::glbSize(void) const { return 0; }
forceinline unsigned int
EmptyView::lubSize(void) const { return 0; }
forceinline unsigned int
EmptyView::unknownSize(void) const { return 0; }
forceinline bool
EmptyView::contains(int) const { return false; }
forceinline bool
EmptyView::notContains(int) const { return true; }
forceinline unsigned int
EmptyView::cardMin(void) const { return 0; }
forceinline unsigned int
EmptyView::cardMax(void) const { return 0; }
forceinline int
EmptyView::lubMin(void) const { return 0; }
forceinline int
EmptyView::lubMax(void) const { return 0; }
forceinline int
EmptyView::glbMin(void) const { return 0; }
forceinline int
EmptyView::glbMax(void) const { return 0; }
forceinline ModEvent
EmptyView::cardMin(Space&,unsigned int c) {
return c==0 ? ME_SET_NONE : ME_SET_FAILED;
}
forceinline ModEvent
EmptyView::cardMax(Space&,unsigned int) {
return ME_SET_NONE;
}
forceinline ModEvent
EmptyView::include(Space&,int) {
return ME_SET_FAILED;
}
forceinline ModEvent
EmptyView::exclude(Space&,int) { return ME_SET_NONE; }
forceinline ModEvent
EmptyView::intersect(Space&,int) { return ME_SET_NONE; }
forceinline ModEvent
EmptyView::intersect(Space&,int,int) { return ME_SET_NONE; }
forceinline ModEvent
EmptyView::include(Space&,int,int) {
return ME_SET_FAILED; }
forceinline ModEvent
EmptyView::exclude(Space&,int,int) { return ME_SET_NONE; }
template<class I> ModEvent
EmptyView::excludeI(Space&,I&) {
return ME_SET_NONE;
}
template<class I> ModEvent
EmptyView::includeI(Space&,I& i) {
return i() ? ME_SET_FAILED : ME_SET_NONE;
}
template<class I> ModEvent
EmptyView::intersectI(Space&,I&) {
return ME_SET_NONE;
}
/*
* Delta information for advisors
*
*/
forceinline int
EmptyView::glbMin(const Delta&) const {
GECODE_NEVER;
return 0;
}
forceinline int
EmptyView::glbMax(const Delta&) const {
GECODE_NEVER;
return 0;
}
forceinline bool
EmptyView::glbAny(const Delta&) const {
GECODE_NEVER;
return false;
}
forceinline int
EmptyView::lubMin(const Delta&) const {
GECODE_NEVER;
return 0;
}
forceinline int
EmptyView::lubMax(const Delta&) const {
GECODE_NEVER;
return 0;
}
forceinline bool
EmptyView::lubAny(const Delta&) const {
GECODE_NEVER;
return false;
}
// Constant universe variable
forceinline
UniverseView::UniverseView(void) {}
forceinline unsigned int
UniverseView::glbSize(void) const { return Set::Limits::card; }
forceinline unsigned int
UniverseView::lubSize(void) const { return Set::Limits::card; }
forceinline unsigned int
UniverseView::unknownSize(void) const { return 0; }
forceinline bool
UniverseView::contains(int) const { return true; }
forceinline bool
UniverseView::notContains(int) const { return false; }
forceinline unsigned int
UniverseView::cardMin(void) const { return Set::Limits::card; }
forceinline unsigned int
UniverseView::cardMax(void) const { return Limits::card; }
forceinline int
UniverseView::lubMin(void) const { return Limits::card; }
forceinline int
UniverseView::lubMax(void) const { return Limits::card; }
forceinline int
UniverseView::glbMin(void) const { return Limits::card; }
forceinline int
UniverseView::glbMax(void) const { return Limits::card; }
forceinline ModEvent
UniverseView::cardMin(Space&,unsigned int c) {
return c>Limits::card ? ME_SET_FAILED : ME_SET_NONE;
}
forceinline ModEvent
UniverseView::cardMax(Space&,unsigned int c) {
return c>=Limits::card ? ME_SET_NONE : ME_SET_FAILED;
}
forceinline ModEvent
UniverseView::include(Space&,int) {
return ME_SET_NONE;
}
forceinline ModEvent
UniverseView::exclude(Space&,int) { return ME_SET_FAILED; }
forceinline ModEvent
UniverseView::intersect(Space&,int) { return ME_SET_FAILED; }
forceinline ModEvent
UniverseView::include(Space&,int,int) { return ME_SET_NONE; }
forceinline ModEvent
UniverseView::exclude(Space&,int,int) { return ME_SET_FAILED; }
template<class I> ModEvent
UniverseView::excludeI(Space&,I& i) {
return i() ? ME_SET_FAILED : ME_SET_NONE;
}
template<class I> forceinline ModEvent
UniverseView::includeI(Space&,I&) {
return ME_SET_NONE;
}
forceinline ModEvent
UniverseView::intersect(Space&,int i,int j) {
return (i>Limits::min ||
j<Limits::max) ? ME_SET_FAILED : ME_SET_NONE;
}
template<class I> forceinline ModEvent
UniverseView::intersectI(Space&,I& i) {
return (i() &&
(i.min()>Limits::min ||
i.max()<Limits::max) ) ?
ME_SET_FAILED : ME_SET_NONE;
}
/*
* Delta information for advisors
*
*/
forceinline int
UniverseView::glbMin(const Delta&) const {
GECODE_NEVER;
return 0;
}
forceinline int
UniverseView::glbMax(const Delta&) const {
GECODE_NEVER;
return 0;
}
forceinline bool
UniverseView::glbAny(const Delta&) const {
GECODE_NEVER;
return false;
}
forceinline int
UniverseView::lubMin(const Delta&) const {
GECODE_NEVER;
return 0;
}
forceinline int
UniverseView::lubMax(const Delta&) const {
GECODE_NEVER;
return 0;
}
forceinline bool
UniverseView::lubAny(const Delta&) const {
GECODE_NEVER;
return false;
}
/*
* Iterators
*
*/
template<>
class LubRanges<EmptyView> : public Iter::Ranges::Empty {
public:
LubRanges(void) {}
LubRanges(const EmptyView& x) { (void)x; }
void init(const EmptyView& x) { (void)x; }
};
template<>
class GlbRanges<EmptyView> : public Iter::Ranges::Empty {
public:
GlbRanges(void) {}
GlbRanges(const EmptyView& x) { (void)x; }
void init(const EmptyView& x) { (void)x; }
};
template<>
class LubRanges<UniverseView> : public Iter::Ranges::Singleton {
public:
LubRanges(void)
: Iter::Ranges::Singleton(Limits::min,
Limits::max) {}
LubRanges(const UniverseView& x)
: Iter::Ranges::Singleton(Limits::min,
Limits::max) {
(void)x;
}
void init(const UniverseView& x) { (void)x; }
};
template<>
class GlbRanges<UniverseView> : public Iter::Ranges::Singleton {
public:
GlbRanges(void)
: Iter::Ranges::Singleton(Limits::min,
Limits::max) {}
GlbRanges(const UniverseView& x)
: Iter::Ranges::Singleton(Limits::min,
Limits::max) {
(void)x;
}
void init(const UniverseView& x) { (void)x; }
};
template<>
class LubRanges<ConstSetView> {
private:
ArrayRanges ar;
public:
LubRanges(void) {}
LubRanges(const ConstSetView& x) : ar(x.ranges,x.size) {}
void init(const ConstSetView& x) {
ar.init(x.ranges,x.size);
}
bool operator ()(void) const { return ar(); }
void operator ++(void) { ++ar; }
int min(void) const { return ar.min(); }
int max(void) const { return ar.max(); }
unsigned int width(void) const { return ar.width(); }
};
template<>
class GlbRanges<ConstSetView> : public LubRanges<ConstSetView> {
public:
GlbRanges(void) {}
GlbRanges(const ConstSetView& x) : LubRanges<ConstSetView>(x) {}
void init(const ConstSetView& x) {
LubRanges<ConstSetView>::init(x);
}
};
forceinline bool
ConstSetView::operator <(const ConstSetView& y) const {
if (size < y.size)
return true;
if (size > y.size)
return false;
if (domSize < y.domSize)
return true;
if (domSize > y.domSize)
return false;
for (int i=size; i--; ) {
if (ranges[2*i] < y.ranges[2*i])
return true;
if (ranges[2*i] > y.ranges[2*i])
return false;
if (ranges[2*i+1] < y.ranges[2*i+1])
return true;
if (ranges[2*i+1] > y.ranges[2*i+1])
return false;
}
return false;
}
/*
* Testing
*
*/
forceinline bool
operator ==(const ConstSetView& x, const ConstSetView& y) {
if ((x.size != y.size) || (x.domSize != y.domSize))
return false;
for (int i=x.size; i--; )
if ((x.ranges[2*i] != y.ranges[2*i]) ||
(x.ranges[2*i+1] != y.ranges[2*i+1]))
return false;
return true;
}
forceinline bool
operator !=(const ConstSetView& x, const ConstSetView& y) {
return !(x == y);
}
forceinline bool
operator ==(const EmptyView&, const EmptyView&) {
return true;
}
forceinline bool
operator !=(const EmptyView&, const EmptyView&) {
return false;
}
forceinline bool
operator ==(const UniverseView&, const UniverseView&) {
return true;
}
forceinline bool
operator !=(const UniverseView&, const UniverseView&) {
return false;
}
}}
// STATISTICS: set-var
Gecode::ConstView::update
void update(Space &home, ConstView &y)
Update this view to be a clone of view y.
Definition view.hpp:461
Gecode::Delta
Generic domain change information to be supplied to advisors.
Definition core.hpp:204
Gecode::IntSetRanges
Range iterator for integer sets.
Definition int.hh:292
Gecode::IntSet
Integer sets.
Definition int.hh:174
Gecode::Iter::Ranges::Empty
Range iterator for empty range.
Definition ranges-empty.hpp:42
Gecode::Iter::Ranges::Singleton
Range iterator for singleton range.
Definition ranges-singleton.hpp:42
Gecode::Iter::Ranges::Singleton::Singleton
Singleton(void)
Default constructor.
Definition ranges-singleton.hpp:63
Gecode::Set::ArrayRanges
Range iterator for a two-dimensional array
Definition const.hpp:40
Gecode::Set::ArrayRanges::operator()
bool operator()(void) const
Test whether iterator is still at a range or done.
Definition const.hpp:62
Gecode::Set::ArrayRanges::width
unsigned int width(void) const
Return width of range (distance between minimum and maximum).
Definition const.hpp:74
Gecode::Set::ArrayRanges::ArrayRanges
ArrayRanges(int *ranges, int size)
Initialize with ranges for array ranges which is of size size.
Definition const.hpp:51
Gecode::Set::ArrayRanges::max
int max(void) const
Return largest value of range.
Definition const.hpp:72
Gecode::Set::ArrayRanges::ArrayRanges
ArrayRanges(void)
Default constructor.
Definition const.hpp:49
Gecode::Set::ArrayRanges::init
void init(int *ranges, int size)
Initialize with ranges for array ranges which is of size size.
Definition const.hpp:54
Gecode::Set::ArrayRanges::min
int min(void) const
Return smallest value of range.
Definition const.hpp:70
Gecode::Set::ArrayRanges::operator++
void operator++(void)
Move iterator to next range (if possible).
Definition const.hpp:64
Gecode::Set::BndSet::MAX_OF_EMPTY
static const int MAX_OF_EMPTY
Returned by empty sets when asked for their maximum element.
Definition var-imp.hpp:110
Gecode::Set::BndSet::MIN_OF_EMPTY
static const int MIN_OF_EMPTY
Returned by empty sets when asked for their minimum element.
Definition var-imp.hpp:112
Gecode::Set::ConstSetView
Constant view.
Definition view.hpp:186
Gecode::Set::ConstSetView::notContains
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition const.hpp:122
Gecode::Set::ConstSetView::lubSize
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition const.hpp:105
Gecode::Set::ConstSetView::glbAny
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition const.hpp:253
Gecode::Set::ConstSetView::cardMin
unsigned int cardMin(void) const
Return minimum cardinality.
Definition const.hpp:127
Gecode::Set::ConstSetView::intersect
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
Gecode::Set::ConstSetView::contains
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition const.hpp:111
Gecode::Set::ConstSetView::operator<
bool operator<(const ConstSetView &y) const
Whether this view comes before view y (arbitray order).
Definition const.hpp:680
Gecode::Set::ConstSetView::include
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
Gecode::Set::ConstSetView::glbSize
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition const.hpp:102
Gecode::Set::ConstSetView::lubMax
int lubMax(void) const
Return maximum of the least upper bound.
Definition const.hpp:138
Gecode::Set::ConstSetView::includeI
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition const.hpp:205
Gecode::Set::ConstSetView::exclude
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
Gecode::Set::ConstSetView::glbMax
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition const.hpp:146
Gecode::Set::ConstSetView::intersectI
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition const.hpp:211
Gecode::Set::ConstSetView::unknownSize
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition const.hpp:108
Gecode::Set::ConstSetView::excludeI
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition const.hpp:199
Gecode::Set::ConstSetView::lubMin
int lubMin(void) const
Return minimum of the least upper bound.
Definition const.hpp:133
Gecode::Set::ConstSetView::glbMin
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition const.hpp:143
Gecode::Set::ConstSetView::update
void update(Space &home, ConstSetView &y)
Update this view to be a clone of view y.
Definition const.hpp:217
Gecode::Set::ConstSetView::ConstSetView
ConstSetView(void)
Default constructor.
Definition const.hpp:81
Gecode::Set::ConstSetView::lubAny
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition const.hpp:268
Gecode::Set::ConstSetView::cardMax
unsigned int cardMax(void) const
Return maximum cardinality.
Definition const.hpp:130
Gecode::Set::EmptyView
Constant view for the empty set.
Definition view.hpp:336
Gecode::Set::EmptyView::EmptyView
EmptyView(void)
Default constructor.
Definition const.hpp:274
Gecode::Set::EmptyView::cardMin
unsigned int cardMin(void) const
Return minimum cardinality.
Definition const.hpp:294
Gecode::Set::EmptyView::includeI
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition const.hpp:349
Gecode::Set::EmptyView::contains
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition const.hpp:288
Gecode::Set::EmptyView::lubMax
int lubMax(void) const
Return maximum of the least upper bound.
Definition const.hpp:303
Gecode::Set::EmptyView::notContains
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition const.hpp:291
Gecode::Set::EmptyView::glbAny
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition const.hpp:375
Gecode::Set::EmptyView::lubMin
int lubMin(void) const
Return minimum of the least upper bound.
Definition const.hpp:300
Gecode::Set::EmptyView::glbSize
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition const.hpp:279
Gecode::Set::EmptyView::glbMin
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition const.hpp:306
Gecode::Set::EmptyView::include
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
Gecode::Set::EmptyView::glbMax
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition const.hpp:309
Gecode::Set::EmptyView::excludeI
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition const.hpp:344
Gecode::Set::EmptyView::lubAny
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition const.hpp:393
Gecode::Set::EmptyView::cardMax
unsigned int cardMax(void) const
Return maximum cardinality.
Definition const.hpp:297
Gecode::Set::EmptyView::exclude
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
Gecode::Set::EmptyView::intersect
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
Gecode::Set::EmptyView::lubSize
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition const.hpp:282
Gecode::Set::EmptyView::intersectI
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition const.hpp:354
Gecode::Set::EmptyView::unknownSize
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition const.hpp:285
Gecode::Set::GlbRanges< ConstSetView >::init
void init(const ConstSetView &x)
Initialize with ranges for view x.
Definition const.hpp:673
Gecode::Set::GlbRanges< ConstSetView >::GlbRanges
GlbRanges(const ConstSetView &x)
Initialize with ranges for view x.
Definition const.hpp:671
Gecode::Set::GlbRanges< ConstSetView >::GlbRanges
GlbRanges(void)
Default constructor.
Definition const.hpp:669
Gecode::Set::GlbRanges< EmptyView >::GlbRanges
GlbRanges(const EmptyView &x)
Initialize with ranges for view x.
Definition const.hpp:564
Gecode::Set::GlbRanges< EmptyView >::init
void init(const EmptyView &x)
Initialize with ranges for view x.
Definition const.hpp:566
Gecode::Set::GlbRanges< EmptyView >::GlbRanges
GlbRanges(void)
Default constructor.
Definition const.hpp:562
Gecode::Set::GlbRanges< UniverseView >::GlbRanges
GlbRanges(const UniverseView &x)
Initialize with ranges for view x.
Definition const.hpp:608
Gecode::Set::GlbRanges< UniverseView >::init
void init(const UniverseView &x)
Initialize with ranges for view x.
Definition const.hpp:614
Gecode::Set::GlbRanges< UniverseView >::GlbRanges
GlbRanges(void)
Default constructor.
Definition const.hpp:604
Gecode::Set::GlbRanges< UniverseView >::min
int min(void) const
Gecode::Set::GlbRanges< UniverseView >::max
int max(void) const
Gecode::Set::LubRanges< ConstSetView >::LubRanges
LubRanges(void)
Default constructor.
Definition const.hpp:631
Gecode::Set::LubRanges< ConstSetView >::max
int max(void) const
Return largest value of range.
Definition const.hpp:653
Gecode::Set::LubRanges< ConstSetView >::min
int min(void) const
Return smallest value of range.
Definition const.hpp:651
Gecode::Set::LubRanges< ConstSetView >::LubRanges
LubRanges(const ConstSetView &x)
Initialize with ranges for view x.
Definition const.hpp:633
Gecode::Set::LubRanges< ConstSetView >::init
void init(const ConstSetView &x)
Initialize with ranges for view x.
Definition const.hpp:635
Gecode::Set::LubRanges< ConstSetView >::width
unsigned int width(void) const
Return width of range (distance between minimum and maximum).
Definition const.hpp:655
Gecode::Set::LubRanges< EmptyView >::LubRanges
LubRanges(const EmptyView &x)
Initialize with ranges for view x.
Definition const.hpp:546
Gecode::Set::LubRanges< EmptyView >::LubRanges
LubRanges(void)
Default constructor.
Definition const.hpp:544
Gecode::Set::LubRanges< EmptyView >::init
void init(const EmptyView &x)
Initialize with ranges for view x.
Definition const.hpp:548
Gecode::Set::LubRanges< UniverseView >::LubRanges
LubRanges(void)
Default constructor.
Definition const.hpp:580
Gecode::Set::LubRanges< UniverseView >::init
void init(const UniverseView &x)
Initialize with ranges for view x.
Definition const.hpp:590
Gecode::Set::LubRanges< UniverseView >::LubRanges
LubRanges(const UniverseView &x)
Initialize with ranges for view x.
Definition const.hpp:584
Gecode::Set::LubRanges::init
void init(const T &x)
Initialize with least upper bound ranges for set variable x.
Gecode::Set::LubRanges< UniverseView >::max
int max(void) const
Gecode::Set::LubRanges::operator()
bool operator()(void) const
Test whether iterator is still at a range or done.
Gecode::Set::LubRanges::operator++
void operator++(void)
Move iterator to next range (if possible).
Gecode::Set::LubRanges< UniverseView >::min
int min(void) const
Gecode::Set::UniverseView
Constant view for the universe.
Definition view.hpp:464
Gecode::Set::UniverseView::glbMax
int glbMax(void) const
Return maximum of the greatest lower bound.
Definition const.hpp:434
Gecode::Set::UniverseView::excludeI
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
Definition const.hpp:465
Gecode::Set::UniverseView::exclude
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::Set::UniverseView::glbMin
int glbMin(void) const
Return minimum of the greatest lower bound.
Definition const.hpp:431
Gecode::Set::UniverseView::lubAny
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
Definition const.hpp:524
Gecode::Set::UniverseView::includeI
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
Definition const.hpp:470
Gecode::Set::UniverseView::UniverseView
UniverseView(void)
Default constructor.
Definition const.hpp:401
Gecode::Set::UniverseView::intersectI
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Definition const.hpp:481
Gecode::Set::UniverseView::include
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
Gecode::Set::UniverseView::intersect
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
Gecode::Set::UniverseView::notContains
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition const.hpp:416
Gecode::Set::UniverseView::contains
bool contains(int i) const
Test whether i is in the greatest lower bound.
Definition const.hpp:413
Gecode::Set::UniverseView::glbAny
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.
Definition const.hpp:506
Gecode::Set::UniverseView::lubMax
int lubMax(void) const
Return maximum of the least upper bound.
Definition const.hpp:428
Gecode::Set::UniverseView::unknownSize
unsigned int unknownSize(void) const
Return the number of unknown elements.
Definition const.hpp:410
Gecode::Set::UniverseView::cardMin
unsigned int cardMin(void) const
Return minimum cardinality.
Definition const.hpp:419
Gecode::Set::UniverseView::glbSize
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Definition const.hpp:404
Gecode::Set::UniverseView::lubSize
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
Definition const.hpp:407
Gecode::Set::UniverseView::cardMax
unsigned int cardMax(void) const
Return maximum cardinality.
Definition const.hpp:422
Gecode::Set::UniverseView::lubMin
int lubMin(void) const
Return minimum of the least upper bound.
Definition const.hpp:425
Gecode::Space
Computation spaces.
Definition core.hpp:1742
Gecode::Space::alloc
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
Definition core.hpp:2837
Gecode::Space::free
void free(T *b, long unsigned int n)
Delete n objects allocated from space heap starting at b.
Definition core.hpp:2863
Gecode::Int::Limits
Numerical limits for integer variables.
Definition int.hh:114
Gecode::Int::operator==
bool operator==(const CachedView< View > &x, const CachedView< View > &y)
Definition cached.hpp:401
Gecode::Int::operator!=
bool operator!=(const CachedView< View > &x, const CachedView< View > &y)
Definition cached.hpp:406
Gecode::Iter::Ranges::subset
bool subset(I &i, J &j)
Check whether range iterator i is subset of range iterator j.
Definition ranges-operations.hpp:97
Gecode::Iter
Range and value iterators.
Definition iter.hh:41
Gecode::Set::Limits::min
const int min
Smallest allowed integer in integer set.
Definition set.hh:99
Gecode::Set::Limits::card
const unsigned int card
Maximum cardinality of an integer set.
Definition set.hh:101
Gecode::Set::Limits::max
const int max
Largest allowed integer in integer set.
Definition set.hh:97
Gecode::Set
Finite integer sets.
Definition var-imp.hpp:137
Gecode::Set::ME_SET_NONE
const Gecode::ModEvent ME_SET_NONE
Domain operation has not changed domain.
Definition var-type.hpp:140
Gecode::Set::ME_SET_FAILED
const Gecode::ModEvent ME_SET_FAILED
Domain operation has resulted in failure.
Definition var-type.hpp:138
Gecode
Gecode toplevel namespace
Gecode::min
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition arithmetic.cpp:67
Gecode::dom
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition dom.cpp:40
Gecode::max
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition arithmetic.cpp:49
Gecode::ModEvent
int ModEvent
Type for modification events.
Definition core.hpp:62
forceinline
#define forceinline
Definition config.hpp:187
GECODE_NEVER
#define GECODE_NEVER
Assert that this command is never executed.
Definition macros.hpp:56