Polymake Template Library (PTL)
4.2
|
Associative array based on AVL::tree. More...
Inherits pm::modified_tree< Top, Params >.
Public Member Functions | |
Map () | |
Create an empty Map. Initialize the element comparator with its default constructor. | |
Map (const key_comparator_type &cmp_arg) | |
Create an empty Map with non-default comparator. | |
template<typename Iterator > | |
Map (Iterator &&src, Iterator &&src_end) | |
Construct from an iterator. | |
void | clear () |
Clear all contents. | |
void | swap (Map &m) |
Swap content with another Map in an efficient way. More... | |
template<typename Keys > | |
assoc_helper< Map, Keys >::result_type | operator[] (const Keys &k) |
Associative search. More... | |
template<typename Keys > | |
assoc_helper< const Map, Keys >::result_type | operator[] (const Keys &k) const |
Associative search (const). Find the data element associated with the given key. If it doesn't exist so far, it will raise an exception. More... | |
template<typename Keys > | |
assoc_helper< const Map, Keys >::result_type | map (const Keys &k) const |
synonym for const key lookup | |
Associative array based on AVL::tree.
It differs from the standard std::map
in the implementation: it uses an AVL::tree instead of the red-black tree. The tree is attached via a smart pointer with reference counting.
|
inline |
Associative search.
Find the data element associated with the given key. If it doesn't exist so far, it will be created with the default constructor.
Note that the type of the search key is not necessarily the same as of the map entries. It suffices that both are comparable with each other.
k can also be a container with keys; the result will be a sequence of corresponding values.
|
inline |
Associative search (const). Find the data element associated with the given key. If it doesn't exist so far, it will raise an exception.
Note that the type of the search key is not necessarily the same as of the map entries. It suffices that both are comparable with each other.
k can also be a container with keys; the result will be a sequence of corresponding values.