|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Dynamic set backed by balanced binary search trees with automatic memory management. More...
#include <tpl_dynSetTree.H>
Classes | |
| struct | Has_Range_Methods |
| struct | Iterator |
| struct | Node_Op |
Public Types | |
| using | Node = typename Tree< Key, Compare >::Node |
| Type of binary node used by the binary search tree internal. | |
| using | Tree_Type = Tree< Key, Compare > |
| typedef DynSetTree | Set_Type |
| typedef Key | Item_Type |
| typedef Key | Key_Type |
Public Types inherited from StlAlephIterator< SetName > | |
| using | iterator = StlIterator< SetName > |
| using | const_iterator = StlConstIterator< SetName > |
Public Member Functions | |
| void | swap (DynSetTree &dset) noexcept(noexcept(tree.swap(dset.tree)) and noexcept(std::swap(num_nodes, dset.num_nodes)) and noexcept(std::swap(arena_allocator, dset.arena_allocator))) |
| Exchange all elements of this set with dset in constant time (and extremely fast). | |
| DynSetTree (const Compare &cmp=Compare()) | |
| Instantiate a dynamic set. | |
| DynSetTree (const char *base_addr, const size_t &sz, const Compare &cmp=Compare()) | |
| Instantiate a dynamic set using an arena allocator with external buffer. | |
| DynSetTree (const size_t &arena_sz, const Compare &cmp=Compare()) | |
| Instantiate a dynamic set using an arena allocator with dynamic buffer. | |
| DynSetTree (const DynSetTree &srcTree) | |
| instantiates a dynamic copy of srcTree | |
| template<template< typename > class List> | |
| DynSetTree (const List< Key > &l) | |
| template<class It > | |
| DynSetTree (It b, It e) | |
| DynSetTree (std::initializer_list< Key > l) | |
| DynSetTree (DynSetTree &&srcTree) noexcept | |
| void | empty () |
| remove all elements from the set | |
| DynSetTree & | operator= (const DynList< Key > &list) |
| DynSetTree & | operator= (const DynSetTree &srcTree) |
| assigns this to the dynamic array srctree | |
| DynSetTree & | operator= (DynSetTree &&srcTree) noexcept |
| Assigns the dynamic set srcTree to this. | |
| virtual | ~DynSetTree () |
| Destroyer; all elements are released. | |
| Key * | insert (const Key &key) |
| Inserts a key into the dynamic set. | |
| Key * | insert (Key &&key) |
| Key * | append (const Key &key) |
| Key * | append (Key &&key) |
| Key * | search_or_insert (const Key &key) |
| Look for the key in the binary search tree or inserts it if it is not found. | |
| Key * | search_or_insert (Key &&key) |
| std::pair< Key *, bool > | contains_or_insert (const Key &key) |
| std::pair< Key *, bool > | contains_or_insert (Key &&key) |
| Key * | insert_dup (const Key &key) |
| Key * | insert_dup (Key &&key) |
| Key * | put (const Key &key) |
| Key * | put (Key &&key) |
| size_t | remove (const Key &key) |
| Removes a key from the dynamic set. | |
| Key | del (const Key &key) |
Deletes key and returns a full copy of stored key. | |
| Key | remove_pos (const size_t i) |
| Removes a key from the dynamic set. | |
| bool | exist (const Key &key) const |
| Returns true if key belongs to the dynamic set. | |
| bool | has (const Key &key) const |
| bool | contains (const Key &key) const |
| Key & | find (const Key &key) const |
| Returns a modifiable reference to an element within the set. | |
| std::pair< long, Key * > | find_position (const Key &key) const |
| Returns the infix (ordinate) position of the key key or whatever It would be your position of belonging to the tree. | |
| Key * | search (const Key &key) const |
| Find an element in the set. | |
| const Key & | min () const |
| Returns the smallest key contained in the set according to the criterion comparison given. | |
| const Key & | get_first () const |
| const Key & | max () const |
| Returns the largest key contained in the set according to the criteria comparison given. | |
| const Key & | get_last () const |
| const Key & | get () const |
| Synonym of max. | |
| const size_t & | size () const |
| Returns the cardinality of the set. | |
| bool | is_empty () const |
| returns true if the set is empty | |
| bool | uses_arena () const noexcept |
| Returns true if the set is using an arena allocator. | |
| size_t | arena_allocated_size () const noexcept |
| Returns the allocated size from the arena (0 if not using arena) | |
| size_t | arena_available_size () const noexcept |
| Returns the available size in the arena (0 if not using arena) | |
| size_t | internal_path_length () const |
| Calculates and returns the length of the internal path of the tree search binary. | |
| Node * | get_root_node () const |
| const Key & | get_root () const |
| const Key & | get_item () const |
| Returns any element of the set. | |
| size_t | height () const |
| Calculates and returns the height of the binary search tree. | |
| template<class Op > | |
| void | for_each_in_preorder (void(*visitFct)(Node *, int, int)) |
Performs a prefix traversal over all nodes in the tree and invokes the visitFct operation on each visit. | |
| long | position (const Key &key) const |
| Returns the infix (ordered) position of the key. | |
| Key & | select (size_t i) |
| Returns the ith node in infix position. | |
| const Key & | select (size_t i) const |
| Key & | operator() (size_t i) |
| const Key & | operator[] (const Key &key) const |
| const Key & | operator[] (const Key &key) |
| Key & | access (size_t i) |
| bool | verify () const |
| template<class Key_Op > | |
| void | for_each_preorder (Key_Op &key_op) const |
| Performs a prefix traversal over all keys in the set and invokes operation Op. | |
| template<class Key_Op > | |
| void | for_each_preorder (Key_Op &&key_op=Key_Op()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Performs a preorder traversal over all keys using a temporary operation object. | |
| template<class Key_Op > | |
| void | for_each_inorder (Key_Op &key_op) const |
| Performs an infix traversal over all keys in the set and invokes operation Op. | |
| template<class Key_Op > | |
| void | for_each_inorder (Key_Op &&key_op=Key_Op()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Performs an infix traversal over all keys using a temporary operation object. | |
| template<class Key_Op > | |
| void | for_each_postorder (Key_Op &key_op) const |
| Performs a postfix traversal over all keys in the set and invokes operation Op. | |
| template<class Key_Op > | |
| void | for_each_postorder (Key_Op &&key_op=Key_Op()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Performs a postorder traversal over all keys using a temporary operation object. | |
| DynSetTree & | join (DynSetTree &t, DynSetTree &dup) |
| Union of two binary search trees. | |
| DynSetTree & | join (DynSetTree &t, DynSetTree &&dup=DynSetTree()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Union of two binary search trees using a move-constructed duplicate tree. | |
| DynSetTree & | join_dup (DynSetTree &t) |
| Union of two binary search trees. | |
| bool | split_key (const Key &key, DynSetTree &l, DynSetTree &r) |
| Partitions the binary search tree based on a key. | |
| void | split_pos (const size_t pos, DynSetTree &l, DynSetTree &r) |
| Partitions the binary search tree based on an infix position. | |
| void | split_key_dup (const Key &key, DynSetTree &l, DynSetTree &r) |
| Partitions the binary search tree based on a key that may be present in the tree. | |
| template<class Operation > | |
| bool | traverse (Operation &op) |
| Traverse all the set of pairs and for each key executes the operation op. | |
| template<class Operation > | |
| bool | traverse (Operation &&op=Operation()) |
| template<class Operation > | |
| bool | traverse (Operation &op) const |
| template<class Operation > | |
| bool | traverse (Operation &&op=Operation()) const |
Public Member Functions inherited from LocateFunctions< Container, Type > | |
| auto | get_it () const |
| Return a properly initialized iterator positioned at the first item on the container. | |
| auto | get_it (const size_t pos) const |
Return a properly initialized iterator positioned at the pos item on the container. | |
| auto | get_itor () const |
Alias of get_it(). | |
| Type & | nth_ne (const size_t n) noexcept |
| Return the n‑th element without bounds checking. | |
| const Type & | nth_ne (const size_t n) const noexcept |
Const overload of nth_ne(size_t). | |
| Type & | nth (const size_t n) |
| Return the n-th item of container. | |
| const Type & | nth (const size_t n) const |
Const overload of nth(size_t). | |
| template<class Operation > | |
| Type * | find_ptr (Operation &operation) noexcept(operation_is_noexcept< Operation >()) |
| Find a pointer to an item in the container according to a searching criteria. | |
| template<class Operation > | |
| const Type * | find_ptr (Operation &operation) const noexcept(operation_is_noexcept< Operation >()) |
Const overload of find_ptr(Operation&). | |
| template<class Operation > | |
| const Type * | find_ptr (Operation &&operation) const noexcept(operation_is_noexcept< Operation >()) |
Overload of find_ptr(Operation&) const that accepts rvalues. | |
| template<class Operation > | |
| Type * | find_ptr (Operation &&operation) noexcept(operation_is_noexcept< Operation >()) |
Overload of find_ptr(Operation&) that accepts rvalues. | |
| template<class Operation > | |
| size_t | find_index (Operation &operation) const noexcept(operation_is_noexcept< Operation >()) |
| Find the position of an item in the container according to a searching criteria. | |
| template<class Operation > | |
| size_t | find_index (Operation &&operation) const noexcept(operation_is_noexcept< Operation >()) |
Overload of find_index(Operation&) that accepts rvalues. | |
| template<class Operation > | |
| std::tuple< bool, Type > | find_item (Operation &operation) noexcept(operation_is_noexcept< Operation >()) |
| Safe sequential searching of an item matching a criteria. | |
| template<class Operation > | |
| std::tuple< bool, Type > | find_item (Operation &operation) const noexcept(operation_is_noexcept< Operation >()) |
| template<class Operation > | |
| std::tuple< bool, Type > | find_item (Operation &&operation) noexcept(operation_is_noexcept< Operation >()) |
| template<class Operation > | |
| std::tuple< bool, Type > | find_item (Operation &&operation) const noexcept(operation_is_noexcept< Operation >()) |
Public Member Functions inherited from FunctionalMethods< Container, T > | |
| template<typename ... Args> | |
| void | emplace (Args &&... args) |
| Appends a new element into the container by constructing it in-place with the given args. | |
| template<typename ... Args> | |
| void | emplace_end (Args &&... args) |
| template<typename ... Args> | |
| void | emplace_ins (Args &&... args) |
| Insert a new element into the container by constructing it in-place with the given args. | |
| template<typename ... Args> | |
| size_t | ninsert (Args ... args) |
| Insert n variadic items. | |
| template<typename ... Args> | |
| size_t | nappend (Args ... args) |
| Append n variadic items. | |
| template<class Operation > | |
| void | for_each (Operation &operation) |
| Traverse all the container and performs an operation on each element. | |
| template<class Operation > | |
| void | for_each (Operation &operation) const |
Const overload of for_each(Operation&). | |
| template<class Operation > | |
| void | for_each (Operation &&operation) const |
Overload of for_each(Operation&) const that accepts rvalues. | |
| template<class Operation > | |
| void | for_each (Operation &&operation) |
Overload of for_each(Operation&) that accepts rvalues. | |
| template<class Operation > | |
| void | each (Operation &operation) |
Alias of for_each(Operation&). | |
| template<class Operation > | |
| void | each (Operation &operation) const |
Const alias of for_each(Operation&). | |
| template<class Operation > | |
| void | each (Operation &&operation) const |
Const alias of for_each(Operation&) that accepts rvalues. | |
| template<class Operation > | |
| void | each (Operation &&operation) |
Alias of for_each(Operation&) that accepts rvalues. | |
| template<class Operation > | |
| void | each (size_t pos, const size_t slice, Operation &operation) const |
Traverse the container starting at pos taking one item every slice, performing a mutable operation on each visited element. | |
| template<class Operation > | |
| void | each (const size_t pos, const size_t slice, Operation &&operation) const |
| template<class Operation > | |
| void | mutable_for_each (Operation &operation) |
| template<class Operation > | |
| void | mutable_for_each (Operation &&operation) |
| template<class Operation > | |
| bool | all (Operation &operation) const |
| Check if all the elements of container satisfy a condition. | |
| template<class Operation > | |
| bool | all (Operation &&operation) const |
Overload of all(Operation&) that accepts rvalues. | |
| template<class Operation > | |
| bool | exists (Operation &op) const |
| Test for existence in the container of an element satisfying a criteria. | |
| template<class Operation > | |
| bool | exists (Operation &&op) const |
Overload of exists(Operation&) that accepts rvalues. | |
| template<typename __T = T, class Operation = Aleph::Dft_Map_Op<T, __T>> | |
| Aleph::DynList< __T > | maps (Operation &op) const |
| Map the elements of the container. | |
| template<typename __T = T, class Operation = Aleph::Dft_Map_Op<__T, __T>> | |
| Aleph::DynList< __T > | maps (Operation &&op) const |
Overload of maps(Operation&) that accepts rvalues. | |
| template<typename __T = T, class Prop , class Operation > | |
| Aleph::DynList< __T > | maps_if (Prop prop, Operation &op) const |
| Conditional mapping of the elements of the container. | |
| template<typename __T = T, class Prop , class Operation > | |
| Aleph::DynList< __T > | maps_if (Prop prop, Operation &&op) const |
Overload of maps_if(Prop, Operation&) that accepts rvalues. | |
| Aleph::DynList< T > | to_dynlist () const |
| Convert container to DynList. | |
| std::vector< T > | to_vector () const |
| Convert container to std::vector. | |
| template<typename __T = T, class Op = Aleph::Dft_Fold_Op<__T, T>> | |
| __T | foldl (const __T &init, Op &op) const |
| Fold the elements of the container to a specific result. | |
| template<typename __T = T, class Op = Aleph::Dft_Fold_Op<__T, T>> | |
| __T | foldl (const __T &init, Op &&op=Op()) const |
Overload of foldl(const __T&, Op&) that accepts rvalues. | |
| template<typename __T = T, class Op = Aleph::Dft_Fold_Op<__T, T>> | |
| __T | fold_left (const __T &init, Op &op) const |
| Alias for foldl with the same accumulator type. | |
| template<typename __T = T, class Op = Aleph::Dft_Fold_Op<__T, T>> | |
| __T | fold_left (const __T &init, Op &&op=Op()) const |
Overload of fold_left(const __T&, Op&) that accepts rvalues. | |
| template<class Operation > | |
| T | fold (const T &init, Operation &operation) const |
| Simplified version of foldl() where the folded type is the same type of elements stored in the container. | |
| template<class Operation > | |
| T | fold (const T &init, Operation &&operation) const |
Overload of fold(const T&, Operation&) that accepts rvalues. | |
| template<class Operation > | |
| Aleph::DynList< T > | filter (Operation &operation) const |
| Filter the elements of a container according to a matching criteria. | |
| template<class Operation > | |
| Aleph::DynList< T > | filter (Operation &&operation) const |
Overload of filter(Operation&) that accepts rvalues. | |
| template<class Operation > | |
| Aleph::DynList< const T * > | ptr_filter (Operation &operation) const |
| Filter the elements of a container according to a matching criteria and return a pointer to the matched items in the container. | |
| template<class Operation > | |
| Aleph::DynList< const T * > | ptr_filter (Operation &&operation) const |
Overload of ptr_filter(Operation&) that accepts rvalues. | |
| template<class Operation > | |
| Aleph::DynList< std::tuple< T, size_t > > | pfilter (Operation &operation) const |
| Filter the elements of a container according to a matching criteria and determine its positions respect to the traversal of container. | |
| template<class Operation > | |
| Aleph::DynList< std::tuple< T, size_t > > | pfilter (Operation &&operation) const |
Overload of pfilter(Operation&) that accepts rvalues. | |
| template<class Operation > | |
| std::pair< Aleph::DynList< T >, Aleph::DynList< T > > | partition (Operation &op) const |
| Exclusive partition of container according to a filter criteria. | |
| template<class Operation > | |
| std::pair< Aleph::DynList< T >, Aleph::DynList< T > > | partition (Operation &&op) const |
Overload of partition(Operation&) that accepts rvalues. | |
| template<class Operation > | |
| std::pair< Aleph::DynList< T >, Aleph::DynList< T > > | partition (size_t n) const |
| Exclusive partition of container in the nth item. | |
| std::pair< Aleph::DynList< T >, Aleph::DynList< T > > | split_half () const |
| Split the container into two halves by alternating elements. | |
| template<class Operation > | |
| std::tuple< Aleph::DynList< T >, Aleph::DynList< T > > | tpartition (Operation &op) const |
| Exclusive partition of container according to a filter criteria. | |
| template<class Operation > | |
| std::tuple< Aleph::DynList< T >, Aleph::DynList< T > > | tpartition (Operation &&op) const |
Overload of tpartition(Operation&) that accepts rvalues. | |
| size_t | length () const noexcept |
| Count the number of elements of a container. | |
| Aleph::DynList< T > | rev () const |
| Return a list with the elements of container in reverse order respect to its traversal order. | |
| Aleph::DynList< T > | take (const size_t n) const |
| Return a list with the first n elements seen in the container during its traversal. | |
| Aleph::DynList< T > | take (size_t i, const size_t j, const size_t step=1) const |
| Return a list with elements seen in the container between i and j position respect to its traversal. | |
| Aleph::DynList< T > | drop (const size_t n) const |
| Drop the first n elements seen in the container during its traversal. | |
| void | mutable_drop (const size_t n) |
| Drop the first n elements seen from container. | |
Public Member Functions inherited from GenericItems< Container, T > | |
| Aleph::DynList< T > | items () const |
| Return a list of all the elements of a container sorted by traversal order. | |
| Aleph::DynList< T > | keys () const |
Public Member Functions inherited from EqualToMethod< Container > | |
| bool | equal_to (const Container &r) const noexcept |
Test if elements of this are exactly contained in another container. | |
| bool | operator== (const Container &r) const noexcept |
| bool | operator!= (const Container &r) const noexcept |
| Negation of equal_to() | |
Public Member Functions inherited from StlAlephIterator< SetName > | |
| iterator | begin () noexcept |
| Return an STL-compatible iterator to the first element. | |
| iterator | end () noexcept |
| Return an STL-compatible end iterator. | |
| const_iterator | begin () const noexcept |
| Return a const iterator to the first element. | |
| const_iterator | end () const noexcept |
| Return a const end iterator. | |
| const_iterator | cbegin () const noexcept |
| Return a const iterator to the first element. | |
| const_iterator | cend () const noexcept |
| Return a const end iterator. | |
Private Member Functions | |
| Node * | alloc_node (const Key &key) |
| Node * | alloc_node (Key &&key) |
| void | free_node (Node *p) |
| Key * | __insert (Node *p) |
| Key * | __search_or_insert (Node *p) |
| std::pair< Node *, bool > | __contains_or_insert (Node *p) |
| Key * | __insert_dup (Node *q) |
Private Attributes | |
| Tree< Key, Compare > | tree |
| size_t | num_nodes |
| std::unique_ptr< ArenaTreeAllocator< Node > > | arena_allocator |
Static Private Attributes | |
| static constexpr size_t | dim = 13 |
Additional Inherited Members | |
Related Symbols inherited from FunctionalMethods< Container, T > | |
| each | |
| each | |
| each | |
Dynamic set backed by balanced binary search trees with automatic memory management.
DynSetTree<Key, Tree, Compare> is a high-level dynamic set container that uses any of several balanced BST implementations (AVL, Red-Black, Treap, Splay, etc.) to maintain a sorted collection of unique keys.
Unlike the low-level tree classes (e.g., Avl_Tree, Rb_Tree), DynSetTree automatically manages node memory, provides rich functional operations (map, filter, fold), and offers an STL-compatible interface.
| Key | The type of keys stored in the set. |
| Tree | The underlying tree implementation template (default: Avl_Tree). Can be Avl_Tree, Rb_Tree, Treap, TreapRk, Splay_Tree, Rand_Tree. |
| Compare | Comparison functor for ordering keys (default: Aleph::less<Key>). |
Definition at line 267 of file tpl_dynSetTree.H.
| typedef Key Aleph::DynSetTree< Key, Tree, Compare >::Item_Type |
Definition at line 488 of file tpl_dynSetTree.H.
| typedef Key Aleph::DynSetTree< Key, Tree, Compare >::Key_Type |
Definition at line 490 of file tpl_dynSetTree.H.
| using Aleph::DynSetTree< Key, Tree, Compare >::Node = typename Tree<Key, Compare>::Node |
Type of binary node used by the binary search tree internal.
Definition at line 277 of file tpl_dynSetTree.H.
| typedef DynSetTree Aleph::DynSetTree< Key, Tree, Compare >::Set_Type |
Definition at line 486 of file tpl_dynSetTree.H.
| using Aleph::DynSetTree< Key, Tree, Compare >::Tree_Type = Tree<Key, Compare> |
Definition at line 279 of file tpl_dynSetTree.H.
|
inline |
Instantiate a dynamic set.
Definition at line 508 of file tpl_dynSetTree.H.
|
inline |
Instantiate a dynamic set using an arena allocator with external buffer.
Definition at line 515 of file tpl_dynSetTree.H.
|
inlineexplicit |
Instantiate a dynamic set using an arena allocator with dynamic buffer.
Definition at line 524 of file tpl_dynSetTree.H.
|
inline |
instantiates a dynamic copy of srcTree
Definition at line 533 of file tpl_dynSetTree.H.
References Aleph::copyRec(), FunctionalMethods< Container, T >::maps(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
|
inline |
Definition at line 548 of file tpl_dynSetTree.H.
|
inline |
Definition at line 548 of file tpl_dynSetTree.H.
|
inline |
Definition at line 548 of file tpl_dynSetTree.H.
|
inlinenoexcept |
Definition at line 550 of file tpl_dynSetTree.H.
References FunctionalMethods< Container, T >::maps(), and Aleph::DynSetTree< Key, Tree, Compare >::swap().
|
inlinevirtual |
Destroyer; all elements are released.
Definition at line 610 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::empty().
|
inlineprivate |
Definition at line 704 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::free_node(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::contains_or_insert(), and Aleph::DynSetTree< Key, Tree, Compare >::contains_or_insert().
|
inlineprivate |
Definition at line 616 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::free_node(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::insert(), and Aleph::DynSetTree< Key, Tree, Compare >::insert().
|
inlineprivate |
Definition at line 775 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::free_node(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::insert_dup(), and Aleph::DynSetTree< Key, Tree, Compare >::insert_dup().
|
inlineprivate |
Definition at line 683 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::free_node(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::search_or_insert(), and Aleph::DynSetTree< Key, Tree, Compare >::search_or_insert().
|
inline |
Definition at line 1133 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::select().
Referenced by TEST().
|
inlineprivate |
Definition at line 463 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::arena_allocator.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::contains_or_insert(), Aleph::DynSetTree< Key, Tree, Compare >::contains_or_insert(), Aleph::DynSetTree< Key, Tree, Compare >::insert(), Aleph::DynSetTree< Key, Tree, Compare >::insert(), Aleph::DynSetTree< Key, Tree, Compare >::insert_dup(), Aleph::DynSetTree< Key, Tree, Compare >::insert_dup(), Aleph::DynSetTree< Key, Tree, Compare >::search_or_insert(), and Aleph::DynSetTree< Key, Tree, Compare >::search_or_insert().
|
inlineprivate |
Definition at line 470 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::arena_allocator.
|
inline |
Definition at line 672 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::insert().
Referenced by Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::insert_arc(), Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::insert_node(), Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::sort_arcs(), TYPED_TEST(), and TYPED_TEST().
|
inline |
Definition at line 677 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::insert().
|
inlinenoexcept |
Returns the allocated size from the arena (0 if not using arena)
Definition at line 1016 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::arena_allocator.
Referenced by TEST().
|
inlinenoexcept |
Returns the available size in the arena (0 if not using arena)
Definition at line 1024 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::arena_allocator.
Referenced by TEST().
|
inlinestaticprivate |
Definition at line 451 of file tpl_dynSetTree.H.
References ah_domain_error.
|
inlinestaticprivate |
Definition at line 444 of file tpl_dynSetTree.H.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::find_position().
|
inlinestaticprivate |
Definition at line 437 of file tpl_dynSetTree.H.
References ah_domain_error.
|
inlinestaticprivate |
Definition at line 430 of file tpl_dynSetTree.H.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::position().
|
inlinestaticprivate |
Definition at line 410 of file tpl_dynSetTree.H.
References ah_domain_error.
|
inlinestaticprivate |
Definition at line 403 of file tpl_dynSetTree.H.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::remove_pos().
|
inlinestaticprivate |
Definition at line 389 of file tpl_dynSetTree.H.
References ah_domain_error.
|
inlinestaticprivate |
Definition at line 374 of file tpl_dynSetTree.H.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::select().
|
inlinestaticprivate |
Definition at line 396 of file tpl_dynSetTree.H.
References ah_domain_error.
|
inlinestaticprivate |
Definition at line 382 of file tpl_dynSetTree.H.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::select().
|
inlinestaticprivate |
Definition at line 424 of file tpl_dynSetTree.H.
References ah_domain_error.
|
inlinestaticprivate |
Definition at line 417 of file tpl_dynSetTree.H.
References l.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::split_pos().
|
inline |
Definition at line 891 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::exist().
Referenced by Aleph::Net_Graph< NodeT, ArcT >::is_sink(), Aleph::Net_Graph< NodeT, ArcT >::is_source(), Aleph::min_cut(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TYPED_TEST(), and TYPED_TEST().
|
inline |
Definition at line 762 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::__contains_or_insert(), and Aleph::DynSetTree< Key, Tree, Compare >::alloc_node().
Referenced by TYPED_TEST().
|
inline |
Definition at line 768 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::__contains_or_insert(), and Aleph::DynSetTree< Key, Tree, Compare >::alloc_node().
|
inline |
Deletes key and returns a full copy of stored key.
This method is intended to be used with compound keys, by example pairs, whose searching is done by a particular member of compound data.
| [in] | key | key to be removed |
| domain_error | if the key is not found in the set |
Definition at line 840 of file tpl_dynSetTree.H.
References ah_domain_error_if, Aleph::DynSetTree< Key, Tree, Compare >::free_node(), FunctionalMethods< Container, T >::maps(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by Aleph::DynMapTree< Key, Data, Tree, Compare >::remove(), Aleph::DynMapTree< Key, Data, Tree, Compare >::remove(), and Aleph::DynMapTree< Key, Data, Tree, Compare >::remove_key().
|
inline |
remove all elements from the set
Definition at line 557 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::arena_allocator, Aleph::callKeyDestructorsRec(), Aleph::destroyRec(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::~DynSetTree(), Aleph::Huffman_Encoder_Engine::build_encoding_map(), Aleph::MCF_Graph< NodeT, ArcT >::build_node_index(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::build_reverse_mappings(), Aleph::AHMapping< Key, ValueType >::clear(), Aleph::Huffman_Encoder_Engine::clear_build_state(), Aleph::compute_min_cut(), Aleph::Network_Simplex< Net >::init_structures(), Aleph::DynSetTree< Key, Tree, Compare >::operator=(), Aleph::DynSetTree< Key, Tree, Compare >::operator=(), reset_huffman_btreepic_state(), and Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::sort_arcs().
|
inline |
Returns true if key belongs to the dynamic set.
Definition at line 881 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::search().
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::contains(), Aleph::DynSetTree< Key, Tree, Compare >::has(), and TYPED_TEST().
|
inline |
Returns a modifiable reference to an element within the set.
find(key) looks for the key key in the set and returns a modifiable reference to the value contained in the set.
| [in] | key | key to search for. |
| domain_error | if key is not within the set. |
Definition at line 910 of file tpl_dynSetTree.H.
References ah_domain_error_if, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by Aleph::DynMapTree< Key, Data, Tree, Compare >::find(), Aleph::DynMapTree< Key, Data, Tree, Compare >::find(), Aleph::DynSetTree< Key, Tree, Compare >::operator[](), Aleph::Arcs_Index< GT, Compare, Tree, SA >::remove_from_graph(), and Aleph::Nodes_Index< GT, Compare, Tree, SN >::remove_from_graph().
|
inline |
Returns the infix (ordinate) position of the key key or whatever It would be your position of belonging to the tree.
find_position(key) searches the extended tree for the key key (which takes time \(O(\lg n)\)) and returns the position infix of the node containing the key.
| [in] | key | key to search for and determine infix position. |
Definition at line 934 of file tpl_dynSetTree.H.
References ah_domain_error_if_constexpr, Aleph::DynSetTree< Key, Tree, Compare >::call_find_position(), FunctionalMethods< Container, T >::maps(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
|
inline |
Performs a prefix traversal over all nodes in the tree and invokes the visitFct operation on each visit.
Definition at line 1056 of file tpl_dynSetTree.H.
References FunctionalMethods< Container, T >::maps(), Aleph::preOrderRec(), root(), and Aleph::DynSetTree< Key, Tree, Compare >::tree.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Performs an infix traversal over all keys using a temporary operation object.
| Key_Op | Operation type (default-constructible). |
| [in] | key_op | Operation to execute on each key (default-constructed if not provided). |
Definition at line 1255 of file tpl_dynSetTree.H.
References FunctionalMethods< Container, T >::maps().
|
inline |
Performs an infix traversal over all keys in the set and invokes operation Op.
Op(p) has the following structure:
| [in] | key_op | operation to execute on each key |
Definition at line 1238 of file tpl_dynSetTree.H.
References FunctionalMethods< Container, T >::maps(), root(), and Aleph::DynSetTree< Key, Tree, Compare >::tree.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Performs a postorder traversal over all keys using a temporary operation object.
| Key_Op | Operation type (default-constructible). |
| [in] | key_op | Operation to execute on each key (default-constructed if not provided). |
Definition at line 1302 of file tpl_dynSetTree.H.
References FunctionalMethods< Container, T >::maps().
|
inline |
Performs a postfix traversal over all keys in the set and invokes operation Op.
Op(p) has the following structure:
| [in] | key_op | operation to execute on each key |
Definition at line 1285 of file tpl_dynSetTree.H.
References FunctionalMethods< Container, T >::maps(), root(), and Aleph::DynSetTree< Key, Tree, Compare >::tree.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Performs a preorder traversal over all keys using a temporary operation object.
| Key_Op | Operation type (default-constructible). |
| [in] | key_op | Operation to execute on each key (default-constructed if not provided). |
Definition at line 1208 of file tpl_dynSetTree.H.
References FunctionalMethods< Container, T >::maps().
|
inline |
Performs a prefix traversal over all keys in the set and invokes operation Op.
Op(p) has the following structure:
| [in] | key_op | operation to execute on each key |
Definition at line 1191 of file tpl_dynSetTree.H.
References FunctionalMethods< Container, T >::maps(), root(), and Aleph::DynSetTree< Key, Tree, Compare >::tree.
|
inlineprivate |
Definition at line 477 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::arena_allocator.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::__contains_or_insert(), Aleph::DynSetTree< Key, Tree, Compare >::__insert(), Aleph::DynSetTree< Key, Tree, Compare >::__insert_dup(), Aleph::DynSetTree< Key, Tree, Compare >::__search_or_insert(), Aleph::DynSetTree< Key, Tree, Compare >::del(), Aleph::DynSetTree< Key, Tree, Compare >::insert(), Aleph::DynSetTree< Key, Tree, Compare >::insert(), Aleph::DynSetTree< Key, Tree, Compare >::remove(), and Aleph::DynSetTree< Key, Tree, Compare >::remove_pos().
|
inline |
Synonym of max.
Definition at line 1001 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::max().
Referenced by TEST(), and TYPED_TEST().
|
inline |
Definition at line 985 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::min().
Referenced by Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::get_first_arc(), Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::get_first_node(), TEST(), and TYPED_TEST().
|
inline |
Returns any element of the set.
Definition at line 1048 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::get_root().
Referenced by Aleph::Net_Graph< NodeT, ArcT >::get_sink(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), TEST(), TYPED_TEST(), Aleph::Net_Graph< NodeT, ArcT >::unmake_super_sink(), and Aleph::Net_Graph< NodeT, ArcT >::unmake_super_source().
|
inline |
Definition at line 998 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::max().
Referenced by TEST(), and TYPED_TEST().
|
inline |
Definition at line 1040 of file tpl_dynSetTree.H.
References ah_domain_error_if, KEY, Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::get_item(), and TEST().
|
inline |
Definition at line 1038 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by demonstrate_tree_types(), and TYPED_TEST().
|
inline |
Definition at line 886 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::exist().
Referenced by TEST(), TEST(), TEST(), and TYPED_TEST().
|
inline |
Calculates and returns the height of the binary search tree.
Definition at line 1051 of file tpl_dynSetTree.H.
References Aleph::computeHeightRec(), and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by TYPED_TEST().
|
inline |
Inserts a key into the dynamic set.
Inserts the key into the dynamic set.
| [in] | key | key to insert. |
Definition at line 646 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::__insert(), Aleph::DynSetTree< Key, Tree, Compare >::alloc_node(), Aleph::DynSetTree< Key, Tree, Compare >::free_node(), and FunctionalMethods< Container, T >::maps().
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::append(), Aleph::DynMapTree< Key, Data, Tree, Compare >::append(), Aleph::DynMapTree< Key, Data, Tree, Compare >::append(), Aleph::DynSetTree< Key, Tree, Compare >::append(), Aleph::DynMapTree< Key, Data, Tree, Compare >::append(), Aleph::DynMapTree< Key, Data, Tree, Compare >::append(), Aleph::compute_min_cut(), Aleph::Random_Graph< GT, Init_Node, Init_Arc >::create_nodes_and_initialize_arc_index(), Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::create_nodes_and_initialize_arc_index(), demonstrate_functional_features(), demonstrate_tree_types(), Aleph::Net_Graph< NodeT, ArcT >::disconnect_arc(), Aleph::Nodes_Index< GT, Compare, Tree, SN >::init(), Aleph::Arcs_Index< GT, Compare, Tree, SA >::init(), Aleph::DynMapTree< Key, Data, Tree, Compare >::insert(), Aleph::DynMapTree< Key, Data, Tree, Compare >::insert(), Aleph::DynMapTree< Key, Data, Tree, Compare >::insert(), Aleph::DynMapTree< Key, Data, Tree, Compare >::insert(), Aleph::Nodes_Index< GT, Compare, Tree, SN >::insert_in_graph(), Aleph::Nodes_Index< GT, Compare, Tree, SN >::insert_in_graph(), Aleph::Arcs_Index< GT, Compare, Tree, SA >::insert_in_graph(), Aleph::min_cut(), Aleph::Init_P< GT >::operator()(), Aleph::DynSetTree< Key, Tree, Compare >::put(), Aleph::DynSetTree< Key, Tree, Compare >::put(), Aleph::Net_Graph< NodeT, ArcT >::register_node(), Aleph::Net_Graph< NodeT, ArcT >::remove_arc(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), Aleph::Random_Graph< GT, Init_Node, Init_Arc >::update_parity_after_arc_insertion(), and Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::update_parity_after_arc_insertion().
|
inline |
Definition at line 791 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::__insert_dup(), and Aleph::DynSetTree< Key, Tree, Compare >::alloc_node().
Referenced by insert_dup_traversal_test(), and TYPED_TEST().
|
inline |
Definition at line 796 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::__insert_dup(), and Aleph::DynSetTree< Key, Tree, Compare >::alloc_node().
|
inline |
Calculates and returns the length of the internal path of the tree search binary.
Definition at line 1033 of file tpl_dynSetTree.H.
References Aleph::internal_path_length(), and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by TYPED_TEST().
|
inline |
returns true if the set is empty
Definition at line 1007 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::num_nodes.
Referenced by Aleph::Net_Graph< NodeT, ArcT >::check_network(), Aleph::Net_Graph< NodeT, ArcT >::flow_value(), AHDispatcher< Key, Operation >::is_empty(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TYPED_TEST(), and TYPED_TEST().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Union of two binary search trees using a move-constructed duplicate tree.
| [in] | t | Binary search tree to join with this. |
| [in] | dup | Binary search tree with duplicate keys (move-constructed, default empty). |
Definition at line 1338 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::join().
|
inline |
Returns the largest key contained in the set according to the criteria comparison given.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 989 of file tpl_dynSetTree.H.
References ah_domain_error_if, Aleph::find_max(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::get(), Aleph::DynSetTree< Key, Tree, Compare >::get_last(), TEST(), TEST(), TEST(), TEST(), and TYPED_TEST().
|
inline |
Returns the smallest key contained in the set according to the criterion comparison given.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 976 of file tpl_dynSetTree.H.
References ah_domain_error_if, Aleph::find_min(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::get_first(), TEST(), TEST(), TEST(), TEST(), and TYPED_TEST().
|
inline |
Definition at line 1118 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::select().
|
inline |
Definition at line 576 of file tpl_dynSetTree.H.
|
inline |
assigns this to the dynamic array srctree
Definition at line 582 of file tpl_dynSetTree.H.
References Aleph::copyRec(), Aleph::DynSetTree< Key, Tree, Compare >::empty(), FunctionalMethods< Container, T >::maps(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
|
inlinenoexcept |
Assigns the dynamic set srcTree to this.
Definition at line 598 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::empty(), FunctionalMethods< Container, T >::maps(), and Aleph::DynSetTree< Key, Tree, Compare >::swap().
|
inline |
Definition at line 1128 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::search_or_insert().
|
inline |
Definition at line 1123 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::find().
|
inline |
Returns the infix (ordered) position of the key.
position(key) searches the tree for the key (which takes time \(O(\lg n)\)) and returns the infix position of the node containing the key.
| [in] | key | key to search for and determine infix position. |
Definition at line 1074 of file tpl_dynSetTree.H.
References ah_domain_error_if_constexpr, Aleph::DynSetTree< Key, Tree, Compare >::call_position(), FunctionalMethods< Container, T >::maps(), and Aleph::DynSetTree< Key, Tree, Compare >::tree.
|
inline |
Definition at line 801 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::insert().
Referenced by TYPED_TEST(), and TYPED_TEST().
|
inline |
Definition at line 806 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::insert().
|
inline |
Removes a key from the dynamic set.
remove(key) finds the key in the set and removes it.
| [in] | key | key to delete |
Definition at line 818 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::free_node(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by Aleph::Net_Graph< NodeT, ArcT >::connect_arc(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Graph< NodeT, ArcT >::register_node(), Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::remove_arc(), Aleph::Arcs_Index< GT, Compare, Tree, SA >::remove_from_graph(), Aleph::Nodes_Index< GT, Compare, Tree, SN >::remove_from_graph(), Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::remove_node(), Aleph::Net_Graph< NodeT, ArcT >::remove_node(), TEST(), TEST(), TEST(), TEST(), TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), Aleph::Random_Graph< GT, Init_Node, Init_Arc >::update_parity_after_arc_insertion(), and Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::update_parity_after_arc_insertion().
|
inline |
Removes a key from the dynamic set.
Definition at line 860 of file tpl_dynSetTree.H.
References ah_domain_error_if_constexpr, ah_logic_error_if, ah_out_of_range_error_if, Aleph::DynSetTree< Key, Tree, Compare >::call_remove_pos(), Aleph::DynSetTree< Key, Tree, Compare >::free_node(), KEY, FunctionalMethods< Container, T >::maps(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
|
inline |
Find an element in the set.
search(key) searches for the key key in the set. If he element is found in the set, then a pointer to the value contained in the set; otherwise nullptr is returned.
| [in] | key | key to search for. |
Definition at line 964 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by demonstrate_tree_types(), Aleph::DynSetTree< Key, Tree, Compare >::exist(), Aleph::Init_P< GT >::operator()(), Aleph::DynMapTree< Key, Data, Tree, Compare >::search(), Aleph::Nodes_Index< GT, Compare, Tree, SN >::search(), Aleph::Arcs_Index< GT, Compare, Tree, SA >::search(), Aleph::DynMapTree< Key, Data, Tree, Compare >::search(), Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::update_parity_after_arc_insertion(), and Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::verify_tables().
|
inline |
Look for the key in the binary search tree or inserts it if it is not found.
search_or_insert(key) searches the binary tree for a node whose key is KEY(p). If the key is finds, then a pointer to it is returned; of what Otherwise key is inserted into the binary tree of search this.
| [in] | key | the key to search or insert. |
Definition at line 738 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::__search_or_insert(), and Aleph::DynSetTree< Key, Tree, Compare >::alloc_node().
Referenced by Aleph::DynMapTree< Key, Data, Tree, Compare >::operator[](), Aleph::DynSetTree< Key, Tree, Compare >::operator[](), Aleph::DynMapTree< Key, Data, Tree, Compare >::operator[](), Aleph::Nodes_Index< GT, Compare, Tree, SN >::search_or_insert_in_graph(), Aleph::Nodes_Index< GT, Compare, Tree, SN >::search_or_insert_in_graph(), TEST(), and TYPED_TEST().
|
inline |
Definition at line 743 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::__search_or_insert(), and Aleph::DynSetTree< Key, Tree, Compare >::alloc_node().
|
inline |
Returns the ith node in infix position.
| [in] | i | desired position |
Definition at line 1088 of file tpl_dynSetTree.H.
References ah_domain_error_if_constexpr, ah_logic_error_if, ah_out_of_range_error_if, Aleph::DynSetTree< Key, Tree, Compare >::call_select_nc(), FunctionalMethods< Container, T >::maps(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::access(), Aleph::Random_Graph< GT, Init_Node, Init_Arc >::make_eulerian(), Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::make_eulerian(), Aleph::DynSetTree< Key, Tree, Compare >::operator()(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Definition at line 1103 of file tpl_dynSetTree.H.
References ah_domain_error_if_constexpr, ah_logic_error_if, ah_out_of_range_error_if, Aleph::DynSetTree< Key, Tree, Compare >::call_select(), FunctionalMethods< Container, T >::maps(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
|
inline |
Returns the cardinality of the set.
Definition at line 1004 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::num_nodes.
Referenced by adjust_nodes(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::build_reverse_mappings(), Aleph::Net_Graph< NodeT, ArcT >::is_single_sink(), Aleph::Net_Graph< NodeT, ArcT >::is_single_source(), Aleph::Random_Graph< GT, Init_Node, Init_Arc >::make_eulerian(), Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::make_eulerian(), Aleph::Net_Graph< NodeT, ArcT >::make_super_sink(), Aleph::Net_Graph< NodeT, ArcT >::make_super_source(), Aleph::maptree_to_Array(), Aleph::min_cut(), Aleph::settree_to_Array(), Aleph::settree_to_vector(), AHDispatcher< Key, Operation >::size(), Aleph::AHMapping< Key, ValueType >::size(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), Aleph::Net_Graph< NodeT, ArcT >::unmake_super_sink(), Aleph::Net_Graph< NodeT, ArcT >::unmake_super_source(), and Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::verify_tables().
|
inline |
Partitions the binary search tree based on a key.
split_key(key,l,r) partitions, according to the key key, the binary search tree this in two trees l and r. After the operation the tree this becomes empty, l contains all keys less than key and r the major ones.
| [in] | key | partition key. |
| [out] | l | tree with keys less than key. |
| [out] | r | tree with keys greater than key. |
Definition at line 1379 of file tpl_dynSetTree.H.
References Aleph::compute_cardinality_rec(), l, FunctionalMethods< Container, T >::maps(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
|
inline |
Partitions the binary search tree based on a key that may be present in the tree.
split_key_dup(key,l,r) partitions, according to key, the binary search tree this into two trees l and r. After the operation, tree this becomes empty, l contains all keys less than key and r contains keys greater than or equal to key.
| [in] | key | partition key. |
| [out] | l | tree with keys less than key. |
| [out] | r | tree with keys greater than or equal to key. |
Definition at line 1433 of file tpl_dynSetTree.H.
References Aleph::compute_cardinality_rec(), l, Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
|
inline |
Partitions the binary search tree based on an infix position.
split_pos(pos,l,r) partitions the binary search tree this into two trees l and r. After the operation, tree this becomes empty, l contains the first pos+1 keys and r the remaining ones.
| [in] | pos | partition position |
| [out] | l | tree with keys in interval [0,pos] |
| [out] | r | tree with keys in interval (pos,N), where N is the number of keys |
Definition at line 1404 of file tpl_dynSetTree.H.
References ah_domain_error_if_constexpr, ah_out_of_range_error_if, Aleph::DynSetTree< Key, Tree, Compare >::call_split_pos(), Aleph::compute_cardinality_rec(), l, FunctionalMethods< Container, T >::maps(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
|
inlinenoexcept |
Exchange all elements of this set with dset in constant time (and extremely fast).
| [in] | dset | the set to exchange with this |
Definition at line 497 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::arena_allocator, FunctionalMethods< Container, T >::maps(), Aleph::DynSetTree< Key, Tree, Compare >::num_nodes, and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::DynSetTree(), Aleph::DynSetTree< Key, Tree, Compare >::operator=(), Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::swap(), and Aleph::Net_Graph< NodeT, ArcT >::swap().
|
inline |
Definition at line 1491 of file tpl_dynSetTree.H.
References FunctionalMethods< Container, T >::maps().
|
inline |
Definition at line 1506 of file tpl_dynSetTree.H.
References FunctionalMethods< Container, T >::maps().
|
inline |
Traverse all the set of pairs and for each key executes the operation op.
Operation must have the signature
If
returns false then the traversal is aborted; otherwise the routine advance and so on
| [in] | op | operation to execute for each key |
Definition at line 1482 of file tpl_dynSetTree.H.
References Aleph::traverse(), and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by TYPED_TEST().
|
inline |
Definition at line 1497 of file tpl_dynSetTree.H.
References Aleph::traverse(), and Aleph::DynSetTree< Key, Tree, Compare >::tree.
|
inlinenoexcept |
Returns true if the set is using an arena allocator.
Definition at line 1010 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::arena_allocator.
|
inline |
Definition at line 1138 of file tpl_dynSetTree.H.
References Aleph::check_bst(), FunctionalMethods< Container, T >::maps(), and Aleph::DynSetTree< Key, Tree, Compare >::tree.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), and TYPED_TEST().
|
private |
Definition at line 461 of file tpl_dynSetTree.H.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::alloc_node(), Aleph::DynSetTree< Key, Tree, Compare >::alloc_node(), Aleph::DynSetTree< Key, Tree, Compare >::arena_allocated_size(), Aleph::DynSetTree< Key, Tree, Compare >::arena_available_size(), Aleph::DynSetTree< Key, Tree, Compare >::empty(), Aleph::DynSetTree< Key, Tree, Compare >::free_node(), Aleph::DynSetTree< Key, Tree, Compare >::swap(), and Aleph::DynSetTree< Key, Tree, Compare >::uses_arena().
|
staticconstexprprivate |
Definition at line 457 of file tpl_dynSetTree.H.
|
private |
Definition at line 460 of file tpl_dynSetTree.H.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::DynSetTree(), Aleph::DynSetTree< Key, Tree, Compare >::__contains_or_insert(), Aleph::DynSetTree< Key, Tree, Compare >::__insert(), Aleph::DynSetTree< Key, Tree, Compare >::__insert_dup(), Aleph::DynSetTree< Key, Tree, Compare >::__search_or_insert(), Aleph::DynSetTree< Key, Tree, Compare >::del(), Aleph::DynSetTree< Key, Tree, Compare >::empty(), Aleph::DynSetTree< Key, Tree, Compare >::find_position(), Aleph::DynSetTree< Key, Tree, Compare >::get_root(), Aleph::DynSetTree< Key, Tree, Compare >::is_empty(), Aleph::DynSetTree< Key, Tree, Compare >::join(), Aleph::DynSetTree< Key, Tree, Compare >::join_dup(), Aleph::DynSetTree< Key, Tree, Compare >::max(), Aleph::DynSetTree< Key, Tree, Compare >::min(), Aleph::DynSetTree< Key, Tree, Compare >::operator=(), Aleph::DynSetTree< Key, Tree, Compare >::remove(), Aleph::DynSetTree< Key, Tree, Compare >::remove_pos(), Aleph::DynSetTree< Key, Tree, Compare >::select(), Aleph::DynSetTree< Key, Tree, Compare >::select(), Aleph::DynSetTree< Key, Tree, Compare >::size(), Aleph::DynSetTree< Key, Tree, Compare >::split_key(), Aleph::DynSetTree< Key, Tree, Compare >::split_key_dup(), Aleph::DynSetTree< Key, Tree, Compare >::split_pos(), and Aleph::DynSetTree< Key, Tree, Compare >::swap().
|
mutableprivate |
Definition at line 459 of file tpl_dynSetTree.H.
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::DynSetTree(), Aleph::DynSetTree< Key, Tree, Compare >::__contains_or_insert(), Aleph::DynSetTree< Key, Tree, Compare >::__insert(), Aleph::DynSetTree< Key, Tree, Compare >::__insert_dup(), Aleph::DynSetTree< Key, Tree, Compare >::__search_or_insert(), Aleph::DynSetTree< Key, Tree, Compare >::del(), Aleph::DynSetTree< Key, Tree, Compare >::empty(), Aleph::DynSetTree< Key, Tree, Compare >::find(), Aleph::DynSetTree< Key, Tree, Compare >::find_position(), Aleph::DynSetTree< Key, Tree, Compare >::for_each_in_preorder(), Aleph::DynSetTree< Key, Tree, Compare >::for_each_inorder(), Aleph::DynSetTree< Key, Tree, Compare >::for_each_postorder(), Aleph::DynSetTree< Key, Tree, Compare >::for_each_preorder(), Aleph::DynSetTree< Key, Tree, Compare >::get_root(), Aleph::DynSetTree< Key, Tree, Compare >::get_root_node(), Aleph::DynSetTree< Key, Tree, Compare >::height(), Aleph::DynSetTree< Key, Tree, Compare >::internal_path_length(), Aleph::DynSetTree< Key, Tree, Compare >::join(), Aleph::DynSetTree< Key, Tree, Compare >::join_dup(), Aleph::DynSetTree< Key, Tree, Compare >::max(), Aleph::DynSetTree< Key, Tree, Compare >::min(), Aleph::DynSetTree< Key, Tree, Compare >::operator=(), Aleph::DynSetTree< Key, Tree, Compare >::position(), Aleph::DynSetTree< Key, Tree, Compare >::remove(), Aleph::DynSetTree< Key, Tree, Compare >::remove_pos(), Aleph::DynSetTree< Key, Tree, Compare >::search(), Aleph::DynSetTree< Key, Tree, Compare >::select(), Aleph::DynSetTree< Key, Tree, Compare >::select(), Aleph::DynSetTree< Key, Tree, Compare >::split_key(), Aleph::DynSetTree< Key, Tree, Compare >::split_key_dup(), Aleph::DynSetTree< Key, Tree, Compare >::split_pos(), Aleph::DynSetTree< Key, Tree, Compare >::swap(), Aleph::DynSetTree< Key, Tree, Compare >::traverse(), Aleph::DynSetTree< Key, Tree, Compare >::traverse(), and Aleph::DynSetTree< Key, Tree, Compare >::verify().