|
Aleph-w 7.10.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) |
Seeds the Mersenne Twister of the list, as gsl_rng_set() did: the levels are from then on those of GSL for the seed. | |
| Random_Source & | random_source () noexcept |
| The source of random numbers, which draws the levels. | |
| const Random_Source & | random_source () const noexcept |
| The source of random numbers, to look at it: its engine, or whether it is equal to another one. | |
| Gsl_Compatible_Rng & | rng () |
| The Mersenne Twister of the list, which a list that was given no seed makes here, and draws from it from then on. | |
| DynSkipList (unsigned long seed, double p=defaultProbability) | |
| Construct a DynSkipList with given seed and probability, whose levels are those of GSL for the seed: it draws them from a Mersenne Twister, in dynamic memory. | |
| DynSkipList (double p=defaultProbability) | |
| Construct a DynSkipList that draws its levels from a SplitMix64 with a seed of its own. | |
| template<template< typename > class List> | |
| DynSkipList (const List< Key > &l) | |
| template<class It > requires (not std::is_arithmetic_v<It> and requires (It it) { *it; ++it; it != it; }) | |
| DynSkipList (It b, It e) | |
| DynSkipList (std::initializer_list< Key > l) | |
| DynSkipList (const DynSkipList &other) | |
| Copy constructor: the copy draws the levels of its nodes from a SplitMix64 with a seed of its own, whatever the generator of the list that it copies. | |
| DynSkipList (DynSkipList &&other) | |
| Move constructor: take the nodes, the generator and the comparison criterion of another list, which is left empty, and draws from then on from a SplitMix64 with a seed of its own, as a copy does. | |
| ~DynSkipList () | |
| Destructor - frees all nodes and the random number generator. | |
| DynSkipList & | operator= (const DynSkipList &other) |
| Copy assignment operator. | |
| DynSkipList & | operator= (DynSkipList &&other) noexcept(noexcept(swap(other))) |
| Move assignment: free the nodes of this list, and exchange it with another, which is left empty with the generator of this one. | |
| void | swap (DynSkipList &other) noexcept(std::is_nothrow_swappable_v< Compare >) |
| Swap contents with another DynSkipList. | |
| void | empty () noexcept |
| Remove all elements from the set. | |
| void | clear () noexcept |
| Empties the container. | |
| 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) |
See append(const Key & key). | |
| Key * | search_or_insert (const Key &key) |
| Search and insert if not found. | |
| const Key * | search (const Key &key) const noexcept |
| Search for a key in the set. | |
| Key * | search (const Key &key) noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The same key, modifiable. | |
| bool | has (const Key &key) const noexcept |
| Return true if the key exists in the set. | |
| bool | contains (const Key &key) const noexcept |
| Checks if a key exists in the set. | |
| 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 > requires Aleph::PredicateWith<Operation &, const Key &> | |
| bool | traverse (Operation &op) const noexcept(Aleph::NothrowPredicateWith< Operation &, const Key & >) |
| Traverse the keys in increasing order. | |
| template<class Operation > requires Aleph::PredicateWith<Operation &, const Key &> | |
| bool | traverse (Operation &&op=Operation()) const noexcept(Aleph::NothrowPredicateWith< Operation &, const Key & >) |
See traverse(Operation & op) const. | |
Public Member Functions inherited from GenericTraverse< Container > | |
| template<class Operation > requires Aleph::PredicateWith<Operation &, typename Aleph::concepts_detail::traverse_arg<Container, Operation>::type> | |
| bool | traverse (Operation &operation) noexcept(traverse_is_noexcept< Operation, typename Aleph::concepts_detail::traverse_arg< Container, Operation >::type, Container & >()) |
| Traverse the container via its iterator and performs a conditioned operation on each item. | |
| template<class Operation > requires Aleph::PredicateWith<Operation &, typename Aleph::concepts_detail::traverse_carg<Container, Operation>::type> | |
| bool | traverse (Operation &operation) const noexcept(traverse_is_noexcept< Operation, typename Aleph::concepts_detail::traverse_carg< Container, Operation >::type, const_source_t< Operation > >()) |
| Traverse a constant container; each item is handed out as a constant reference. | |
| template<class Operation > requires Aleph::PredicateWith<Operation &, typename Aleph::concepts_detail::traverse_carg<Container, Operation>::type> | |
| bool | traverse (Operation &&operation) const noexcept(traverse_is_noexcept< Operation, typename Aleph::concepts_detail::traverse_carg< Container, Operation >::type, const_source_t< Operation > >()) |
Overload of traverse(Operation &) const that accepts rvalues. | |
| template<class Operation > requires Aleph::PredicateWith<Operation &, typename Aleph::concepts_detail::traverse_arg<Container, Operation>::type> | |
| bool | traverse (Operation &&operation) noexcept(traverse_is_noexcept< Operation, typename Aleph::concepts_detail::traverse_arg< Container, Operation >::type, Container & >()) |
Overload of traverse(Operation &) that accepts rvalues. | |
Public Member Functions inherited from SpecialCtors< Container, T > | |
| SpecialCtors ()=default | |
| Default constructor; it appends nothing. | |
| SpecialCtors (const SpecialCtors &)=default | |
| Copy constructor; the derived container copies its items. | |
| SpecialCtors (SpecialCtors &&) noexcept | |
| Move constructor; the derived container moves its items. | |
| SpecialCtors & | operator= (const SpecialCtors &)=default |
| Copy assignment; the derived container copies its items. | |
| SpecialCtors & | operator= (SpecialCtors &&) noexcept |
| Move assignment; the derived container moves its items. | |
| SpecialCtors (const Aleph::DynList< T > &l) | |
Build the container by inserting all items of the list l. | |
| template<class It > requires (not std::is_arithmetic_v<It> and requires(It it) { *it; ++it; it != 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 () |
| 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 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 | |
| int | random_level () const noexcept |
| bool | keys_equal (const Key &k1, const Key &k2) const noexcept |
| DynSkipList (const double p, const Compare &c) | |
| DynSkipList (const double p, Compare &&c) | |
| void | swap_but_comparison (DynSkipList &other) noexcept |
Static Private Member Functions | |
| static unsigned long | generator_seed (const unsigned long seed) noexcept |
| static decltype(auto) | comparison_to_take (Compare &c) noexcept |
Private Attributes | |
| Node * | header |
| Random_Source | r |
| size_t | num_nodes = 0 |
| int | current_level = 1 |
| double | probability |
| Compare | cmp |
Additional Inherited Members | |
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. | |
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. | |
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 levels come from a Random_Source: by default, from a SplitMix64 inside the list, with a seed of its own; with a seed, that of a constructor or of set_seed(), from a Gsl_Compatible_Rng, the Mersenne twister with the numbers of the one of GSL - GNU Scientific Library, which it used before: for a seed, the levels are the same. random_source() gives the source, which can be asked for a SplitMix64 with a seed.
| Key | Type of elements stored in the set. |
| Compare | Comparison functor (default: std::less<Key>). |
std::vector copies these objects instead of moving them: their move constructor is not noexcept, because it leaves the source empty and usable, which allocates its header, and std::vector moves only what cannot throw. The containers of Aleph do not copy them to grow: Array moves its items, and DynList and DynArray never relocate them. Definition at line 122 of file tpl_dynSkipList.H.
| using Aleph::DynSkipList< Key, Compare >::Item_Type = Key |
The type of element that stores the container.
Definition at line 136 of file tpl_dynSkipList.H.
| using Aleph::DynSkipList< Key, Compare >::Key_Type = Key |
The type of element that stores the container.
Definition at line 139 of file tpl_dynSkipList.H.
| using Aleph::DynSkipList< Key, Compare >::Set_Type = DynSkipList |
The type of container.
Definition at line 133 of file tpl_dynSkipList.H.
|
inlineprivate |
Definition at line 214 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::header, and Aleph::DynSkipList< Key, Compare >::maxLevel.
|
inlineprivate |
Definition at line 221 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::header, and Aleph::DynSkipList< Key, Compare >::maxLevel.
|
inline |
Construct a DynSkipList with given seed and probability, whose levels are those of GSL for the seed: it draws them from a Mersenne Twister, in dynamic memory.
| [in] | seed | Random seed for level generation, taken modulo 2^32 - 1, as it was for GSL. |
| [in] | p | Probability for level increase (default 0.5); it must be strictly between 0 and 1. |
| domain_error | if p is not in (0, 1): with p >= 1 every node would get the maximum level, and with p <= 0 every node level 1; in both cases searches degrade to linear time. |
| bad_alloc | if there is not enough memory. |
Definition at line 308 of file tpl_dynSkipList.H.
References ah_domain_error_if, FunctionalMethods< Container, T >::and, Aleph::DynSkipList< Key, Compare >::header, and Aleph::DynSkipList< Key, Compare >::maxLevel.
|
inlineexplicit |
Construct a DynSkipList that draws its levels from a SplitMix64 with a seed of its own.
| [in] | p | Probability for level increase (default 0.5); it must be strictly between 0 and 1. |
| domain_error | if p is not in (0, 1), as the constructor with a seed. |
| bad_alloc | if there is not enough memory for the header. |
Definition at line 324 of file tpl_dynSkipList.H.
References ah_domain_error_if, FunctionalMethods< Container, T >::and, Aleph::DynSkipList< Key, Compare >::header, and Aleph::DynSkipList< Key, Compare >::maxLevel.
|
inline |
Definition at line 332 of file tpl_dynSkipList.H.
|
inline |
Definition at line 332 of file tpl_dynSkipList.H.
|
inline |
Definition at line 332 of file tpl_dynSkipList.H.
|
inline |
Copy constructor: the copy draws the levels of its nodes from a SplitMix64 with a seed of its own, whatever the generator of the list that it copies.
| [in] | other | the list to copy. |
| bad_alloc | if there is not enough memory, or what the copy of a key throws; then the copy frees what it took. |
Definition at line 341 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::begin(), Aleph::DynSkipList< Key, Compare >::empty(), Aleph::DynSkipList< Key, Compare >::header, Aleph::DynSkipList< Key, Compare >::insert(), and Aleph::DynSkipList< Key, Compare >::maxLevel.
|
inline |
Move constructor: take the nodes, the generator and the comparison criterion of another list, which is left empty, and draws from then on from a SplitMix64 with a seed of its own, as a copy does.
The comparison criterion is copied, if it can be copied, so that other keeps its own; else it is moved, and other is left with one moved from.
| [in,out] | other | the list to move from. |
| bad_alloc | if there is not enough memory for the header left to other, or what the copy or the move of the comparison criterion throws; then other is unchanged, but for a comparison criterion that was moved. |
other, and no generator. Definition at line 382 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::swap_but_comparison().
|
inline |
Destructor - frees all nodes and the random number generator.
Definition at line 391 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::empty(), and Aleph::DynSkipList< Key, Compare >::header.
|
inline |
Append method for Special_Ctors compatibility (aliases to insert)
Definition at line 599 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::insert(), and Aleph::DynSkipList< Key, Compare >::search().
|
inline |
See append(const Key & key).
Definition at line 608 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::insert(), and Aleph::DynSkipList< Key, Compare >::search().
|
inlinenoexcept |
Definition at line 939 of file tpl_dynSkipList.H.
Referenced by Aleph::DynSkipList< Key, Compare >::DynSkipList(), Aleph::DynSkipList< Key, Compare >::diff(), Aleph::DynSkipList< Key, Compare >::get_it(), Aleph::DynSkipList< Key, Compare >::intersect(), Aleph::DynSkipList< Key, Compare >::join(), Aleph::DynSkipList< Key, Compare >::operator=(), and Aleph::DynSkipList< Key, Compare >::traverse().
|
inlinenoexcept |
Empties the container.
| none |
Definition at line 477 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::empty().
|
inlinestaticprivatenoexcept |
Definition at line 229 of file tpl_dynSkipList.H.
|
inlinenoexcept |
Checks if a key exists in the set.
| [in] | key | key to search for. |
| none |
Definition at line 672 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 744 of file tpl_dynSkipList.H.
References ah_domain_error_if, FunctionalMethods< Container, T >::and, 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(), 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 839 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::begin(), Aleph::DynSkipList< Key, Compare >::has(), Aleph::DynSkipList< Key, Compare >::Iterator::has_curr(), and Aleph::DynSkipList< Key, Compare >::insert().
|
inlinenoexcept |
Remove all elements from the set.
After this call, the set is empty and size() returns 0.
Definition at line 457 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 >::~DynSkipList(), Aleph::DynSkipList< Key, Compare >::clear(), Aleph::DynSkipList< Key, Compare >::operator=(), and Aleph::DynSkipList< Key, Compare >::operator=().
|
inlinenoexcept |
Definition at line 940 of file tpl_dynSkipList.H.
|
inlinenoexcept |
Alias for has()
Definition at line 675 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::has().
|
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 683 of file tpl_dynSkipList.H.
References ah_domain_error_if, and Aleph::DynSkipList< Key, Compare >::search().
|
inline |
Const version of find()
Definition at line 692 of file tpl_dynSkipList.H.
References ah_domain_error_if, and Aleph::DynSkipList< Key, Compare >::search().
|
inlinestaticprivatenoexcept |
Definition at line 192 of file tpl_dynSkipList.H.
References Aleph::Gsl_Compatible_Rng::max(), and seed.
|
inlinenoexcept |
Get the comparison functor (const version)
Definition at line 489 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::cmp.
|
inlinenoexcept |
Get the comparison functor.
Definition at line 486 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::cmp.
|
inline |
Alias for min()
Definition at line 787 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::min().
|
inlinenoexcept |
Alias for begin() - for generic programming.
Definition at line 943 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::begin().
Referenced by demonstrate_basic_operations(), and demonstrate_string_set().
|
inline |
Alias for max()
Definition at line 801 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::max().
|
inlinenoexcept |
Return true if the key exists in the set.
Definition at line 661 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(), Aleph::DynSkipList< Key, Compare >::diff(), Aleph::DynSkipList< Key, Compare >::exist(), and Aleph::DynSkipList< Key, Compare >::intersect().
|
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 499 of file tpl_dynSkipList.H.
References FunctionalMethods< Container, T >::and, 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(), 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_functional(), 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=(), Aleph::DynSkipList< Key, Compare >::search_or_insert(), TEST(), and TEST().
|
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 545 of file tpl_dynSkipList.H.
References FunctionalMethods< Container, T >::and, 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(), 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 590 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 825 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::begin(), Aleph::DynSkipList< Key, Compare >::has(), Aleph::DynSkipList< Key, Compare >::Iterator::has_curr(), and Aleph::DynSkipList< Key, Compare >::insert().
|
inlinenoexcept |
Return true if the set is empty.
Definition at line 483 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::num_nodes.
Referenced by Aleph::DynSkipList< Key, Compare >::max(), Aleph::DynSkipList< Key, Compare >::min(), and TEST().
|
inline |
Compute the union of two sets.
| [in] | other | The other set. |
Definition at line 812 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::begin(), and Aleph::DynSkipList< Key, Compare >::insert().
|
inlineprivatenoexcept |
Definition at line 206 of file tpl_dynSkipList.H.
References FunctionalMethods< Container, T >::and, and Aleph::DynSkipList< Key, Compare >::cmp.
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 790 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 780 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 |
Copy assignment operator.
Definition at line 398 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::begin(), Aleph::DynSkipList< Key, Compare >::cmp, Aleph::DynSkipList< Key, Compare >::empty(), Aleph::DynSkipList< Key, Compare >::insert(), and Aleph::DynSkipList< Key, Compare >::probability.
|
inlinenoexcept |
Move assignment: free the nodes of this list, and exchange it with another, which is left empty with the generator of this one.
The previous assignment took the generator of other, which then drew levels from a null one. The nodes of this list are freed, as they were, so that other is left empty.
| [in,out] | other | the list to move from. |
| what | swapping the comparisons throws; then this list is left empty, and other keeps its nodes. |
Definition at line 428 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::empty(), and Aleph::DynSkipList< Key, Compare >::swap().
|
inlineprivatenoexcept |
Definition at line 197 of file tpl_dynSkipList.H.
References FunctionalMethods< Container, T >::and, Aleph::DynSkipList< Key, Compare >::maxLevel, Aleph::DynSkipList< Key, Compare >::probability, Aleph::DynSkipList< Key, Compare >::r, and Aleph::Random_Source::uniform().
Referenced by Aleph::DynSkipList< Key, Compare >::insert(), and Aleph::DynSkipList< Key, Compare >::insert().
|
inlinenoexcept |
The source of random numbers, to look at it: its engine, or whether it is equal to another one.
Definition at line 268 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::r.
|
inlinenoexcept |
The source of random numbers, which draws the levels.
Definition at line 264 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::r.
|
inline |
Remove a key from the set.
| [in] | key | The key to remove. |
Definition at line 705 of file tpl_dynSkipList.H.
References FunctionalMethods< Container, T >::and, 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(), Aleph::DynSkipList< Key, Compare >::maxLevel, and Aleph::DynSkipList< Key, Compare >::num_nodes.
Referenced by benchmark_skip_list(), and demonstrate_basic_operations().
|
inline |
The Mersenne Twister of the list, which a list that was given no seed makes here, and draws from it from then on.
| std::bad_alloc | If the list has no Mersenne Twister and there is not enough memory for it. |
Definition at line 281 of file tpl_dynSkipList.H.
References Aleph::Random_Source::mersenne_twister(), and Aleph::DynSkipList< Key, Compare >::r.
Referenced by TEST().
|
inlinenoexcept |
Search for a key in the set.
| [in] | key | The key to search for. |
Definition at line 637 of file tpl_dynSkipList.H.
References FunctionalMethods< Container, T >::and, 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, and Aleph::DynSkipList< Key, Compare >::keys_equal().
Referenced by Aleph::DynSkipList< Key, Compare >::append(), 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().
|
inlinenoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The same key, modifiable.
Definition at line 655 of file tpl_dynSkipList.H.
|
inline |
Search and insert if not found.
| [in] | key | The key to search/insert. |
Definition at line 624 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::insert(), and Aleph::DynSkipList< Key, Compare >::search().
|
inline |
Seeds the Mersenne Twister of the list, as gsl_rng_set() did: the levels are from then on those of GSL for the seed.
A list that was given no seed makes its Mersenne Twister here.
| [in] | seed | The seed. |
| std::bad_alloc | If the list has no Mersenne Twister and there is not enough memory for it; then it is unchanged. |
Definition at line 258 of file tpl_dynSkipList.H.
References Aleph::Random_Source::Mersenne_Twister, Aleph::DynSkipList< Key, Compare >::r, Aleph::Random_Source::seed(), and seed.
|
inlinenoexcept |
Return the number of elements in the set.
Definition at line 480 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.
| [in,out] | other | the list to exchange with. |
| what | swapping the comparisons throws. They are exchanged first, so that, if that swap throws, nothing else is exchanged, and both lists are left as they were if it left its arguments as they were. |
Definition at line 445 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::cmp, Aleph::DynSkipList< Key, Compare >::swap(), and Aleph::DynSkipList< Key, Compare >::swap_but_comparison().
Referenced by Aleph::DynSkipList< Key, Compare >::operator=(), and Aleph::DynSkipList< Key, Compare >::swap().
|
inlineprivatenoexcept |
Definition at line 238 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::current_level, Aleph::DynSkipList< Key, Compare >::header, Aleph::DynSkipList< Key, Compare >::num_nodes, Aleph::DynSkipList< Key, Compare >::probability, Aleph::DynSkipList< Key, Compare >::r, and Aleph::Random_Source::swap().
Referenced by Aleph::DynSkipList< Key, Compare >::DynSkipList(), and Aleph::DynSkipList< Key, Compare >::swap().
|
inlinenoexcept |
See traverse(Operation & op) const.
Definition at line 975 of file tpl_dynSkipList.H.
|
inlinenoexcept |
Traverse the keys in increasing order.
The keys of a skip list are kept sorted and must not be modified, so every traversal hands them out as constant references; the members inherited from FunctionalMethods (for_each(), all(), exists(), none(), foldl(), ...) are built on it.
| [in] | op | operation with signature bool(const Key &); the traversal stops when it returns false. |
true if all keys were visited; false otherwise. | anything | that op throws. |
Definition at line 963 of file tpl_dynSkipList.H.
References Aleph::DynSkipList< Key, Compare >::begin(), and Aleph::DynSkipList< Key, Compare >::Iterator::has_curr().
|
private |
Definition at line 189 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 >::remove(), Aleph::DynSkipList< Key, Compare >::search(), and Aleph::DynSkipList< Key, Compare >::swap().
|
private |
Definition at line 187 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 >::remove(), Aleph::DynSkipList< Key, Compare >::search(), and Aleph::DynSkipList< Key, Compare >::swap_but_comparison().
|
staticconstexpr |
Default probability for level generation (0.5 = geometric distribution)
Definition at line 145 of file tpl_dynSkipList.H.
|
private |
Definition at line 184 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 >::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 >::remove(), Aleph::DynSkipList< Key, Compare >::Iterator::reset_first(), Aleph::DynSkipList< Key, Compare >::search(), and Aleph::DynSkipList< Key, Compare >::swap_but_comparison().
|
staticconstexpr |
Maximum number of levels (supports up to 2^32 elements efficiently)
Definition at line 142 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 >::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 >::random_level(), and Aleph::DynSkipList< Key, Compare >::remove().
|
private |
Definition at line 186 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 >::remove(), Aleph::DynSkipList< Key, Compare >::size(), and Aleph::DynSkipList< Key, Compare >::swap_but_comparison().
|
private |
Definition at line 188 of file tpl_dynSkipList.H.
Referenced by Aleph::DynSkipList< Key, Compare >::operator=(), Aleph::DynSkipList< Key, Compare >::random_level(), and Aleph::DynSkipList< Key, Compare >::swap_but_comparison().
|
mutableprivate |
Definition at line 185 of file tpl_dynSkipList.H.
Referenced by Aleph::DynSkipList< Key, Compare >::random_level(), Aleph::DynSkipList< Key, Compare >::random_source(), Aleph::DynSkipList< Key, Compare >::random_source(), Aleph::DynSkipList< Key, Compare >::rng(), Aleph::DynSkipList< Key, Compare >::set_seed(), and Aleph::DynSkipList< Key, Compare >::swap_but_comparison().