|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Red-black tree with rank support (select/position operations). More...
#include <tpl_rbRk.H>
Classes | |
| class | Iterator |
| Iterator on nodes of the tree. More... | |
Public Types | |
| typedef NodeType< Key > | Node |
| typedef Key | key_type |
Private Member Functions | |
| Node * | search_and_stack_rb (const Key &key, signed char &cmp_result) noexcept |
| Search for key and stack ancestors (optimistic duplicate detection) | |
| Node * | search_dup_and_stack_rb (const Key &key, signed char &cmp_result) |
| Node * | rotate_to_right_rk (Node *p, Node *pp) noexcept |
| Node * | rotate_to_left_rk (Node *p, Node *pp) noexcept |
| void | fix_red_condition (Node *p) |
| void | find_succ_and_swap (Node *p, Node *&pp) |
| void | fix_black_condition (Node *p) |
| void | update_counters_after_insertion () noexcept |
| void | update_counters_after_deletion () noexcept |
| Node * | split_key_rec_rb (Node *p, const Key &key, Node *&t1, Node *&t2) noexcept |
| void | split_key_dup_rec_rb (Node *p, const Key &key, Node *&t1, Node *&t2) noexcept |
| void | split_pos_rec_rb (Node *p, size_t pos, Node *&t1, Node *&t2) noexcept |
Static Private Member Functions | |
| static size_t | black_height (Node *p) noexcept |
| static Node * | rotate_right_simple (Node *p) noexcept |
| static Node * | rotate_left_simple (Node *p) noexcept |
| static void | fix_red_violation (Node *&subtree_root) noexcept |
| static Node * | extract_min_rb (Node *&p) noexcept |
| static Node * | extract_max_rb (Node *&p) noexcept |
| static Node * | join_with_pivot_rb (Node *t1, size_t bh1, Node *pivot, Node *t2, size_t bh2) noexcept |
| static Node * | join_right_rb (Node *t1, size_t bh1, Node *pivot, Node *t2, size_t bh2) noexcept |
| static Node * | join_left_rb (Node *t1, size_t bh1, Node *pivot, Node *t2, size_t bh2) noexcept |
| static Node * | join_exclusive_rec_rb (Node *t1, size_t bh1, Node *t2, size_t bh2) noexcept |
Private Attributes | |
| Node | head_node |
| Node * | head |
| Node *& | root |
| FixedStack< Node * > | rb_stack |
| Compare | cmp |
Static Private Attributes | |
| static constexpr signed char | CmpLess = -1 |
| static constexpr signed char | CmpEqual = 0 |
| static constexpr signed char | CmpGreater = 1 |
Red-black tree with rank support (select/position operations).
This class extends the standard red-black tree with subtree size counts, enabling efficient O(log n) rank-based operations:
count field representing the number of nodes in its subtree (including itself). Rotations update these counts to maintain the invariant. This adds O(1) overhead per rotation but enables O(log n) ranked operations.| NodeType | Node template (RbNodeRk or RbNodeRkVtl). |
| Key | The type of keys stored in the tree. |
| Compare | Comparison functor for ordering keys. |
Definition at line 109 of file tpl_rbRk.H.
| typedef Key Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::key_type |
Definition at line 464 of file tpl_rbRk.H.
| typedef NodeType<Key> Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::Node |
Definition at line 113 of file tpl_rbRk.H.
|
inline |
Definition at line 470 of file tpl_rbRk.H.
|
inlinenoexcept |
Definition at line 481 of file tpl_rbRk.H.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root.
|
virtualdefault |
|
inlinestaticprivatenoexcept |
Definition at line 685 of file tpl_rbRk.H.
References BLACK, COLOR, h, and LLINK.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_exclusive_rec_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_key_dup_rec_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_key_rec_rb(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_pos_rec_rb().
|
inlinestaticprivatenoexcept |
Definition at line 879 of file tpl_rbRk.H.
References Aleph::and, BLACK, COLOR, Aleph::COUNT(), Aleph::divide_and_conquer_partition_dp(), LLINK, RED, and RLINK.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_exclusive_rec_rb().
|
inlinestaticprivatenoexcept |
Definition at line 778 of file tpl_rbRk.H.
References Aleph::and, BLACK, COLOR, Aleph::COUNT(), Aleph::divide_and_conquer_partition_dp(), LLINK, RED, and RLINK.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_exclusive_rec_rb().
|
inlinenoexcept |
Find the inorder position of a key in the tree.
| [in] | key | to be searched |
Definition at line 672 of file tpl_rbRk.H.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::cmp, Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::find_position(), r, and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::find_position().
|
inlineprivate |
Definition at line 303 of file tpl_rbRk.H.
References COLOR, Aleph::COUNT(), Aleph::divide_and_conquer_partition_dp(), LLINK, Aleph::FixedStack< T >::push(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rb_stack, RLINK, and Aleph::FixedStack< T >::top().
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::remove().
|
inlineprivate |
Definition at line 348 of file tpl_rbRk.H.
References BLACK, COLOR, Aleph::divide_and_conquer_partition_dp(), LLINK, Aleph::FixedStack< T >::pop(), Aleph::FixedStack< T >::popn(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rb_stack, RED, RLINK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rotate_to_left_rk(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rotate_to_right_rk(), and Aleph::FixedStack< T >::top().
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::remove().
|
inlineprivate |
Definition at line 242 of file tpl_rbRk.H.
References Aleph::and, BLACK, COLOR, Aleph::divide_and_conquer_partition_dp(), Aleph::FixedStack< T >::empty(), LLINK, Aleph::FixedStack< T >::pop(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rb_stack, RED, RLINK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rotate_to_left_rk(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rotate_to_right_rk().
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert_dup(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_or_insert().
|
inlinestaticprivatenoexcept |
Definition at line 720 of file tpl_rbRk.H.
References Aleph::and, BLACK, COLOR, Aleph::divide_and_conquer_partition_dp(), l, LLINK, r, RED, RLINK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rotate_left_simple(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rotate_right_simple().
|
inlinenoexcept |
Definition at line 468 of file tpl_rbRk.H.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::key_comp().
|
inlinenoexcept |
Definition at line 508 of file tpl_rbRk.H.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root.
Referenced by TEST().
|
inline |
Definition at line 514 of file tpl_rbRk.H.
References Aleph::and, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::CmpEqual, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::CmpGreater, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::CmpLess, COLOR, Aleph::divide_and_conquer_partition_dp(), Aleph::FixedStack< T >::empty(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::fix_red_condition(), KEY, LLINK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rb_stack, RED, RLINK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_and_stack_rb(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::update_counters_after_insertion().
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_exclusive(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Definition at line 566 of file tpl_rbRk.H.
References Aleph::and, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::CmpEqual, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::CmpLess, COLOR, Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::fix_red_condition(), KEY, LLINK, RED, RLINK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_dup_and_stack_rb(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::update_counters_after_insertion().
|
inlinenoexcept |
|
inlinenoexcept |
Join this tree exclusively with another tree.
All keys in this tree must be less than all keys in t. After the operation, t becomes empty and this tree contains all nodes.
| [in,out] | t | tree to join with (will be empty after) |
Definition at line 1333 of file tpl_rbRk.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::FixedStack< T >::is_empty(), LLINK, Aleph::FixedStack< T >::pop(), Aleph::FixedStack< T >::push(), RLINK, and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root.
|
inlinestaticprivatenoexcept |
Definition at line 1132 of file tpl_rbRk.H.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::black_height(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::extract_max_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::extract_min_rb(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_with_pivot_rb().
|
inlinestaticprivatenoexcept |
Definition at line 1067 of file tpl_rbRk.H.
References Aleph::and, BLACK, COLOR, Aleph::COUNT(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_left_rb(), LLINK, RED, RLINK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rotate_left_simple(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rotate_right_simple().
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_left_rb(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_with_pivot_rb().
|
inlinestaticprivatenoexcept |
Definition at line 996 of file tpl_rbRk.H.
References Aleph::and, BLACK, COLOR, Aleph::COUNT(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_right_rb(), LLINK, RED, RLINK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rotate_left_simple(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rotate_right_simple().
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_right_rb(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_with_pivot_rb().
|
inlinestaticprivatenoexcept |
Definition at line 973 of file tpl_rbRk.H.
References COLOR, Aleph::COUNT(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_left_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_right_rb(), LLINK, RED, and RLINK.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_exclusive_rec_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_key_dup_rec_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_key_rec_rb(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_pos_rec_rb().
|
inlinenoexcept |
Definition at line 466 of file tpl_rbRk.H.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::cmp.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::get_compare().
|
inlinenoexcept |
Definition at line 489 of file tpl_rbRk.H.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::cmp, and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root.
|
inlinenoexcept |
Compute the inorder position of a key.
| [in] | key | to be searched |
Definition at line 657 of file tpl_rbRk.H.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::cmp, Aleph::divide_and_conquer_partition_dp(), Aleph::inorder_position(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root.
|
inline |
Definition at line 589 of file tpl_rbRk.H.
References BLACK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::CmpEqual, COLOR, Aleph::divide_and_conquer_partition_dp(), Aleph::FixedStack< T >::empty(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::find_succ_and_swap(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::fix_black_condition(), LLINK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rb_stack, RLINK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_and_stack_rb(), Aleph::FixedStack< T >::top(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::update_counters_after_deletion().
|
inlinestaticprivatenoexcept |
Definition at line 708 of file tpl_rbRk.H.
References Aleph::COUNT(), LLINK, and RLINK.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::fix_red_violation(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_left_rb(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_right_rb().
|
inlinestaticprivatenoexcept |
Definition at line 698 of file tpl_rbRk.H.
References Aleph::COUNT(), LLINK, and RLINK.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::fix_red_violation(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_left_rb(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_right_rb().
|
inlineprivatenoexcept |
Definition at line 220 of file tpl_rbRk.H.
References Aleph::COUNT(), Aleph::divide_and_conquer_partition_dp(), LLINK, and RLINK.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::fix_black_condition(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::fix_red_condition().
|
inlineprivatenoexcept |
Definition at line 197 of file tpl_rbRk.H.
References Aleph::COUNT(), Aleph::divide_and_conquer_partition_dp(), LLINK, and RLINK.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::fix_black_condition(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::fix_red_condition().
|
inline |
Definition at line 502 of file tpl_rbRk.H.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::cmp, Aleph::divide_and_conquer_partition_dp(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root.
Referenced by TEST().
|
inlineprivatenoexcept |
Search for key and stack ancestors (optimistic duplicate detection)
Definition at line 127 of file tpl_rbRk.H.
References Aleph::and, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::cmp, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::CmpEqual, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::CmpGreater, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::CmpLess, Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::head, KEY, LLINK, Aleph::FixedStack< T >::popn(), Aleph::FixedStack< T >::push(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rb_stack, RLINK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root, Aleph::FixedStack< T >::size(), and Aleph::FixedStack< T >::top().
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::remove(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_or_insert().
|
inlineprivate |
Definition at line 170 of file tpl_rbRk.H.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::cmp, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::CmpEqual, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::CmpGreater, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::CmpLess, Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::head, KEY, LLINK, Aleph::FixedStack< T >::push(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rb_stack, RLINK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root, and Aleph::FixedStack< T >::top().
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert_dup().
|
inline |
Definition at line 540 of file tpl_rbRk.H.
References Aleph::and, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::CmpEqual, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::CmpGreater, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::CmpLess, COLOR, Aleph::divide_and_conquer_partition_dp(), Aleph::FixedStack< T >::empty(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::fix_red_condition(), KEY, LLINK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rb_stack, RED, RLINK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_and_stack_rb(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::update_counters_after_insertion().
Referenced by TEST().
|
inline |
Return the i-th node in order sense.
| [in] | i | inorder position of node to be selected |
| out_of_range | if i is greater or equal than the number of nodes of tree |
Definition at line 646 of file tpl_rbRk.H.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root, and Aleph::select().
|
inlinenoexcept |
Definition at line 512 of file tpl_rbRk.H.
References Aleph::COUNT(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_pos(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlinenoexcept |
Split tree by key.
After the operation:
| [in] | key | the splitting key |
| [out] | t1 | tree to receive keys < key |
| [out] | t2 | tree to receive keys > key |
Definition at line 1381 of file tpl_rbRk.H.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::cmp, Aleph::divide_and_conquer_partition_dp(), Aleph::FixedStack< T >::is_empty(), KEY, LLINK, Aleph::FixedStack< T >::pop(), Aleph::FixedStack< T >::push(), RLINK, and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root.
|
inlinenoexcept |
Split tree by key including duplicates.
After the operation:
| [in] | key | the splitting key |
| [out] | t1 | tree to receive keys <= key |
| [out] | t2 | tree to receive keys > key |
Definition at line 1429 of file tpl_rbRk.H.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::cmp, Aleph::divide_and_conquer_partition_dp(), Aleph::FixedStack< T >::is_empty(), KEY, LLINK, Aleph::FixedStack< T >::pop(), Aleph::FixedStack< T >::push(), RLINK, and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root.
Referenced by TEST().
|
inlineprivatenoexcept |
Definition at line 1227 of file tpl_rbRk.H.
References BLACK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::black_height(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::cmp, COLOR, Aleph::COUNT(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_with_pivot_rb(), KEY, LLINK, RED, RLINK, and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_key_dup_rec_rb().
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_key_dup_rec_rb().
|
inlineprivatenoexcept |
Definition at line 1163 of file tpl_rbRk.H.
References BLACK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::black_height(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::cmp, COLOR, Aleph::COUNT(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_with_pivot_rb(), KEY, LLINK, RED, RLINK, and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_key_rec_rb().
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_key_rec_rb().
|
inlinenoexcept |
Split tree by inorder position.
After the operation:
| [in] | pos | the splitting position (0-based) |
| [out] | t1 | tree to receive positions [0, pos) |
| [out] | t2 | tree to receive positions [pos, size) |
Definition at line 1471 of file tpl_rbRk.H.
References Aleph::count(), Aleph::divide_and_conquer_partition_dp(), Aleph::FixedStack< T >::is_empty(), LLINK, Aleph::FixedStack< T >::pop(), Aleph::FixedStack< T >::push(), RLINK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root, and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::size().
|
inlineprivatenoexcept |
Definition at line 1275 of file tpl_rbRk.H.
References BLACK, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::black_height(), COLOR, Aleph::COUNT(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_with_pivot_rb(), LLINK, RED, RLINK, and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_pos_rec_rb().
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_pos_rec_rb().
|
inlinenoexcept |
Definition at line 475 of file tpl_rbRk.H.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::cmp, and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root.
|
inlineprivatenoexcept |
Definition at line 455 of file tpl_rbRk.H.
References Aleph::COUNT(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rb_stack, Aleph::FixedStack< T >::size(), and Aleph::FixedStack< T >::top().
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::remove().
|
inlineprivatenoexcept |
Definition at line 445 of file tpl_rbRk.H.
References Aleph::COUNT(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::rb_stack, Aleph::FixedStack< T >::size(), and Aleph::FixedStack< T >::top().
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert_dup(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_or_insert().
|
inline |
Definition at line 587 of file tpl_rbRk.H.
References Aleph::and, Aleph::check_rank_tree(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::cmp, Aleph::is_red_black_bst_rk(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::root.
|
private |
Definition at line 121 of file tpl_rbRk.H.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::find_position(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::key_comp(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::operator=(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::position(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_and_stack_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_dup_and_stack_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_key(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_key_dup(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_key_dup_rec_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_key_rec_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::swap(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::verify().
|
staticconstexprprivate |
Definition at line 123 of file tpl_rbRk.H.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert_dup(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::remove(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_and_stack_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_dup_and_stack_rb(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_or_insert().
|
staticconstexprprivate |
Definition at line 124 of file tpl_rbRk.H.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_and_stack_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_dup_and_stack_rb(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_or_insert().
|
staticconstexprprivate |
Definition at line 122 of file tpl_rbRk.H.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert_dup(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_and_stack_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_dup_and_stack_rb(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_or_insert().
|
private |
Definition at line 118 of file tpl_rbRk.H.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_and_stack_rb(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_dup_and_stack_rb().
|
private |
Definition at line 117 of file tpl_rbRk.H.
|
private |
Definition at line 120 of file tpl_rbRk.H.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::find_succ_and_swap(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::fix_black_condition(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::fix_red_condition(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::remove(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_and_stack_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_dup_and_stack_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_or_insert(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::update_counters_after_deletion(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::update_counters_after_insertion().
|
private |
Definition at line 119 of file tpl_rbRk.H.
Referenced by Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::Gen_Rb_Tree_Rk(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::find_position(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::fix_black_condition(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::fix_red_condition(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::getRoot(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert_dup(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::is_empty(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_exclusive(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::operator=(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::position(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::remove(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_and_stack_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_dup_and_stack_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_or_insert(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::select(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::size(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_key(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_key_dup(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_pos(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::swap(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::verify().