Sets of integers. More...
#include <var-imp.hpp>
Public Member Functions | |
bool | isConsistent (void) const |
Check whether internal invariants hold. More... | |
Static Public Attributes | |
static const int | MAX_OF_EMPTY = Limits::min-1 |
Returned by empty sets when asked for their maximum element. More... | |
static const int | MIN_OF_EMPTY = Limits::max+1 |
Returned by empty sets when asked for their minimum element. More... | |
Protected Member Functions | |
void | fst (RangeList *r) |
Set first range to r. More... | |
void | lst (RangeList *r) |
Set last range to r. More... | |
RangeList * | fst (void) const |
Return first range. More... | |
RangeList * | lst (void) const |
Return last range. More... | |
template<class I > | |
bool | overwrite (Space &home, I &i) |
Overwrite the ranges with those represented by i. More... | |
Protected Attributes | |
unsigned int | _size |
The size of this set. More... | |
unsigned int | _card |
The cardinality this set represents. More... | |
Constructors and initialization | |
BndSet (void) | |
Default constructor. Creates an empty set. More... | |
BndSet (Space &home, int i, int j) | |
Initialize as the set ![]() | |
BndSet (Space &home, const IntSet &s) | |
Initialize as the set represented by s. More... | |
Memory management | |
void | dispose (Space &home) |
Free memory used by this set. More... | |
Value access | |
int | min (void) const |
Return smallest element. More... | |
int | max (void) const |
Return greatest element. More... | |
int | minN (unsigned int n) const |
Return n -th smallest element. More... | |
unsigned int | size (void) const |
Return size. More... | |
unsigned int | card (void) const |
Return cardinality. More... | |
void | card (unsigned int c) |
Set cardinality. More... | |
Tests | |
bool | empty (void) const |
Test whether this set is empty. More... | |
bool | in (int i) const |
Test whether i is an element of this set. More... | |
Update operations | |
void | become (Space &home, const BndSet &s) |
Make this set equal to s. More... | |
Range list access for iteration | |
RangeList * | ranges (void) const |
Return range list for iteration. More... | |
Cloning | |
void | update (Space &home, BndSet &x) |
Update this set to be a clone of set x. More... | |
Sets of integers.
Definition at line 93 of file var-imp.hpp.
|
inline |
Default constructor. Creates an empty set.
Definition at line 50 of file integerset.hpp.
|
inline |
Initialize as the set .
Definition at line 80 of file integerset.hpp.
Initialize as the set represented by s.
Definition at line 44 of file integerset.cpp.
|
inlineprotected |
Set first range to r.
Definition at line 70 of file integerset.hpp.
|
inlineprotected |
Set last range to r.
Definition at line 75 of file integerset.hpp.
|
inlineprotected |
Return first range.
Definition at line 54 of file integerset.hpp.
|
inlineprotected |
Return last range.
Definition at line 59 of file integerset.hpp.
|
inline |
Free memory used by this set.
Definition at line 64 of file integerset.hpp.
|
inline |
Return smallest element.
Definition at line 107 of file integerset.hpp.
|
inline |
Return greatest element.
Definition at line 115 of file integerset.hpp.
|
inline |
Return n -th smallest element.
Definition at line 124 of file integerset.hpp.
|
inline |
Return size.
Definition at line 97 of file integerset.hpp.
|
inline |
Return cardinality.
Definition at line 134 of file integerset.hpp.
|
inline |
Set cardinality.
Definition at line 139 of file integerset.hpp.
|
inline |
Test whether this set is empty.
Definition at line 102 of file integerset.hpp.
|
inline |
Test whether i is an element of this set.
Definition at line 228 of file integerset.hpp.
Make this set equal to s.
Definition at line 215 of file integerset.hpp.
|
inline |
Return range list for iteration.
Definition at line 92 of file integerset.hpp.
|
inlineprotected |
Overwrite the ranges with those represented by i.
Definition at line 175 of file integerset.hpp.
Update this set to be a clone of set x.
Definition at line 144 of file integerset.hpp.
bool Gecode::Set::BndSet::isConsistent | ( | void | ) | const |
Check whether internal invariants hold.
Definition at line 293 of file integerset.cpp.
|
protected |
The size of this set.
Definition at line 99 of file var-imp.hpp.
|
protected |
The cardinality this set represents.
Definition at line 101 of file var-imp.hpp.
|
static |
Returned by empty sets when asked for their maximum element.
Definition at line 114 of file var-imp.hpp.
|
static |
Returned by empty sets when asked for their minimum element.
Definition at line 116 of file var-imp.hpp.