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;
244 s <<
"\t[" <<
a <<
"] size: " << size
251 return os << s.str();
261 c = &(ts.
data().vd[i].
r[0]);
int n
Number of negative literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
friend FloatVal max(const FloatVal &x, const FloatVal &y)
friend FloatVal min(const FloatVal &x, const FloatVal &y)
Passing integer arguments.
SharedHandle::Object * object(void) const
Access to the shared object.
static const unsigned int bpb
Bits per base.
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.
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.
Tuple add(void)
Return newly added tuple.
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.
int min(void) const
Return smallest value of range.
void operator++(void)
Move iterator to next range (if possible)
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.
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 * Tuple
Type of a tuple.
int min(void) const
Return minimal value in all tuples.
Data & raw(void) const
Get raw data (must be initialized)
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.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
void range(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
#define GECODE_NEVER
Assert that this command is never executed.