|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Generic key-value map implemented on top of a binary search tree. More...
#include <tpl_dynMapTree.H>
Public Types | |
| using | Key_Type = Key |
| using | Item_Type = Pair |
| using | Value_Type = Data |
| using | Iterator = typename Base::Iterator |
| using | Const_Iterator = typename Base::Const_Iterator |
| Read-only iterator: the iterator of a constant map. | |
Public Types inherited from Aleph::DynSetTree< Key, Tree, Compare > | |
| 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 |
| using | Const_Iterator = Aleph::Const_Iterator< Iterator > |
| Read-only iterator: the iterator of a constant set. | |
Public Types inherited from StlAlephIterator< SetName > | |
| using | iterator = StlIterator< SetName > |
| using | const_iterator = StlConstIterator< SetName > |
Public Member Functions | |
| DynMapTree (const DynList< Key > &keys) | |
| DynMapTree ()=default | |
| Pair * | insert (const Key &key, const Data &data) |
| Insert a key-value pair. | |
| Pair * | insert (const Key &key, Data &&data=Data()) |
| Pair * | insert (Key &&key, const Data &data) |
| Pair * | insert (Key &&key, Data &&data=Data()) |
| Pair * | append (const Key &key, const Data &data) |
| Pair * | append (const Key &key, Data &&data=Data()) |
| Pair * | append (Key &&key, const Data &data) |
| Pair * | append (Key &&key, Data &&data=Data()) |
| Pair * | put (const Key &key, const Data &data) |
| Alias for insert(). | |
| Pair * | put (const Key &key, Data &&data) |
| Pair * | put (Key &&key, const Data &data) |
| Pair * | put (Key &&key, Data &&data) |
| Data | remove (const Key &key) |
Deletes the pair key,data | |
| Data | remove (Key &&key) |
| void | remove_key (const Key &key) |
Deletes the pair whose key is key. | |
| Pair * | search (const Key &key) noexcept(nothrow_search) |
| Collect all keys. | |
| const Pair * | search (const Key &key) const noexcept(nothrow_search) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. A pointer to const. | |
| Pair * | search (Key &&key) noexcept(nothrow_search) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| const Pair * | search (Key &&key) const noexcept(nothrow_search) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. A pointer to const. | |
| bool | has (const Key &key) const noexcept(nothrow_search) |
Return whether key is in the map. | |
| bool | has (Key &&key) const noexcept(nothrow_search) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | contains (const Key &key) const noexcept(nothrow_search) |
| Same as has(). | |
| bool | contains (Key &&key) const noexcept(nothrow_search) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Data & | find (const Key &key) |
Find the value associated with key. | |
| const Data & | find (const Key &key) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. A reference to const. | |
| Data & | operator[] (const Key &key) |
| const Data & | operator[] (const Key &key) const |
| Data & | operator[] (Key &&key) |
| const Data & | operator[] (Key &&key) const |
| DynList< Key > | keys () const |
| DynList< Data > | values () const |
| Collect all values. | |
| DynList< Data * > | values_ptr () |
| Collect pointers to all values. | |
| DynList< Pair * > | items_ptr () |
| Collect pointers to all stored pairs. | |
| Key * | insert (const Key &key) |
| Inserts a key into the dynamic set. | |
| Key * | insert (Key &&key) |
Public Member Functions inherited from Aleph::DynSetTree< Key, Tree, Compare > | |
| 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 () noexcept(nothrow_empty_tree) | |
| Builds an empty set, with a comparison criteria built by default. | |
| DynSetTree (const Compare &cmp) noexcept(std::is_nothrow_constructible_v< Tree< Key, Compare >, const Compare & >) | |
Builds an empty set with the comparison criteria cmp. | |
| 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 > requires (not std::is_arithmetic_v<It> and requires (It it) { *it; ++it; it != it; }) | |
| DynSetTree (It b, It e) | |
| DynSetTree (std::initializer_list< Key > l) | |
| DynSetTree (DynSetTree &&srcTree) noexcept(std::is_nothrow_move_constructible_v< Tree< Key, Compare > >) | |
| Take the elements of another set, which is left empty: on a tree that cannot be copied, as those of the library. | |
| DynSetTree (DynSetTree &&srcTree) noexcept(nothrow_empty_tree and noexcept(swap(srcTree))) | |
| Take the elements of another set, which is left empty: on a tree that can be copied, which may have no move of its own. | |
| void | empty () |
| Remove all the elements of the set. | |
| void | clear () |
| Empties the container. | |
| DynSetTree & | operator= (const DynList< Key > &list) |
| DynSetTree & | operator= (const DynSetTree &srcTree) |
Assign a copy of srcTree to this set. | |
| DynSetTree & | operator= (DynSetTree &&srcTree) noexcept(noexcept(swap(srcTree))) |
| Free the elements of this set, and take those of another, which is left empty. | |
| 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 the key at the inorder position i. | |
| 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 |
| Checks if a key exists in the set. | |
| Key & | find (const Key &key) |
| Returns a modifiable reference to an element within the set. | |
| const Key & | find (const Key &key) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. A reference to const. | |
| 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) |
| Find an element in the set. | |
| const Key * | search (const Key &key) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. A pointer to const. | |
| const Key & | min () const |
| Returns the smallest key contained in the set according to the criterion comparison given. | |
| const Key & | get_first () const |
See min. | |
| const Key & | max () const |
| Returns the largest key contained in the set according to the criteria comparison given. | |
| const Key & | get_last () const |
See max. | |
| 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 > requires Aleph::PredicateWith<Operation &, Key &> | |
| bool | traverse (Operation &op) |
| Traverse all the set of pairs and for each key executes the operation op. | |
| template<class Operation > requires Aleph::PredicateWith<Operation &, Key &> | |
| bool | traverse (Operation &&op=Operation()) |
See traverse(Operation & op). | |
| template<class Operation > requires Aleph::PredicateWith<Operation &, const Key &> | |
| bool | traverse (Operation &op) const |
| Traverse a constant set in order; each key is handed out as a constant reference. | |
| template<class Operation > requires Aleph::PredicateWith<Operation &, const Key &> | |
| bool | traverse (Operation &&op=Operation()) const |
See traverse(Operation & op) const. | |
| Compare | key_comp () const |
| Return a copy of the comparator that orders the keys. | |
Public Member Functions inherited from LocateFunctions< Container, Type > | |
| auto | get_it () |
| Return a properly initialized iterator positioned at the first item on the container. | |
| auto | get_it () const |
| Read-only iterator positioned at the first item. | |
| auto | get_it (const size_t pos) |
Return a properly initialized iterator positioned at the pos item on the container. | |
| auto | get_it (const size_t pos) const |
Read-only iterator positioned at the pos item. | |
| auto | get_itor () |
Alias of get_it(). | |
| auto | get_itor () const |
See get_itor(). | |
| template<class C = Container> requires Aleph::dry_detail::MutablyTraversable<C, Type> | |
| Type & | nth_ne (const size_t n) noexcept(Aleph::dry_detail::mutable_traversal_is_noexcept< C, Type >) |
| Return the n‑th element without bounds checking. | |
| const Type & | nth_ne (const size_t n) const noexcept(Aleph::dry_detail::const_traversal_is_noexcept< Container, Type >) |
Constant overload of nth_ne(size_t). | |
| template<class C = Container> requires Aleph::dry_detail::MutablyTraversable<C, Type> | |
| Type & | nth (const size_t n) |
| Return the n-th item of the container. | |
| const Type & | nth (const size_t n) const |
Const overload of nth(size_t). | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, Type &> | |
| and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Container, Operation >::type, Type > Type * | find_ptr (Operation &operation) noexcept(mutable_search_is_noexcept< Operation >()) |
| Find a pointer to an item in the container according to a searching criterion. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const Type &> | |
| const Type * | find_ptr (Operation &operation) const noexcept(const_search_is_noexcept< Operation >()) |
Const overload of find_ptr(Operation&). | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const Type &> | |
| const Type * | find_ptr (Operation &&operation) const noexcept(const_search_is_noexcept< Operation >()) |
| Overload of find_ptr() const that accepts rvalues. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, Type &> | |
| and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Container, Operation >::type, Type > Type * | find_ptr (Operation &&operation) noexcept(mutable_search_is_noexcept< Operation >()) |
| Overload of find_ptr() that accepts rvalues. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const Type &> | |
| size_t | find_index (Operation &operation) const noexcept(const_search_is_noexcept< Operation >()) |
| Find the position of an item in the container according to a searching criterion. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const Type &> | |
| size_t | find_index (Operation &&operation) const noexcept(const_search_is_noexcept< Operation >()) |
| Overload of find_index() that accepts rvalues. | |
| template<class Operation , class T = Type> requires Aleph::InvocablePredicateWith<Operation &, const Type &> | |
| and std::default_initializable< T > and std::copy_constructible< T > std::tuple< bool, Type > | find_item (Operation &operation) const noexcept(find_item_is_noexcept< Operation >()) |
| Safe sequential searching of an item matching a criterion. | |
| template<class Operation , class T = Type> requires Aleph::InvocablePredicateWith<Operation &, const Type &> | |
| and std::default_initializable< T > and std::copy_constructible< T > std::tuple< bool, Type > | find_item (Operation &&operation) const noexcept(find_item_is_noexcept< Operation >()) |
| Overload of find_item() that accepts rvalues. | |
| template<class Operation , class T = Type> requires Aleph::InvocablePredicateWith<Operation &, const Type &> | |
| and std::copy_constructible< T > std::optional< Type > | find_opt (Operation &operation) const |
| Copy of the first item satisfying a criterion, if any. | |
| template<class Operation , class T = Type> requires Aleph::InvocablePredicateWith<Operation &, const Type &> | |
| and std::copy_constructible< T > std::optional< Type > | find_opt (Operation &&operation) const |
| Overload of find_opt() that accepts rvalues. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const Type &> | |
| bool | contains_if (Operation &&operation) const noexcept(const_search_is_noexcept< Operation >()) |
| Test if an item satisfying a criterion is present in the container. | |
| template<class T = Type> requires requires(const T & a, const T & b) { { a == b } -> std::convertible_to<bool>; } | |
| bool | contains (const Type &item) const |
| Test if an item is present in the container using equality. | |
Public Member Functions inherited from FunctionalMethods< Container, T > | |
| void | emplace (Args &&... args) |
| Appends a new element into the container by constructing it from the given args. | |
| void | emplace_end (Args &&... args) |
See emplace(Args && ... args). | |
| void | emplace_ins (Args &&... args) |
| template<typename... Args> requires ((std::convertible_to<Args &&, T> and ...) and (Aleph::InsertableWith<typename Aleph::concepts_detail::defer<Container, std::tuple<Args...>>::type, Item_Arg<Args>> and ...)) | |
| size_t | ninsert (Args &&... args) |
| Insert n variadic items. | |
| template<typename... Args> requires ((std::convertible_to<Args &&, T> and ...) and (Aleph::AppendableWith<typename Aleph::concepts_detail::defer<Container, std::tuple<Args...>>::type, Item_Arg<Args>> and ...)) | |
| size_t | nappend (Args &&... args) |
| Append n variadic items. | |
| template<class Operation > requires Aleph::InvocableWith<Operation &, const T &> | |
| void | for_each (Operation &operation) const |
| Traverse all the container and performs an operation on each element. | |
| template<class Operation > requires Aleph::InvocableWith<Operation &, const T &> | |
| void | for_each (Operation &&operation) const |
| Overload of for_each() that accepts rvalues. | |
| template<class Operation > requires Aleph::InvocableWith<Operation &, const T &> | |
| void | each (Operation &operation) const |
| Alias of for_each(). | |
| template<class Operation > requires Aleph::InvocableWith<Operation &, const T &> | |
| void | each (Operation &&operation) const |
| Alias of for_each() that accepts rvalues. | |
| template<class Operation > requires Aleph::InvocableWith<Operation &, const T &> | |
| void | each (const size_t pos, const size_t slice, Operation &operation) const |
Traverse the container starting at pos taking one item every slice, performing an operation on each visited element. | |
| template<class Operation > requires Aleph::InvocableWith<Operation &, const T &> | |
| void | each (const size_t pos, const size_t slice, Operation &&operation) const |
See each(size_t pos, size_t slice, Operation & operation) const. | |
| template<class Operation > requires Aleph::InvocableWith<Operation &, T &> | |
| and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Container, Operation >::type, T > void | each (const size_t pos, const size_t slice, Operation &operation) |
Traverse the container starting at pos taking one item every slice, performing an operation that may modify each visited item. | |
| template<class Operation > requires Aleph::InvocableWith<Operation &, T &> | |
| and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Container, Operation >::type, T > void | each (const size_t pos, const size_t slice, Operation &&operation) |
See each(size_t pos, size_t slice, Operation & operation). | |
| template<class Operation > requires Aleph::InvocableWith<Operation &, T &> | |
| and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Container, Operation >::type, T > void | mutable_for_each (Operation &operation) |
| Apply a mutable operation to each element of the container. | |
| template<class Operation > requires Aleph::InvocableWith<Operation &, T &> | |
| and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Container, Operation >::type, T > void | mutable_for_each (Operation &&operation) |
See mutable_for_each(Operation & operation). | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| bool | all (Operation &operation) const |
| Check if all the elements of the container satisfy a condition. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| bool | all (Operation &&operation) const |
| Overload of all() that accepts rvalues. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| bool | exists (Operation &op) const |
| Test for existence in the container of an element satisfying a criterion. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| bool | exists (Operation &&op) const |
| Overload of exists() that accepts rvalues. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| bool | none (Operation &op) const |
| Test that no element satisfies a criterion. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| bool | none (Operation &&op) const |
| Overload of none() that accepts rvalues. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| size_t | count_if (Operation &op) const |
| Count the elements that satisfy a criterion. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| size_t | count_if (Operation &&op) const |
| Overload of count_if() that accepts rvalues. | |
| Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, T > > | maps (Operation &op) const |
| Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, T > > | maps (Operation &&op) const |
| Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, T > > | maps_if (Prop prop, Operation &op) const |
| Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, T > > | maps_if (Prop prop, Operation &&op) const |
| Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, T > > | map (Operation &op) const |
| Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, T > > | map (Operation &&op) const |
| Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, T > > | map_if (Prop prop, Operation &op) const |
| Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, T > > | map_if (Prop prop, Operation &&op) const |
| template<class Operation > requires Aleph::InvocableWith<Operation &, const T &> | |
| auto | flat_map (Operation &op) const |
| Map each element to a container and concatenate the results. | |
| template<class Operation > requires Aleph::InvocableWith<Operation &, const T &> | |
| auto | flat_map (Operation &&op) const |
| Overload of flat_map() 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 Acc = T, class Op > requires Aleph::dry_detail::FoldOperation<Op, Acc, T> | |
| Acc | foldl (const Acc &init, Op &op) const |
| Fold the elements of the container to a specific result. | |
| template<typename Acc = T, class Op > requires Aleph::dry_detail::FoldOperation<Op, Acc, T> | |
| Acc | foldl (const Acc &init, Op &&op) const |
| Overload of foldl() that accepts rvalues. | |
| template<typename Acc = T, class Op > requires Aleph::dry_detail::FoldOperation<Op, Acc, T> | |
| Acc | fold_left (const Acc &init, Op &op) const |
| Alias for foldl(). | |
| template<typename Acc = T, class Op > requires Aleph::dry_detail::FoldOperation<Op, Acc, T> | |
| Acc | fold_left (const Acc &init, Op &&op) const |
| Overload of fold_left() that accepts rvalues. | |
| template<class Operation > requires Aleph::dry_detail::FoldOperation<Operation, T, T> | |
| 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 > requires Aleph::dry_detail::FoldOperation<Operation, T, T> | |
| T | fold (const T &init, Operation &&operation) const |
| Overload of fold() that accepts rvalues. | |
| template<typename Acc = T, class Op > requires Aleph::dry_detail::FoldRightOperation<Op, Acc, T> | |
| Acc | foldr (const Acc &init, Op &op) const |
| Fold the elements from the last to the first. | |
| template<typename Acc = T, class Op > requires Aleph::dry_detail::FoldRightOperation<Op, Acc, T> | |
| Acc | foldr (const Acc &init, Op &&op) const |
| Overload of foldr() that accepts rvalues. | |
| template<class Op , class U = T> requires Aleph::dry_detail::FoldOperation<Op, T, T> | |
| and std::copy_constructible< U > std::optional< T > | reduce (Op &op) const |
| Fold the elements with no initial value. | |
| template<class Op , class U = T> requires Aleph::dry_detail::FoldOperation<Op, T, T> | |
| and std::copy_constructible< U > std::optional< T > | reduce (Op &&op) const |
| Overload of reduce() that accepts rvalues. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| Aleph::DynList< T > | filter (Operation &operation) const |
| Filter the elements of a container according to a matching criterion. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| Aleph::DynList< T > | filter (Operation &&operation) const |
| Overload of filter() that accepts rvalues. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| Aleph::DynList< const T * > | ptr_filter (Operation &operation) const |
| Filter the elements of a container according to a matching criterion and return a pointer to the matched items in the container. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| Aleph::DynList< const T * > | ptr_filter (Operation &&operation) const |
| Overload of ptr_filter() that accepts rvalues. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| Aleph::DynList< std::tuple< T, size_t > > | pfilter (Operation &operation) const |
| Filter the elements of a container according to a matching criterion and determine its positions respect to the traversal of container. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| Aleph::DynList< std::tuple< T, size_t > > | pfilter (Operation &&operation) const |
| Overload of pfilter() that accepts rvalues. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| std::pair< Aleph::DynList< T >, Aleph::DynList< T > > | partition (Operation &op) const |
| Exclusive partition of container according to a filter criterion. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| std::pair< Aleph::DynList< T >, Aleph::DynList< T > > | partition (Operation &&op) const |
| Overload of partition() that accepts rvalues. | |
| 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 > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| std::tuple< Aleph::DynList< T >, Aleph::DynList< T > > | tpartition (Operation &op) const |
| Exclusive partition of container according to a filter criterion. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| std::tuple< Aleph::DynList< T >, Aleph::DynList< T > > | tpartition (Operation &&op) const |
| Overload of tpartition() that accepts rvalues. | |
| size_t | length () const noexcept(Aleph::dry_detail::const_traversal_is_noexcept< Container, T >) |
| 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 the elements at positions i, i + step, i + 2 step, ... that are not greater than j, respect to the traversal order. | |
| Aleph::DynList< T > | drop (const size_t n) const |
| Drop the first n elements seen in the container during its traversal. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| Aleph::DynList< T > | take_while (Operation &op) const |
| The longest prefix of elements that satisfy a criterion. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| Aleph::DynList< T > | take_while (Operation &&op) const |
| Overload of take_while() that accepts rvalues. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| Aleph::DynList< T > | drop_while (Operation &op) const |
| The elements after the longest prefix that satisfies a criterion. | |
| template<class Operation > requires Aleph::InvocablePredicateWith<Operation &, const T &> | |
| Aleph::DynList< T > | drop_while (Operation &&op) const |
| Overload of drop_while() that accepts rvalues. | |
| template<class C = Container> requires requires (C & c) { c.remove(); } | |
| 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 |
See items(). | |
Public Member Functions inherited from EqualSortedMethod< Container > | |
| bool | equal_to (const Container &r) const |
Equality test between this and r. | |
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. | |
Static Public Member Functions | |
| template<typename... Items> requires requires (Items &&... items) { DynMapTree ::template build_as< DynMapTree >(std::forward<Items>(items)...); } | |
| static DynMapTree | build (Items &&... items) |
| static Data & | get_data (Key &key) noexcept |
| static const Data & | get_data (const Key &key) noexcept |
| static const Key & | get_key (Data *data_ptr) noexcept |
| static const Key & | get_key (const Data *data_ptr) noexcept |
Static Public Member Functions inherited from FunctionalMethods< Container, T > | |
| template<typename... Items> requires ((std::convertible_to<Items &&, T> and ...) and (Aleph::AppendableWith<typename Aleph::concepts_detail::defer<Container, std::tuple<Items...>>::type, Item_Arg<Items>> and ...)) | |
| static Container | build (Items &&... items) |
| Build a container that holds the given items. | |
| template<class D , typename... Items> requires (std::derived_from<D, typename Aleph::concepts_detail::defer<Container, D>::type> and std::default_initializable<D> and (std::convertible_to<Items &&, T> and ...) and (Aleph::AppendableWith<typename Aleph::concepts_detail::defer<Container, std::tuple<D, Items...>>::type, Item_Arg<Items>> and ...)) | |
| static D | build_as (Items &&... items) |
Build a D, a class derived from the container, holding the given items. | |
Private Types | |
| using | Pair = std::pair< Key, Data > |
| using | Base = DynSetTree< std::pair< Key, Data >, Tree, Dft_Pair_Cmp< Key, Data, Compare > > |
| using | Node = typename Base::Node |
Private Member Functions | |
| Pair * | search_pair (const Key &key) const noexcept(nothrow_search) |
Static Private Attributes | |
| static constexpr bool | splays |
| static constexpr bool | nothrow_search |
Additional Inherited Members | |
Public Attributes inherited from FunctionalMethods< Container, T > | |
| template<typename... Args> requires (typename Aleph::concepts_detail::defer<Container, std::tuple<Args...>>::type & c, T && x) | |
| and { c.append(std::move(x)) | |
| Insert a new element into the container by constructing it from the given args. | |
| template<typename R = void, class Prop , class Operation > requires (Aleph::DynList<Aleph::dry_detail::map_result_t<R, Operation &, T>> & l, Operation & op, const T & item) | |
| and Aleph::InvocableWith< Operation &, const T & > | and { l.append(std::invoke(op, item)) |
| Conditional mapping of the elements of the container. | |
Protected Member Functions inherited from Aleph::DynSetTree< Key, Tree, Compare > | |
| decltype(auto) | get_compare () const noexcept(noexcept(tree.get_compare())) |
| The comparator that orders the keys, as the tree gives it. | |
Generic key-value map implemented on top of a binary search tree.
DynMapTree maps unique keys (Key) to values (Data). Internally it is a DynSetTree<std::pair<Key, Data>, ...> whose ordering compares pairs by their first component.
Template parameters:
Key: key type (map domain).Data: mapped type (map range).Tree: binary search tree type used for instrumentation.Compare: ordering for keys.Element access:
operator[] inserts a default-constructed Data when the key is missing.find() throws std::domain_error when the key is missing.Data. The splay trees are the exception: only their own search, which takes a pair, moves what it finds to the root. operator[], remove() and remove_key() build a std::pair<Key, Data> with a Data(), as the trees insert and remove whole pairs, so they require Data to be default-constructible.Definition at line 91 of file tpl_dynMapTree.H.
|
private |
Definition at line 97 of file tpl_dynMapTree.H.
| using Aleph::DynMapTree< Key, Data, Tree, Compare >::Const_Iterator = typename Base::Const_Iterator |
Read-only iterator: the iterator of a constant map.
Definition at line 433 of file tpl_dynMapTree.H.
| using Aleph::DynMapTree< Key, Data, Tree, Compare >::Item_Type = Pair |
Definition at line 174 of file tpl_dynMapTree.H.
| using Aleph::DynMapTree< Key, Data, Tree, Compare >::Iterator = typename Base::Iterator |
Definition at line 430 of file tpl_dynMapTree.H.
| using Aleph::DynMapTree< Key, Data, Tree, Compare >::Key_Type = Key |
Definition at line 172 of file tpl_dynMapTree.H.
|
private |
Definition at line 100 of file tpl_dynMapTree.H.
|
private |
Definition at line 95 of file tpl_dynMapTree.H.
| using Aleph::DynMapTree< Key, Data, Tree, Compare >::Value_Type = Data |
Definition at line 176 of file tpl_dynMapTree.H.
|
inline |
Definition at line 163 of file tpl_dynMapTree.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::insert(), k, and Aleph::DynMapTree< Key, Data, Tree, Compare >::keys().
|
default |
|
inline |
Definition at line 232 of file tpl_dynMapTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::insert().
Referenced by Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::_build_interpolation_grid(), Aleph::graph_coloring_detail::build_undirected_adj(), Aleph::min_mean_cycle_detail::incoming_lists(), and Aleph::MCF_LP_Solver< Net >::solve().
|
inline |
Definition at line 237 of file tpl_dynMapTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::insert().
|
inline |
Definition at line 242 of file tpl_dynMapTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::insert().
|
inline |
Definition at line 247 of file tpl_dynMapTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::insert().
|
inlinestatic |
Definition at line 170 of file tpl_dynMapTree.H.
|
inlinenoexcept |
Same as has().
Definition at line 376 of file tpl_dynMapTree.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::has().
Referenced by Aleph::planarity_detail::collect_certificate_nodes(), Aleph::compute_min_cut(), Aleph::decompose_flow(), Aleph::nonplanar_certificate_to_dot(), Aleph::nonplanar_certificate_to_gexf(), Aleph::nonplanar_certificate_to_graphml(), Aleph::nonplanar_certificate_to_json(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::pair_is_recorded(), Aleph::planar_dual_metadata(), Aleph::planar_geometric_drawing(), Aleph::solve_assignment(), TEST(), TEST(), and Aleph::validate_nonplanar_certificate().
|
inlinenoexcept |
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 379 of file tpl_dynMapTree.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::has().
|
inline |
Find the value associated with key.
| [in] | key | Key to find. |
| std::domain_error | If key is not present. |
| what | search() throws. |
key and a Data(). Definition at line 390 of file tpl_dynMapTree.H.
References ah_domain_error_if, and Aleph::DynMapTree< Key, Data, Tree, Compare >::search_pair().
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), Aleph::hamiltonian_detail::Simple_Graph< GT, SA >::Simple_Graph(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::build_path(), Aleph::k_shortest_paths_detail::build_suffix_index_digraph(), Aleph::k_shortest_paths_detail::build_suffix_index_with_itor(), Aleph::Lengauer_Tarjan_Post_Dominators< GT, SA >::build_tree(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::build_underlying_simple_graph(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::compute_faces_from_rotation(), Aleph::compute_min_cut(), Aleph::Euclidian_Graph< __Euclidian_Node, __Euclidian_Arc >::copy_from(), demo_basic_operations(), demo_register_allocation(), Aleph::digraph_graphviz(), Aleph::Huffman_Encoder_Engine::encode(), Aleph::Huffman_Encoder_Engine::encode(), Aleph::MCF_Graph< NodeT, ArcT >::get_node_index(), Aleph::hamiltonian_detail::Simple_Graph< GT, SA >::in_degree(), Aleph::min_mean_cycle_detail::incoming_lists(), Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::join_through_a_path(), Aleph::nonplanar_certificate_to_dot(), Aleph::nonplanar_certificate_to_gexf(), Aleph::nonplanar_certificate_to_graphml(), Aleph::nonplanar_certificate_to_json(), Aleph::DynMapTree< Key, Data, Tree, Compare >::operator[](), Aleph::DynMapTree< Key, Data, Tree, Compare >::operator[](), Aleph::planar_dual_metadata(), Aleph::planar_geometric_drawing(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::pop_block_and_build_cycle(), print_coloring(), Aleph::rank_graphviz(), Aleph::Xml_Graph< GT, Node_Reader, Arc_Reader, Node_Writer, Arc_Writer >::read_graph(), Aleph::IO_Graph< GT, Load_Node, Store_Node, Load_Arc, Store_Arc, NF, AF >::save(), Aleph::IO_Graph< GT, Load_Node, Store_Node, Load_Arc, Store_Arc, NF, AF >::save_in_text_mode(), save_level_pos_2(), Aleph::MCF_LP_Solver< Net >::solve(), Aleph::solve_assignment(), TEST(), TEST(), TEST(), test(), TYPED_TEST(), Aleph::validate_nonplanar_certificate(), Aleph::vertex_connectivity(), write_coloring_dot(), Aleph::write_df_low_tree(), and Aleph::Xml_Graph< GT, Node_Reader, Arc_Reader, Node_Writer, Arc_Writer >::write_graph().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. A reference to const.
Definition at line 399 of file tpl_dynMapTree.H.
References ah_domain_error_if, and Aleph::DynMapTree< Key, Data, Tree, Compare >::search_pair().
|
inlinestaticnoexcept |
Definition at line 186 of file tpl_dynMapTree.H.
|
inlinestaticnoexcept |
Definition at line 181 of file tpl_dynMapTree.H.
Referenced by TEST().
|
inlinestaticnoexcept |
Definition at line 196 of file tpl_dynMapTree.H.
|
inlinestaticnoexcept |
Definition at line 191 of file tpl_dynMapTree.H.
Referenced by TEST().
|
inlinenoexcept |
Return whether key is in the map.
| [in] | key | Key to search. |
true if a pair has a key equivalent to key. | what | search() throws. |
Definition at line 370 of file tpl_dynMapTree.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::search_pair().
Referenced by Aleph::capacity_scaling_maximum_flow(), Aleph::DynMapTree< Key, Data, Tree, Compare >::contains(), Aleph::DynMapTree< Key, Data, Tree, Compare >::contains(), demo_basic_operations(), demo_word_frequency(), insert_n_random_items_in_map(), Aleph::restore_flow_solution(), Aleph::MCF_LP_Solver< Net >::solve(), TEST_F(), TEST_F(), TEST_F(), AHDispatcher< Key, Operation >::valid_key(), and Aleph::AHMapping< Key, ValueType >::valid_key().
|
inlinenoexcept |
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 373 of file tpl_dynMapTree.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::search_pair().
|
inline |
Inserts a key into the dynamic set.
Inserts the key into the dynamic set.
| [in] | key | key to insert. |
Definition at line 834 of file tpl_dynSetTree.H.
|
inline |
Insert a key-value pair.
If key is already present, no insertion is performed and nullptr is returned.
| [in] | key | Key to insert. |
| [in] | data | Value to associate with key. |
| std::bad_alloc | If there is not enough memory. |
Definition at line 211 of file tpl_dynMapTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::insert().
Referenced by AHDispatcher< Key, Operation >::AHDispatcher(), Aleph::AHMapping< Key, ValueType >::AHMapping(), Aleph::DynMapTree< Key, Data, Tree, Compare >::DynMapTree(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), Aleph::MCF_LP_Solver< Net >::MCF_LP_Solver(), Aleph::hamiltonian_detail::Simple_Graph< GT, SA >::Simple_Graph(), Aleph::blossom_detail::Edmonds_Blossom_Matcher< GT, SA >::build_adjacency(), Aleph::tree_dp_detail::Tree_Topology< GT, SA >::build_adjacency(), Aleph::MCF_Graph< NodeT, ArcT >::build_node_index(), Aleph::Huffman_Encoder_Engine::build_prefix_encoding(), Aleph::hld_detail::HLD_Tree_Data< GT, SA >::build_simple_adjacency(), Aleph::lca_detail::Rooted_Tree_Data< GT, SA >::build_simple_adjacency(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::build_simple_adjacency(), Aleph::build_spanning_tree(), Aleph::k_shortest_paths_detail::build_suffix_index_digraph(), Aleph::k_shortest_paths_detail::build_suffix_index_with_itor(), Aleph::Lengauer_Tarjan_Post_Dominators< GT, SA >::build_tree(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::build_tree(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::build_underlying_simple_graph(), Aleph::graph_coloring_detail::build_undirected_adj(), Aleph::chromatic_number(), Aleph::planarity_detail::collect_certificate_nodes(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::compute_all_pairs_distances(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::compute_faces_from_rotation(), Aleph::compute_maximum_cardinality_bipartite_matching(), Aleph::compute_min_cut(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::compute_nodes_weights(), Aleph::Copy_Graph< GT, SN, SA >::copy(), Aleph::Euclidian_Graph< __Euclidian_Node, __Euclidian_Arc >::copy_from(), Aleph::copy_graph(), demo_basic_operations(), Aleph::design_survey(), Aleph::digraph_graphviz(), Aleph::Lengauer_Tarjan_Dominators< GT, SA >::dominance_frontiers(), Aleph::dsatur_coloring(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::enqueue_pair_if_needed(), Aleph::Lengauer_Tarjan_Post_Dominators< GT, SA >::ensure_computed(), Aleph::greedy_coloring(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::groebner_basis(), Aleph::min_mean_cycle_detail::incoming_lists(), Aleph::AHMapping< Key, ValueType >::insert(), AHDispatcher< Key, Operation >::insert(), insert_n_random_items_in_map(), Aleph::Huffman_Encoder_Engine::insert_symbol_node(), Aleph::inter_copy_graph(), Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::join_through_a_path(), Aleph::map_unify(), Aleph::IO_Graph< GT, Load_Node, Store_Node, Load_Arc, Store_Arc, NF, AF >::number_shown_nodes(), Aleph::df_tree_detail::number_tree(), Aleph::planar_dual_metadata(), Aleph::planar_geometric_drawing(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::pop_block_and_build_cycle(), Aleph::Lengauer_Tarjan_Post_Dominators< GT, SA >::post_dominance_frontiers(), Aleph::DynMapTree< Key, Data, Tree, Compare >::put(), Aleph::DynMapTree< Key, Data, Tree, Compare >::put(), Aleph::DynMapTree< Key, Data, Tree, Compare >::put(), Aleph::DynMapTree< Key, Data, Tree, Compare >::put(), Aleph::rank_graphviz(), Aleph::Xml_Graph< GT, Node_Reader, Arc_Reader, Node_Writer, Arc_Writer >::read_graph(), save_level_pos_1(), Aleph::solve_assignment(), Aleph::stdmap_to_DynMapTree(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), test(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), Aleph::vertex_connectivity(), Aleph::welsh_powell_coloring(), and Aleph::Xml_Graph< GT, Node_Reader, Arc_Reader, Node_Writer, Arc_Writer >::write_graph().
|
inline |
Definition at line 216 of file tpl_dynMapTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::insert().
|
inline |
Definition at line 847 of file tpl_dynSetTree.H.
|
inline |
Definition at line 221 of file tpl_dynMapTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::insert().
|
inline |
Definition at line 226 of file tpl_dynMapTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::insert().
|
inline |
Collect pointers to all stored pairs.
Definition at line 465 of file tpl_dynMapTree.H.
References Aleph::DynList< T >::append().
|
inline |
Definition at line 435 of file tpl_dynMapTree.H.
Referenced by Aleph::DynMapTree< Key, Data, Tree, Compare >::DynMapTree(), AHDispatcher< Key, Operation >::keys(), and Aleph::AHMapping< Key, ValueType >::keys().
|
inline |
Definition at line 406 of file tpl_dynMapTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::search_or_insert().
|
inline |
Definition at line 413 of file tpl_dynMapTree.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::find().
|
inline |
Definition at line 418 of file tpl_dynMapTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::search_or_insert().
|
inline |
Definition at line 425 of file tpl_dynMapTree.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::find().
|
inline |
Alias for insert().
Definition at line 257 of file tpl_dynMapTree.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::insert().
|
inline |
Definition at line 262 of file tpl_dynMapTree.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::insert().
|
inline |
Definition at line 267 of file tpl_dynMapTree.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::insert().
|
inline |
Definition at line 272 of file tpl_dynMapTree.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::insert().
|
inline |
Deletes the pair key,data
remove(key) deletes from the mapping the pair associated to key
| [in] | key | to delete |
| domain_error | if the key is not in the mapping |
Definition at line 285 of file tpl_dynMapTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::del().
Referenced by demo_basic_operations(), AHDispatcher< Key, Operation >::remove(), Aleph::AHMapping< Key, ValueType >::remove(), test(), TEST_F(), and TEST_F().
|
inline |
Definition at line 293 of file tpl_dynMapTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::del().
|
inline |
Deletes the pair whose key is key.
| [in] | key | the key of the pair to delete. |
| std::domain_error | if key is not in the map. |
| what | copying key or building a Data throws. |
key and a Data(): removing by the pair stored in the node, found by the key alone, would take a second descent of the tree, which costs more than that pair. It does not copy the pair that it removes. Definition at line 312 of file tpl_dynMapTree.H.
References ah_domain_error_if, Aleph::DynSetTree< Key, Tree, Compare >::remove(), and Aleph::DynSetTree< Key, Tree, Compare >::size().
Referenced by Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::pop_best_pair().
|
inlinenoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. A pointer to const.
Definition at line 352 of file tpl_dynMapTree.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::search_pair().
|
inlinenoexcept |
Collect all keys.
DynList of keys, in the tree traversal order.Search for a key.
| [in] | key | Key to search. |
| what | comparing two keys throws; nothing when that comparison is noexcept, as Aleph::less of the arithmetic types. In a splay tree, what copying key or building the Data of the pair to search for throws instead. The splay that follows is noexcept: a comparison that throws in it ends the program, and so does a Data() that throws in the header of the splay, a whole node, which it builds by default. So, in a splay tree, neither the comparison nor the default construction of Data may throw. |
key with the key of each pair, without building a pair to search for: a copy of a long std::string key or a Data() that is an Array would allocate in every search, and what such a copy or construction throws would end the program. The splay trees are the exception: only their own search, which takes a pair, moves the pair found to the root, as they need. Definition at line 345 of file tpl_dynMapTree.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::search_pair().
Referenced by Aleph::blossom_detail::Edmonds_Blossom_Matcher< GT, SA >::build_adjacency(), Aleph::tree_dp_detail::Tree_Topology< GT, SA >::build_adjacency(), Aleph::hld_detail::HLD_Tree_Data< GT, SA >::build_simple_adjacency(), Aleph::lca_detail::Rooted_Tree_Data< GT, SA >::build_simple_adjacency(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::build_simple_adjacency(), Aleph::build_spanning_tree(), Aleph::k_shortest_paths_detail::build_suffix_state(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::build_tree(), Aleph::compiler_bind_module_surfaces(), Aleph::compiler_link_module_surfaces(), Aleph::compute_maximum_cardinality_bipartite_matching(), Aleph::Copy_Graph< GT, SN, SA >::copy(), Aleph::IO_Graph< GT, Load_Node, Store_Node, Load_Arc, Store_Arc, NF, AF >::count_shown_arcs(), demo_basic_operations(), demo_config_store(), Aleph::design_survey(), Aleph::k_shortest_paths_detail::generate_general_deviation_candidates(), Aleph::blossom_detail::Edmonds_Blossom_Matcher< GT, SA >::get_pair_arc(), Aleph::k_shortest_paths_detail::get_tree_arc(), Aleph::k_shortest_paths_detail::get_tree_next(), Aleph::is_valid_coloring(), Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::join_through_a_path(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::number_of(), Aleph::df_tree_detail::number_tree(), Aleph::k_shortest_paths_detail::Reverse_Arc_Distance< GT, Distance >::operator()(), Aleph::AHMapping< Key, ValueType >::operator[](), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::pop_block_and_build_cycle(), Aleph::Huffman_Encoder_Engine::read_input(), Aleph::Huffman_Encoder_Engine::read_input(), AHDispatcher< Key, Operation >::run(), Aleph::IO_Graph< GT, Load_Node, Store_Node, Load_Arc, Store_Arc, NF, AF >::save(), Aleph::IO_Graph< GT, Load_Node, Store_Node, Load_Arc, Store_Arc, NF, AF >::save_in_text_mode(), Aleph::Huffman_Encoder_Engine::set_end_of_stream(), Aleph::Huffman_Encoder_Engine::set_freq(), TEST(), TEST(), TEST_F(), Aleph::Lengauer_Tarjan_Post_Dominators< GT, SA >::to_orig(), Aleph::Lengauer_Tarjan_Post_Dominators< GT, SA >::to_rev(), and Aleph::Huffman_Encoder_Engine::update_freq().
|
inlinenoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. A pointer to const.
Definition at line 362 of file tpl_dynMapTree.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::search_pair().
|
inlinenoexcept |
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 358 of file tpl_dynMapTree.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::search_pair().
|
inlineprivatenoexcept |
Definition at line 132 of file tpl_dynMapTree.H.
References cmp(), Aleph::Gen_Avl_Tree< NodeType, Key, Compare >::cmp, Aleph::DynSetTree< Key, Tree, Compare >::get_compare(), Aleph::DynSetTree< Key, Tree, Compare >::get_root_node(), KEY, LLINK, RLINK, Aleph::DynSetTree< Key, Tree, Compare >::search(), and Aleph::DynMapTree< Key, Data, Tree, Compare >::splays.
Referenced by Aleph::DynMapTree< Key, Data, Tree, Compare >::find(), Aleph::DynMapTree< Key, Data, Tree, Compare >::find(), Aleph::DynMapTree< Key, Data, Tree, Compare >::has(), Aleph::DynMapTree< Key, Data, Tree, Compare >::has(), Aleph::DynMapTree< Key, Data, Tree, Compare >::search(), Aleph::DynMapTree< Key, Data, Tree, Compare >::search(), Aleph::DynMapTree< Key, Data, Tree, Compare >::search(), and Aleph::DynMapTree< Key, Data, Tree, Compare >::search().
|
inline |
Collect all values.
DynList of values, in the tree traversal order. Definition at line 444 of file tpl_dynMapTree.H.
|
inline |
Collect pointers to all values.
Definition at line 453 of file tpl_dynMapTree.H.
References Aleph::DynList< T >::append().
|
staticconstexprprivate |
Definition at line 112 of file tpl_dynMapTree.H.
|
staticconstexprprivate |
Definition at line 104 of file tpl_dynMapTree.H.
Referenced by Aleph::DynMapTree< Key, Data, Tree, Compare >::search_pair().