46 return static_cast<unsigned int>(
max -
min + 1);
51 assert((
min <= n) && (n <=
max));
52 return s + n_words *
static_cast<unsigned int>(n -
min);
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);
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;
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();
261 c = &(ts.
data().vd[i].
r[0]);
Passing integer arguments.
SharedHandle::Object * object(void) const
Access to the shared object.
static const unsigned int bpb
Bits per base.
int n_free
Number of free tuple entries of arity.
void resize(void)
Resize tuple data.
BitSetData * support
Pointer to all support data.
Data(int a)
Initialize as empty tuple set with arity a.
unsigned int n_words
Number of words for support.
static void set(BitSetData *d, unsigned int n)
Set bit n in bitset data d.
int n_tuples
Number of Tuples.
Tuple get(int i) const
Return tuple with number i.
unsigned int tuple2idx(Tuple t) const
Map tuple address to index.
Range * range
Pointer to all ranges.
const Range * lst(int i) const
Return last range for position i.
bool finalized(void) const
Is datastructure finalized.
ValueData * vd
Value data.
const Range * fst(int i) const
Return first range for position i.
static const int n_initial_free
Initial number of free tuples.
Tuple add(void)
Return newly added tuple.
BitSetData * s
Begin of supports.
unsigned int width(void) const
Return the width.
const BitSetData * supports(unsigned int n_words, int n) const
Return the supports for value n.
bool operator()(void) const
Test whether iterator is still at a range.
Ranges(const TupleSet &ts, int i)
Initialize for column i.
int max(void) const
Return largest value of range.
const Range * l
Last range.
int min(void) const
Return smallest value of range.
void operator++(void)
Move iterator to next range (if possible)
const Range * c
Current range.
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
Data about values in the table.
unsigned int start(int n) const
Find start range for value n.
unsigned int n
Number of ranges.
Class represeting a set of tuples.
TupleSet(void)
Construct an unitialized tuple set.
void _add(const IntArgs &t)
Add tuple t to tuple set.
int tuples(void) const
Number of tuples.
int max(void) const
Return maximal value in all tuples.
bool operator!=(const TupleSet &t) const
Test whether tuple set is different from t.
bool finalized(void) const
Is tuple set finalized.
TupleSet & add(const IntArgs &t)
Add tuple t to tuple set.
bool operator==(const TupleSet &t) const
Test whether tuple set is equal to t.
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const TupleSet &ts)
Tuple operator[](int i) const
Get tuple i.
const Range * lst(int i) const
Return last range for position i.
int * Tuple
Type of a tuple.
std::size_t hash(void) const
Return hash key.
void finalize(void)
Finalize tuple set.
bool equal(const TupleSet &t) const
Test whether tuple set is equal to t.
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 minimal value in all tuples.
Data & raw(void) const
Get raw data (must be initialized)
Gecode::Support::BitSetData BitSetData
Import bit set data type.
Data & data(void) const
Get data (must be initialized and finalized)
int arity(void) const
Arity of tuple set.
Heap heap
The single global heap.
Numerical limits for integer variables.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
#define GECODE_NEVER
Assert that this command is never executed.