24 #ifndef PPL_CO_Tree_templates_hh
25 #define PPL_CO_Tree_templates_hh 1
29 template <
typename Iterator>
57 static std::pair<dimension_type, signed char>
75 while (stack_first_empty != 0) {
84 const signed char top_operation = stack[stack_first_empty - 1].second;
86 switch (top_operation) {
118 root.
index() = i.index();
124 PPL_ASSERT(stack_first_empty + 3 <
sizeof(stack)/
sizeof(stack[0]));
127 stack[stack_first_empty - 1].second = 0;
128 stack[stack_first_empty ] = std::make_pair(top_n - half, 2);
129 stack[stack_first_empty + 1] = std::make_pair(1, 3);
130 stack[stack_first_empty + 2].second = 0;
131 stack[stack_first_empty + 3] = std::make_pair(half - 1, 1);
132 stack_first_empty += 4;
142 #endif // !defined(PPL_CO_Tree_templates_hh)
Coefficient data_type
The type of the data elements associated with keys.
void init(dimension_type n)
Initializes a tree with reserved size at least n .
size_t dimension_type
An unsigned integral type for representing space dimensions.
bool OK() const
Checks the internal invariants.
static unsigned integer_log2(dimension_type n)
Returns the floor of the base-2 logarithm of n .
static bool is_greater_than_ratio(dimension_type numer, dimension_type denom, dimension_type ratio)
Compares the fractions numer/denom with ratio/100.
void get_parent()
Makes the iterator point to the parent of the current node.
static const dimension_type max_density_percent
The maximum density of used nodes.
void get_left_child()
Makes the iterator point to the left child of the current node.
dimension_type reserved_size
The number of nodes in the complete tree.
#define sizeof_to_bits(size)
dimension_type & index()
Returns a reference to the index of the element pointed to by *this.
The entire library is confined to this namespace.
dimension_type size_
The number of values stored in the tree.
static const dimension_type unused_index
An index used as a marker for unused nodes in the tree.
void get_right_child()
Makes the iterator point to the right child of the current node.
CO_Tree()
Constructs an empty tree.