|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Dynamic ordered set implemented with a Skip List. More...
#include <tpl_dynSkipList.H>
Classes | |
| class | Iterator |
| Forward iterator for DynSkipList. More... | |
| struct | Node |
| Internal node structure. More... | |
Public Types | |
| using | Set_Type = DynSkipList |
| The type of container. | |
| using | Item_Type = Key |
| The type of element that stores the container. | |
| using | Key_Type = Key |
| The type of element that stores the container. | |
Public Types inherited from StlAlephIterator< SetName > | |
| using | iterator = StlIterator< SetName > |
| using | const_iterator = StlConstIterator< SetName > |
Public Member Functions | |
| void | set_seed (unsigned long seed) noexcept |
| Set the random number generator seed. | |
| gsl_rng * | gsl_rng_object () noexcept |
| Get a pointer to the GSL random number generator. | |
| DynSkipList (unsigned long seed, double p=defaultProbability) | |
| Construct a DynSkipList with given seed and probability. | |
| DynSkipList (double p=defaultProbability) | |
| Construct a DynSkipList with time-based seed. | |
| template<template< typename > class List> | |
| DynSkipList (const List< Key > &l) | |
| template<class It > | |
| DynSkipList (It b, It e) | |
| DynSkipList (std::initializer_list< Key > l) | |
| DynSkipList (const DynSkipList &other) | |
| Copy constructor. | |
| DynSkipList (DynSkipList &&other) noexcept | |
| Move constructor. | |
| ~DynSkipList () | |
| Destructor - frees all nodes and GSL random number generator. | |
| DynSkipList & | operator= (const DynSkipList &other) |
| Copy assignment operator. | |
| DynSkipList & | operator= (DynSkipList &&other) noexcept |
| Move assignment operator. | |
| void | swap (DynSkipList &other) noexcept |
| Swap contents with another DynSkipList. | |
| void | empty () noexcept |
| Remove all elements from the set. | |
| void | clear () noexcept |
| Alias for empty() for STL compatibility. | |
| size_t | size () const noexcept |
| Return the number of elements in the set. | |
| bool | is_empty () const noexcept |
| Return true if the set is empty. | |
| Compare & | get_compare () noexcept |
| Get the comparison functor. | |
| const Compare & | get_compare () const noexcept |
| Get the comparison functor (const version) | |
| Key * | insert (const Key &key) |
| Insert an element into the set. | |
| Key * | insert (Key &&key) |
| Insert an element into the set (move version). | |
| Key & | insert_unique (const Key &key) |
| Insert an element, throwing if it already exists. | |
| Key & | append (const Key &key) |
| Append method for Special_Ctors compatibility (aliases to insert) | |
| Key & | append (Key &&key) |
| Key * | search_or_insert (const Key &key) |
| Search and insert if not found. | |
| Key * | search (const Key &key) const noexcept |
| Search for a key in the set. | |
| bool | has (const Key &key) const noexcept |
| Return true if the key exists in the set. | |
| bool | contains (const Key &key) const noexcept |
| Alias for has() for STL-like interface. | |
| bool | exist (const Key &key) const noexcept |
| Alias for has() | |
| Key & | find (const Key &key) |
| Find a key, throwing if not found. | |
| const Key & | find (const Key &key) const |
| Const version of find() | |
| size_t | remove (const Key &key) |
| Remove a key from the set. | |
| Key | del (const Key &key) |
| Remove and return a key. | |
| const Key & | min () const |
| Return the minimum element (first in sorted order) | |
| const Key & | get_first () const |
| Alias for min() | |
| const Key & | max () const |
| Return the maximum element (last in sorted order) | |
| const Key & | get_last () const |
| Alias for max() | |
| DynSkipList | join (const DynSkipList &other) const |
| Compute the union of two sets. | |
| DynSkipList | intersect (const DynSkipList &other) const |
| Compute the intersection of two sets. | |
| DynSkipList | diff (const DynSkipList &other) const |
| Compute the difference of two sets. | |
| Iterator | begin () const noexcept |
| Iterator | end () const noexcept |
| Iterator | get_it () const noexcept |
| Alias for begin() - for generic programming. | |
| template<class Operation > | |
| bool | traverse (Operation &op) const |
| template<class Operation > | |
| bool | traverse (Operation &&op=Operation()) const |
| template<class Operation > | |
| void | for_each (Operation &op) const |
| template<class Operation > | |
| void | for_each (Operation &&op=Operation()) const |
| template<class Pred > | |
| bool | all (Pred &pred) const |
| template<class Pred > | |
| bool | all (Pred &&pred=Pred()) const |
| template<class Pred > | |
| bool | exists (Pred &pred) const |
| template<class Pred > | |
| bool | exists (Pred &&pred=Pred()) const |
| template<class Pred > | |
| bool | none (Pred &pred) const |
| template<class Pred > | |
| bool | none (Pred &&pred=Pred()) const |
| template<typename T > | |
| T | foldl (const T &init, std::function< T(const T &, const Key &)> op) const |
| template<typename T , class Operation > | |
| T | foldl (const T &init, Operation &op) const |
| template<typename T , class Operation > | |
| T | foldl (const T &init, Operation &&op) const |
Public Member Functions inherited from GenericTraverse< Container > | |
| template<class Operation > | |
| bool | traverse (Operation &operation) noexcept(traverse_is_noexcept< Operation >()) |
| Traverse the container via its iterator and performs a conditioned operation on each item. | |
| template<class Operation > | |
| bool | traverse (Operation &operation) const noexcept(traverse_is_noexcept< Operation >()) |
Const overload of traverse(Operation&). | |
| template<class Operation > | |
| bool | traverse (Operation &&operation) const noexcept(traverse_is_noexcept< Operation >()) |
Overload of traverse(Operation&) const that accepts rvalues. | |
| template<class Operation > | |
| bool | traverse (Operation &&operation) noexcept(traverse_is_noexcept< Operation >()) |
Overload of traverse(Operation&) that accepts rvalues. | |
Public Member Functions inherited from SpecialCtors< Container, T > | |
| SpecialCtors ()=default | |
| SpecialCtors (const SpecialCtors &)=default | |
| SpecialCtors (SpecialCtors &&) noexcept | |
| SpecialCtors & | operator= (const SpecialCtors &) |
| SpecialCtors & | operator= (SpecialCtors &&) noexcept |
| SpecialCtors (const Aleph::DynList< T > &l) | |
Build the container by inserting all items of list l. | |
| template<class It > | |
| SpecialCtors (It b, It e) | |
| Construct the container from a range of iterators. | |
| SpecialCtors (std::initializer_list< T > l) | |
| Construct the container from an initializer list. | |
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 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 Attributes | |
| static constexpr int | maxLevel = 32 |
| Maximum number of levels (supports up to 2^32 elements efficiently) | |
| static constexpr double | defaultProbability = 0.5 |
| Default probability for level generation (0.5 = geometric distribution) | |
Private Member Functions | |
| void | init (unsigned long seed) |
| int | random_level () const noexcept |
| bool | keys_equal (const Key &k1, const Key &k2) const noexcept |
Private Attributes | |
| Node * | header |
| gsl_rng * | r |
| size_t | num_nodes = 0 |
| int | current_level = 1 |
| double | probability |
| Compare | cmp |
Additional Inherited Members | |
Related Symbols inherited from FunctionalMethods< Container, T > | |
| each | |
| each | |
| each | |
Dynamic ordered set implemented with a Skip List.
DynSkipList<Key, Compare> is a dynamic set that automatically manages memory for its elements. It uses a Skip List as the underlying data structure, providing expected O(log n) time for search, insert, and delete operations.
The class internally uses the gsl random number generator of GSL - GNU Scientific Library. By default, the Mersenne twister is used and the seed is taken from system time.
| Key | Type of elements stored in the set. |
| Compare | Comparison functor (default: std::less<Key>). |
Definition at line 111 of file tpl_dynSkipList.H.
| using Aleph::DynSkipList< Key, Compare >::Item_Type = Key |
The type of element that stores the container.
Definition at line 125 of file tpl_dynSkipList.H.
| using Aleph::DynSkipList< Key, Compare >::Key_Type = Key |
The type of element that stores the container.
Definition at line 128 of file tpl_dynSkipList.H.
| using Aleph::DynSkipList< Key, Compare >::Set_Type = DynSkipList |
The type of container.
Definition at line 122 of file tpl_dynSkipList.H.
|
inline |
Construct a DynSkipList with given seed and probability.
| [in] | seed | Random seed for level generation. |
| [in] | p | Probability for level increase (default 0.5). |
Definition at line 213 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::header, Aleph::init, and Aleph::DynSkipList< Key, Compare >::maxLevel.
|
inlineexplicit |
Construct a DynSkipList with time-based seed.
| [in] | p | Probability for level increase (default 0.5). |
Definition at line 223 of file tpl_dynSkipList.H.
|
inline |
Definition at line 229 of file tpl_dynSkipList.H.
|
inline |
Definition at line 229 of file tpl_dynSkipList.H.
|
inline |
Definition at line 229 of file tpl_dynSkipList.H.
|
inline |
Copy constructor.
Definition at line 232 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::header, Aleph::init, Aleph::DynSkipList< Key, Compare >::insert(), FunctionalMethods< Container, T >::maps(), and Aleph::DynSkipList< Key, Compare >::maxLevel.
|
inlinenoexcept |
Move constructor.
Definition at line 248 of file tpl_dynSkipList.H.
References FunctionalMethods< Container, T >::maps(), and Aleph::DynSkipList< Key, Compare >::maxLevel.
|
inline |
Destructor - frees all nodes and GSL random number generator.
Definition at line 263 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::empty(), Aleph::DynSkipList< Key, Compare >::header, FunctionalMethods< Container, T >::maps(), and Aleph::DynSkipList< Key, Compare >::r.
|
inline |
Definition at line 848 of file tpl_dynSkipList.H.
References FunctionalMethods< Container, T >::maps(), and pred.
|
inline |
Definition at line 839 of file tpl_dynSkipList.H.
References StlAlephIterator< SetName >::begin(), FunctionalMethods< Container, T >::maps(), and pred.
|
inline |
Append method for Special_Ctors compatibility (aliases to insert)
Definition at line 466 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::insert(), and Aleph::DynSkipList< Key, Compare >::search().
|
inline |
Definition at line 474 of file tpl_dynSkipList.H.
References ah_domain_error_if, and Aleph::DynSkipList< Key, Compare >::insert().
|
inlinenoexcept |
Definition at line 800 of file tpl_dynSkipList.H.
|
inlinenoexcept |
Alias for empty() for STL compatibility.
Definition at line 344 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::empty().
|
inlinenoexcept |
Alias for has() for STL-like interface.
Definition at line 527 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::has().
|
inline |
Remove and return a key.
| [in] | key | The key to remove. |
| std::domain_error | If the key is not found. |
Definition at line 599 of file tpl_dynSkipList.H.
References ah_domain_error_if, Aleph::DynSkipList< Key, Compare >::cmp, Aleph::DynSkipList< Key, Compare >::current_level, Aleph::DynSkipList< Key, Compare >::Node::forward, Aleph::DynSkipList< Key, Compare >::header, Aleph::DynSkipList< Key, Compare >::Node::key, Aleph::DynSkipList< Key, Compare >::keys_equal(), FunctionalMethods< Container, T >::maps(), Aleph::DynSkipList< Key, Compare >::maxLevel, and Aleph::DynSkipList< Key, Compare >::num_nodes.
|
inline |
Compute the difference of two sets.
| [in] | other | The other set. |
Definition at line 694 of file tpl_dynSkipList.H.
References StlAlephIterator< SetName >::begin(), Aleph::DynSkipList< Key, Compare >::insert(), and FunctionalMethods< Container, T >::maps().
|
inlinenoexcept |
Remove all elements from the set.
After this call, the set is empty and size() returns 0.
Definition at line 328 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::current_level, Aleph::DynSkipList< Key, Compare >::Node::forward, Aleph::DynSkipList< Key, Compare >::header, Aleph::DynSkipList< Key, Compare >::maxLevel, Aleph::next(), and Aleph::DynSkipList< Key, Compare >::num_nodes.
Referenced by Aleph::DynSkipList< Key, Compare >::~DynSkipList(), Aleph::DynSkipList< Key, Compare >::clear(), Aleph::DynSkipList< Key, Compare >::operator=(), and Aleph::DynSkipList< Key, Compare >::operator=().
|
inlinenoexcept |
Definition at line 801 of file tpl_dynSkipList.H.
|
inlinenoexcept |
Alias for has()
Definition at line 530 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::has().
|
inline |
Definition at line 863 of file tpl_dynSkipList.H.
References FunctionalMethods< Container, T >::maps(), and pred.
|
inline |
Definition at line 854 of file tpl_dynSkipList.H.
References StlAlephIterator< SetName >::begin(), and pred.
Referenced by Aleph::DynSkipList< Key, Compare >::none().
|
inline |
Find a key, throwing if not found.
| [in] | key | The key to find. |
| std::domain_error | If the key is not found. |
Definition at line 538 of file tpl_dynSkipList.H.
References ah_domain_error_if, and Aleph::DynSkipList< Key, Compare >::search().
|
inline |
Const version of find()
Definition at line 547 of file tpl_dynSkipList.H.
References ah_domain_error_if, and Aleph::DynSkipList< Key, Compare >::search().
|
inline |
Definition at line 899 of file tpl_dynSkipList.H.
References Aleph::init, and FunctionalMethods< Container, T >::maps().
|
inline |
Definition at line 890 of file tpl_dynSkipList.H.
References StlAlephIterator< SetName >::begin(), Aleph::init, and FunctionalMethods< Container, T >::maps().
|
inline |
Definition at line 881 of file tpl_dynSkipList.H.
References StlAlephIterator< SetName >::begin(), Aleph::init, and FunctionalMethods< Container, T >::maps().
|
inline |
Definition at line 833 of file tpl_dynSkipList.H.
References FunctionalMethods< Container, T >::maps().
|
inline |
Definition at line 826 of file tpl_dynSkipList.H.
References StlAlephIterator< SetName >::begin().
|
inlinenoexcept |
Get the comparison functor (const version)
Definition at line 356 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::cmp.
|
inlinenoexcept |
Get the comparison functor.
Definition at line 353 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::cmp.
|
inline |
Alias for min()
Definition at line 642 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::min().
|
inlinenoexcept |
Alias for begin() - for generic programming.
Definition at line 804 of file tpl_dynSkipList.H.
References StlAlephIterator< SetName >::begin().
Referenced by demonstrate_basic_operations(), and demonstrate_string_set().
|
inline |
Alias for max()
Definition at line 656 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::max().
|
inlinenoexcept |
Get a pointer to the GSL random number generator.
Definition at line 207 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::r.
|
inlinenoexcept |
Return true if the key exists in the set.
Definition at line 521 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::search().
Referenced by benchmark_comparison(), Aleph::DynSkipList< Key, Compare >::contains(), demonstrate_basic_operations(), demonstrate_string_set(), and Aleph::DynSkipList< Key, Compare >::exist().
|
inlineprivate |
Definition at line 180 of file tpl_dynSkipList.H.
References ah_bad_alloc_if, FunctionalMethods< Container, T >::maps(), and Aleph::DynSkipList< Key, Compare >::r.
|
inline |
Insert an element into the set.
If the key already exists, the insertion fails and nullptr is returned.
| [in] | key | The key to insert. |
| std::bad_alloc | If memory allocation fails. |
Definition at line 366 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::cmp, Aleph::DynSkipList< Key, Compare >::current_level, Aleph::DynSkipList< Key, Compare >::Node::forward, Aleph::DynSkipList< Key, Compare >::header, Aleph::DynSkipList< Key, Compare >::Node::key, Aleph::DynSkipList< Key, Compare >::keys_equal(), FunctionalMethods< Container, T >::maps(), Aleph::DynSkipList< Key, Compare >::maxLevel, Aleph::DynSkipList< Key, Compare >::num_nodes, and Aleph::DynSkipList< Key, Compare >::random_level().
Referenced by Aleph::DynSkipList< Key, Compare >::DynSkipList(), Aleph::DynSkipList< Key, Compare >::append(), Aleph::DynSkipList< Key, Compare >::append(), benchmark_comparison(), benchmark_skip_list(), demonstrate_basic_operations(), demonstrate_string_set(), Aleph::DynSkipList< Key, Compare >::diff(), Aleph::DynSkipList< Key, Compare >::insert_unique(), Aleph::DynSkipList< Key, Compare >::intersect(), Aleph::DynSkipList< Key, Compare >::join(), Aleph::DynSkipList< Key, Compare >::operator=(), and Aleph::DynSkipList< Key, Compare >::search_or_insert().
|
inline |
Insert an element into the set (move version).
| [in] | key | The key to insert (moved). |
| std::bad_alloc | If memory allocation fails. |
Definition at line 412 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::cmp, Aleph::DynSkipList< Key, Compare >::current_level, Aleph::DynSkipList< Key, Compare >::Node::forward, Aleph::DynSkipList< Key, Compare >::header, Aleph::DynSkipList< Key, Compare >::Node::key, Aleph::DynSkipList< Key, Compare >::keys_equal(), FunctionalMethods< Container, T >::maps(), Aleph::DynSkipList< Key, Compare >::maxLevel, Aleph::DynSkipList< Key, Compare >::num_nodes, and Aleph::DynSkipList< Key, Compare >::random_level().
|
inline |
Insert an element, throwing if it already exists.
| [in] | key | The key to insert. |
| std::domain_error | If the key already exists. |
| std::bad_alloc | If memory allocation fails. |
Definition at line 457 of file tpl_dynSkipList.H.
References ah_domain_error_if, and Aleph::DynSkipList< Key, Compare >::insert().
|
inline |
Compute the intersection of two sets.
| [in] | other | The other set. |
Definition at line 680 of file tpl_dynSkipList.H.
References StlAlephIterator< SetName >::begin(), Aleph::DynSkipList< Key, Compare >::insert(), and FunctionalMethods< Container, T >::maps().
|
inlinenoexcept |
Return true if the set is empty.
Definition at line 350 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::num_nodes.
Referenced by Aleph::DynSkipList< Key, Compare >::max(), and Aleph::DynSkipList< Key, Compare >::min().
|
inline |
Compute the union of two sets.
| [in] | other | The other set. |
Definition at line 667 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::insert(), and FunctionalMethods< Container, T >::maps().
|
inlineprivatenoexcept |
Definition at line 196 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::cmp, and FunctionalMethods< Container, T >::maps().
Referenced by Aleph::DynSkipList< Key, Compare >::del(), Aleph::DynSkipList< Key, Compare >::insert(), Aleph::DynSkipList< Key, Compare >::insert(), Aleph::DynSkipList< Key, Compare >::remove(), and Aleph::DynSkipList< Key, Compare >::search().
|
inline |
Return the maximum element (last in sorted order)
Definition at line 645 of file tpl_dynSkipList.H.
References ah_domain_error_if, Aleph::DynSkipList< Key, Compare >::Node::forward, Aleph::DynSkipList< Key, Compare >::header, Aleph::DynSkipList< Key, Compare >::is_empty(), and Aleph::DynSkipList< Key, Compare >::Node::key.
Referenced by Aleph::DynSkipList< Key, Compare >::get_last().
|
inline |
Return the minimum element (first in sorted order)
Definition at line 635 of file tpl_dynSkipList.H.
References ah_domain_error_if, Aleph::DynSkipList< Key, Compare >::Node::forward, Aleph::DynSkipList< Key, Compare >::header, Aleph::DynSkipList< Key, Compare >::is_empty(), and Aleph::DynSkipList< Key, Compare >::Node::key.
Referenced by Aleph::DynSkipList< Key, Compare >::get_first().
|
inline |
Definition at line 875 of file tpl_dynSkipList.H.
References FunctionalMethods< Container, T >::maps(), and pred.
|
inline |
Definition at line 869 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::exists(), FunctionalMethods< Container, T >::maps(), and pred.
|
inline |
Copy assignment operator.
Definition at line 272 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::cmp, Aleph::DynSkipList< Key, Compare >::empty(), Aleph::DynSkipList< Key, Compare >::insert(), FunctionalMethods< Container, T >::maps(), and Aleph::DynSkipList< Key, Compare >::probability.
|
inlinenoexcept |
Move assignment operator.
Definition at line 289 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::cmp, Aleph::DynSkipList< Key, Compare >::current_level, Aleph::DynSkipList< Key, Compare >::empty(), Aleph::DynSkipList< Key, Compare >::header, FunctionalMethods< Container, T >::maps(), Aleph::DynSkipList< Key, Compare >::maxLevel, Aleph::DynSkipList< Key, Compare >::num_nodes, Aleph::DynSkipList< Key, Compare >::probability, and Aleph::DynSkipList< Key, Compare >::r.
|
inlineprivatenoexcept |
Definition at line 187 of file tpl_dynSkipList.H.
References FunctionalMethods< Container, T >::maps(), Aleph::DynSkipList< Key, Compare >::maxLevel, Aleph::DynSkipList< Key, Compare >::probability, and Aleph::DynSkipList< Key, Compare >::r.
Referenced by Aleph::DynSkipList< Key, Compare >::insert(), and Aleph::DynSkipList< Key, Compare >::insert().
|
inline |
Remove a key from the set.
| [in] | key | The key to remove. |
Definition at line 560 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::cmp, Aleph::DynSkipList< Key, Compare >::current_level, Aleph::DynSkipList< Key, Compare >::Node::forward, Aleph::DynSkipList< Key, Compare >::header, Aleph::DynSkipList< Key, Compare >::Node::key, Aleph::DynSkipList< Key, Compare >::keys_equal(), FunctionalMethods< Container, T >::maps(), Aleph::DynSkipList< Key, Compare >::maxLevel, and Aleph::DynSkipList< Key, Compare >::num_nodes.
Referenced by benchmark_skip_list(), and demonstrate_basic_operations().
|
inlinenoexcept |
Search for a key in the set.
| [in] | key | The key to search for. |
Definition at line 504 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::cmp, Aleph::DynSkipList< Key, Compare >::current_level, Aleph::DynSkipList< Key, Compare >::Node::forward, Aleph::DynSkipList< Key, Compare >::header, Aleph::DynSkipList< Key, Compare >::Node::key, Aleph::DynSkipList< Key, Compare >::keys_equal(), and FunctionalMethods< Container, T >::maps().
Referenced by Aleph::DynSkipList< Key, Compare >::append(), benchmark_skip_list(), demonstrate_basic_operations(), Aleph::DynSkipList< Key, Compare >::find(), Aleph::DynSkipList< Key, Compare >::find(), Aleph::DynSkipList< Key, Compare >::has(), and Aleph::DynSkipList< Key, Compare >::search_or_insert().
|
inline |
Search and insert if not found.
| [in] | key | The key to search/insert. |
Definition at line 491 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::insert(), FunctionalMethods< Container, T >::maps(), and Aleph::DynSkipList< Key, Compare >::search().
|
inlinenoexcept |
Set the random number generator seed.
Definition at line 204 of file tpl_dynSkipList.H.
References FunctionalMethods< Container, T >::maps(), and Aleph::DynSkipList< Key, Compare >::r.
|
inlinenoexcept |
Return the number of elements in the set.
Definition at line 347 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::num_nodes.
Referenced by benchmark_comparison(), and demonstrate_basic_operations().
|
inlinenoexcept |
Swap contents with another DynSkipList.
Definition at line 315 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::cmp, Aleph::DynSkipList< Key, Compare >::current_level, Aleph::DynSkipList< Key, Compare >::header, FunctionalMethods< Container, T >::maps(), Aleph::DynSkipList< Key, Compare >::num_nodes, Aleph::DynSkipList< Key, Compare >::probability, and Aleph::DynSkipList< Key, Compare >::r.
|
inline |
Definition at line 820 of file tpl_dynSkipList.H.
References FunctionalMethods< Container, T >::maps().
|
inline |
Definition at line 811 of file tpl_dynSkipList.H.
References StlAlephIterator< SetName >::begin(), and FunctionalMethods< Container, T >::maps().
|
private |
Definition at line 178 of file tpl_dynSkipList.H.
Referenced by Aleph::DynSkipList< Key, Compare >::del(), Aleph::DynSkipList< Key, Compare >::get_compare(), Aleph::DynSkipList< Key, Compare >::get_compare(), Aleph::DynSkipList< Key, Compare >::insert(), Aleph::DynSkipList< Key, Compare >::insert(), Aleph::DynSkipList< Key, Compare >::keys_equal(), Aleph::DynSkipList< Key, Compare >::operator=(), Aleph::DynSkipList< Key, Compare >::operator=(), Aleph::DynSkipList< Key, Compare >::remove(), Aleph::DynSkipList< Key, Compare >::search(), and Aleph::DynSkipList< Key, Compare >::swap().
|
private |
Definition at line 176 of file tpl_dynSkipList.H.
Referenced by Aleph::DynSkipList< Key, Compare >::del(), Aleph::DynSkipList< Key, Compare >::empty(), Aleph::DynSkipList< Key, Compare >::insert(), Aleph::DynSkipList< Key, Compare >::insert(), Aleph::DynSkipList< Key, Compare >::operator=(), Aleph::DynSkipList< Key, Compare >::remove(), Aleph::DynSkipList< Key, Compare >::search(), and Aleph::DynSkipList< Key, Compare >::swap().
|
staticconstexpr |
Default probability for level generation (0.5 = geometric distribution)
Definition at line 134 of file tpl_dynSkipList.H.
|
private |
Definition at line 173 of file tpl_dynSkipList.H.
Referenced by Aleph::DynSkipList< Key, Compare >::DynSkipList(), Aleph::DynSkipList< Key, Compare >::DynSkipList(), Aleph::DynSkipList< Key, Compare >::~DynSkipList(), Aleph::DynSkipList< Key, Compare >::del(), Aleph::DynSkipList< Key, Compare >::empty(), Aleph::DynSkipList< Key, Compare >::insert(), Aleph::DynSkipList< Key, Compare >::insert(), Aleph::DynSkipList< Key, Compare >::max(), Aleph::DynSkipList< Key, Compare >::min(), Aleph::DynSkipList< Key, Compare >::operator=(), Aleph::DynSkipList< Key, Compare >::remove(), Aleph::DynSkipList< Key, Compare >::Iterator::reset_first(), Aleph::DynSkipList< Key, Compare >::search(), and Aleph::DynSkipList< Key, Compare >::swap().
|
staticconstexpr |
Maximum number of levels (supports up to 2^32 elements efficiently)
Definition at line 131 of file tpl_dynSkipList.H.
Referenced by Aleph::DynSkipList< Key, Compare >::DynSkipList(), Aleph::DynSkipList< Key, Compare >::DynSkipList(), Aleph::DynSkipList< Key, Compare >::DynSkipList(), Aleph::DynSkipList< Key, Compare >::del(), Aleph::DynSkipList< Key, Compare >::empty(), Aleph::DynSkipList< Key, Compare >::insert(), Aleph::DynSkipList< Key, Compare >::insert(), Aleph::DynSkipList< Key, Compare >::operator=(), Aleph::DynSkipList< Key, Compare >::random_level(), and Aleph::DynSkipList< Key, Compare >::remove().
|
private |
Definition at line 175 of file tpl_dynSkipList.H.
Referenced by Aleph::DynSkipList< Key, Compare >::del(), Aleph::DynSkipList< Key, Compare >::empty(), Aleph::DynSkipList< Key, Compare >::insert(), Aleph::DynSkipList< Key, Compare >::insert(), Aleph::DynSkipList< Key, Compare >::is_empty(), Aleph::DynSkipList< Key, Compare >::operator=(), Aleph::DynSkipList< Key, Compare >::remove(), Aleph::DynSkipList< Key, Compare >::size(), and Aleph::DynSkipList< Key, Compare >::swap().
|
private |
Definition at line 177 of file tpl_dynSkipList.H.
Referenced by Aleph::DynSkipList< Key, Compare >::operator=(), Aleph::DynSkipList< Key, Compare >::operator=(), Aleph::DynSkipList< Key, Compare >::random_level(), and Aleph::DynSkipList< Key, Compare >::swap().
|
private |
Definition at line 174 of file tpl_dynSkipList.H.
Referenced by Aleph::DynSkipList< Key, Compare >::~DynSkipList(), Aleph::DynSkipList< Key, Compare >::gsl_rng_object(), Aleph::DynSkipList< Key, Compare >::init(), Aleph::DynSkipList< Key, Compare >::operator=(), Aleph::DynSkipList< Key, Compare >::random_level(), Aleph::DynSkipList< Key, Compare >::set_seed(), and Aleph::DynSkipList< Key, Compare >::swap().