Go to the documentation of this file.
46 return static_cast<unsigned int>(
max -
min + 1);
52 return s + n_words *
static_cast<unsigned int>(
n -
min);
63 n_tuples(0), n_free(n_initial_free),
65 td(
heap.alloc<int>(n_initial_free *
a)),
67 range(nullptr), support(nullptr) {
88 assert((
i >= 0) && (
i < n_tuples));
95 unsigned int l=0U, h=
n-1U;
98 unsigned int m =
l + ((h-
l) >> 1);
101 else if (k >
r[m].
max)
124 return static_cast<unsigned int>((
t - td) /
static_cast<unsigned int>(
arity));
133 return &vd[
i].r[vd[
i].n-1U];
143 _add(
t);
return *
this;
150 TupleSet::operator bool(
void)
const {
151 return object() !=
nullptr;
178 return !(*
this ==
t);
219 if (
min() !=
t.min())
221 if (
max() !=
t.max())
232 template<
class Char,
class Traits>
233 std::basic_ostream<Char,Traits>&
235 std::basic_ostringstream<Char,Traits> s;
236 s.copyfmt(os); s.width(0);
237 s <<
"Number of tuples: " << ts.tuples()
238 <<
" (number of words: " << ts.words() <<
" with "
240 for (
int a=0;
a < ts.arity();
a++) {
241 unsigned int size = 0U;
242 for (
const TupleSet::Range*
c=ts.fst(
a);
c<=ts.lst(
a);
c++)
244 s <<
"\t[" <<
a <<
"] size: " <<
size
246 <<
static_cast<unsigned int>(ts.lst(
a)->max - ts.fst(
a)->min + 1)
248 << (ts.lst(
a) - ts.fst(
a) + 1U)
251 return os << s.str();
Data & raw(void) const
Get raw data (must be initialized)
const Range * lst(int i) const
Return last range for position i.
Data about values in the table.
TupleSet & add(const IntArgs &t)
Add tuple t to tuple set.
friend FloatVal max(const FloatVal &x, const FloatVal &y)
Tuple get(int i) const
Return tuple with number i.
const Range * fst(int i) const
Return first range for position i.
unsigned int words(void) const
Return number of required bit set words.
int min(void) const
Return smallest value of range.
const Range * lst(int i) const
Return last range for position i.
bool operator()(void) const
Test whether iterator is still at a range.
friend FloatVal min(const FloatVal &x, const FloatVal &y)
unsigned int size(I &i)
Size of all ranges of range iterator i.
int min(void) const
Return minimal value in all tuples.
SharedHandle::Object * object(void) const
Access to the shared object.
int max(void) const
Return maximal value in all tuples.
void range(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
Gecode toplevel namespace
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const TupleSet &ts)
TupleSet(void)
Construct an unitialized tuple set.
static const unsigned int bpb
Bits per base.
void finalize(void)
Finalize tuple set.
unsigned int n_words
Number of words for support.
Tuple add(void)
Return newly added tuple.
static void set(BitSetData *d, unsigned int n)
Set bit n in bitset data d.
const BitSetData * supports(unsigned int n_words, int n) const
Return the supports for value n.
Post propagator for SetVar SetOpType SetVar SetRelType r
int * Tuple
Type of a tuple.
void _add(const IntArgs &t)
Add tuple t to tuple set.
bool finalized(void) const
Is tuple set finalized.
Class represeting a set of tuples.
#define GECODE_NEVER
Assert that this command is never executed.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
Heap heap
The single global heap.
unsigned int tuple2idx(Tuple t) const
Map tuple address to index.
Tuple operator[](int i) const
Get tuple i.
bool equal(const TupleSet &t) const
Test whether tuple set is equal to t.
bool operator!=(const TupleSet &t) const
Test whether tuple set is different from t.
ValueData * vd
Value data.
std::size_t hash(void) const
Return hash key.
const Range * fst(int i) const
Return first range for position i.
int tuples(void) const
Number of tuples.
Ranges(const TupleSet &ts, int i)
Initialize for column i.
bool operator==(const TupleSet &t) const
Test whether tuple set is equal to t.
int arity(void) const
Arity of tuple set.
unsigned int width(void) const
Return the width.
void operator++(void)
Move iterator to next range (if possible)
Data & data(void) const
Get data (must be initialized and finalized)
Gecode::FloatVal c(-8, 8)
int n_tuples
Number of Tuples.
bool finalized(void) const
Is datastructure finalized.
Data(int a)
Initialize as empty tuple set with arity a.
int n
Number of negative literals for node type.
Passing integer arguments.
Gecode::IntArgs i({1, 2, 3, 4})
int max(void) const
Return largest value of range.
unsigned int n
Number of ranges.
unsigned int start(int n) const
Find start range for value n.