Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::DynList< T > Class Template Reference

Dynamic singly linked list with functional programming support. More...

#include <htlist.H>

Inheritance diagram for Aleph::DynList< T >:
[legend]
Collaboration diagram for Aleph::DynList< T >:
[legend]

Classes

class  Iterator
 Iterator on the items of list. More...
 

Public Types

using Item_Type = T
 
using Key_Type = T
 
- Public Types inherited from StlAlephIterator< SetName >
using iterator = StlIterator< SetName >
 
using const_iterator = StlConstIterator< SetName >
 

Public Member Functions

Slinkncget_head () const noexcept=delete
 
Slinkncget_tail () const noexcept=delete
 
DynListswap (DynList &l) noexcept
 
 DynList ()
 Initialize an empty list.
 
 DynList (const DynList &l)
 Initialize a list with a copy of all the items of list l
 
Tinsert (const T &item)
 
Tinsert (T &&item)
 Insert a new item by movement.
 
Tpush (const T &item)
 
Tpush (T &&item)
 
Tput (const T &item)
 
Tput (T &&item)
 
Tappend (const T &item)
 
Tappend (T &&item)
 
T remove_ne () noexcept
 Remove the first item of the list without exception.
 
T remove ()
 Remove the first item of the list.
 
T remove_first_ne () noexcept
 
T remove_first ()
 
T pop ()
 
T get ()
 
Tget_last_ne () const noexcept
 Return the last item of the list without exception.
 
Tget_first_ne () const noexcept
 Return the first item of the list without exception.
 
Tget_last () const
 Return the last item of the list.
 
Tget_first () const
 Return the first item of the list.
 
Ttop () const
 
void empty () noexcept
 empty the list
 
void clear () noexcept
 Empties the container.
 
 ~DynList ()
 
DynListreverse () noexcept
 
DynListrev () noexcept
 
DynList reverse () const
 Return a reversed copy of this.
 
DynList rev () const
 
template<class Equal = std::equal_to<T>>
T remove_ne (Equal eq) noexcept
 
template<class Equal = std::equal_to<T>>
T remove (Equal eq)
 Remove the first element matching an equality criteria.
 
 DynList (DynList &&l) noexcept
 Initialize the list with all the items of l moved to this.
 
DynListoperator= (const DynList &l)
 Assign to this a copy of l
 
DynListoperator= (DynList &&l) noexcept
 Assign to this by movement the list l
 
DynListappend (DynList &&list) noexcept
 Append listat the end of this by movement.
 
DynListinsert (DynList &&list) noexcept
 Insert listat the beginning of this by movement.
 
DynListappend (const DynList &list)
 Append to this a copy of list.
 
DynListinsert (const DynList &list)
 Insert to this a copy of list.
 
Tget (const size_t i)
 Obtains a modifiable reference to the i-th item of this.
 
Toperator[] (const size_t &i)
 Array-style access to the i-th item. Equivalent to get(i).
 
- Public Member Functions inherited from Aleph::HTList
 HTList () noexcept
 
void reset () noexcept
 
constexpr bool is_empty () const noexcept
 
bool is_unitarian () const noexcept
 Return true if the list contains exactly just one.
 
bool is_unitarian_or_empty () const noexcept
 Return true if list contains one element or is empty.
 
Slinkncget_head () const noexcept
 
Slinkncget_tail () const noexcept
 
Slinkncget_first () const noexcept
 
Slinkncget_last () const noexcept
 Return the last item of the list (nullptr if the list is empty)
 
HTListswap (HTList &l) noexcept
 
void insert (Slinknc *link) noexcept
 
void append (Slinknc *link) noexcept
 
void append (HTList &l) noexcept
 
void put (Slinknc *link) noexcept
 
void concat (HTList &l) noexcept
 Concat to 'this' all 'l' list; 'l' becomes empty.
 
void concat_list (HTList &l) noexcept
 
void insert (HTList &l) noexcept
 Insert starting in link (contained in 'this' list) the.
 
void insert (Slinknc *link, HTList &list) noexcept
 Insert a list into this after one of its items.
 
Slinkncremove_head_ne () noexcept
 It deletes head element (first one). Return deleted.
 
Slinkncremove_head ()
 
Slinkncremove_first_ne () noexcept
 
Slinkncremove_first ()
 
bool remove (Slinknc *link)
 
void push (Slinknc *link) noexcept
 
Slinkncpop ()
 
Slinknctop () const
 
size_t split_list (HTList &l, HTList &r) noexcept
 It divides 'this' into two equal lists without modifying.
 
size_t split_list_ne (HTList &l, HTList &r) noexcept
 
size_t split (HTList &l, HTList &r) noexcept
 
size_t reverse () noexcept
 It inverts all list elements. It returns list size.
 
size_t reverse_list () noexcept
 
void cut (Slinknc *link, HTList &list) noexcept
 It cuts 'this' over 'link' element and it puts all.
 
void cut_list (Slinknc *link, HTList &list) noexcept
 
void remove_all_and_delete () noexcept
 
size_t size () const noexcept
 Count the number of elements of the list.
 
void rotate_left (size_t n)
 Rotate to left the list n positions.
 
- 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 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 the 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 criterion.
 
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() const that accepts rvalues.
 
template<class Operation >
Type * find_ptr (Operation &&operation) noexcept(operation_is_noexcept< Operation >())
 Overload of find_ptr() 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 criterion.
 
template<class Operation >
size_t find_index (Operation &&operation) const noexcept(operation_is_noexcept< Operation >())
 Overload of find_index() 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 criterion.
 
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 >())
 Overload of find_item() that accepts rvalues.
 
template<class Operation >
std::tuple< bool, Type > find_item (Operation &&operation) const noexcept(operation_is_noexcept< Operation >())
 Overload of find_item() const that accepts rvalues.
 
template<class Operation >
bool contains_if (Operation &&operation) const noexcept(operation_is_noexcept< Operation >())
 Test if an item satisfying a criterion is present in the container.
 
bool contains (const Type &item) const
 Test if an item is present in the container using equality.
 
- Public Member Functions inherited from SpecialCtors< Container, T >
 SpecialCtors ()=default
 
 SpecialCtors (const SpecialCtors &)=default
 
 SpecialCtors (SpecialCtors &&) noexcept
 
SpecialCtorsoperator= (const SpecialCtors &)=default
 
SpecialCtorsoperator= (SpecialCtors &&) noexcept
 
 SpecialCtors (const Aleph::DynList< T > &l)
 Build the container by inserting all items of the 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 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() const that accepts rvalues.
 
template<class Operation >
void for_each (Operation &&operation)
 Overload of for_each() 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 each() that accepts rvalues.
 
template<class Operation >
void each (Operation &&operation)
 Alias of each() 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)
 Apply a mutable operation to each element of the container.
 
template<class Operation >
void mutable_for_each (Operation &&operation)
 
template<class Operation >
bool all (Operation &operation) const
 Check if all the elements of the container satisfy a condition.
 
template<class Operation >
bool all (Operation &&operation) const
 Overload of all() that accepts rvalues.
 
template<class Operation >
bool exists (Operation &op) const
 Test for existence in the container of an element satisfying a criterion.
 
template<class Operation >
bool exists (Operation &&op) const
 Overload of exists() 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() 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() 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() 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() that accepts rvalues.
 
template<class Operation >
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 >
fold (const T &init, Operation &&operation) const
 Overload of fold() that accepts rvalues.
 
template<class Operation >
Aleph::DynList< T > filter (Operation &operation) const
 Filter the elements of a container according to a matching criterion.
 
template<class Operation >
Aleph::DynList< T > filter (Operation &&operation) const
 Overload of filter() 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 criterion 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() 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 criterion 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() 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 criterion.
 
template<class Operation >
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 >
std::tuple< Aleph::DynList< T >, Aleph::DynList< T > > tpartition (Operation &op) const
 Exclusive partition of container according to a filter criterion.
 
template<class Operation >
std::tuple< Aleph::DynList< T >, Aleph::DynList< T > > tpartition (Operation &&op) const
 Overload of tpartition() 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 EqualSequenceMethod< Container >
bool equal_to (const Container &r) const
 Equality test between this and r.
 
bool operator== (const Container &r) const
 Equality operator.
 
bool operator!= (const Container &r) const
 Inequality operator.
 
- Public Member Functions inherited from StlAlephIterator< SetName >
iterator begin () noexcept
 Return an STL-compatible iterator to the first element.
 
iterator end () noexcept
 Return an STL-compatible end iterator.
 
const_iterator begin () const noexcept
 Return a const iterator to the first element.
 
const_iterator end () const noexcept
 Return a const end iterator.
 
const_iterator cbegin () const noexcept
 Return a const iterator to the first element.
 
const_iterator cend () const noexcept
 Return a const end iterator.
 

Private Types

using CtorBase = SpecialCtors< DynList< T >, T >
 

Private Member Functions

T__insert (Snodenc< T > *p) noexcept
 
T__append (Snodenc< T > *p) noexcept
 

Additional Inherited Members

Detailed Description

template<typename T = int>
class Aleph::DynList< T >

Dynamic singly linked list with functional programming support.

DynList<T> is a versatile singly linked list that combines efficient list operations with a rich set of functional programming methods inherited from the FunctionalMethods mixin.

This is one of the most commonly used containers in Aleph-w, providing:

  • O(1) insertion at head and tail
  • O(1) removal at head
  • O(n) traversal with iterators
  • Comprehensive functional operations (map, filter, fold, etc.)
Template Parameters
TThe type of elements stored in the list (default: int).
Complexity:
Example:
DynList<int> list = {1, 2, 3, 4, 5};
// Functional operations
auto doubled = list.maps<int>([](int x) { return x * 2; });
auto evens = list.filter([](int x) { return x % 2 == 0; });
int sum = list.foldl(0, [](int acc, int x) { return acc + x; });
// Iteration
for (const auto& item : list)
std::cout << item << " ";
Dynamic singly linked list with functional programming support.
Definition htlist.H:1155
__T foldl(const __T &init, Op &op) const
Fold the elements of the container to a specific result.
Definition ah-dry.H:1200
Aleph::DynList< T > filter(Operation &operation) const
Filter the elements of a container according to a matching criterion.
Definition ah-dry.H:1319
Aleph::DynList< __T > maps(Operation &op) const
Map the elements of the container.
Definition ah-dry.H:1057
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
T sum(const Container &container, const T &init=T{})
Compute sum of all elements.
STL namespace.
See also
HTList Base class providing head-tail structure.
DynDlist Doubly linked list alternative.
FunctionalMethods Inherited functional operations.
Author
Alejandro Mujica
Leandro Rabindranath León

Definition at line 1147 of file htlist.H.

Member Typedef Documentation

◆ CtorBase

template<typename T = int>
using Aleph::DynList< T >::CtorBase = SpecialCtors<DynList<T>, T>
private

Definition at line 1156 of file htlist.H.

◆ Item_Type

template<typename T = int>
using Aleph::DynList< T >::Item_Type = T

Definition at line 1163 of file htlist.H.

◆ Key_Type

template<typename T = int>
using Aleph::DynList< T >::Key_Type = T

Definition at line 1166 of file htlist.H.

Constructor & Destructor Documentation

◆ DynList() [1/3]

template<typename T = int>
Aleph::DynList< T >::DynList ( )
inline

Initialize an empty list.

Definition at line 1183 of file htlist.H.

◆ DynList() [2/3]

template<typename T = int>
Aleph::DynList< T >::DynList ( const DynList< T > &  l)
inline

Initialize a list with a copy of all the items of list l

Definition at line 1186 of file htlist.H.

◆ ~DynList()

template<typename T = int>
Aleph::DynList< T >::~DynList ( )
inline

Definition at line 1413 of file htlist.H.

References Aleph::DynList< T >::empty().

◆ DynList() [3/3]

template<typename T = int>
Aleph::DynList< T >::DynList ( DynList< T > &&  l)
inlinenoexcept

Initialize the list with all the items of l moved to this.

This constructor copies (by moving) all the items of list l. Consequently, no copy is done and the construction takes \(O(1)\).

Note
Since l is a rvalue reference, take care of that if you are interested in to avoid the copy. So, if you have a lvalue reference to a list, use std::move(), upon your responsibility, if and only if you are absolutely sure that the list will not be needed after.
Parameters
[in]la rvalue containing a entire list.

Definition at line 1558 of file htlist.H.

References l, and Aleph::DynList< T >::swap().

Member Function Documentation

◆ __append()

template<typename T = int>
T & Aleph::DynList< T >::__append ( Snodenc< T > *  p)
inlineprivatenoexcept

◆ __insert()

template<typename T = int>
T & Aleph::DynList< T >::__insert ( Snodenc< T > *  p)
inlineprivatenoexcept

◆ append() [1/4]

template<typename T = int>
DynList & Aleph::DynList< T >::append ( const DynList< T > &  list)
inline

Append to this a copy of list.

This version of append(l) traverses the items of l and appends them (copies) into this.

Parameters
[in]listlist to be copied at the end
Exceptions
bad_allocif there is no enough memory

Definition at line 1653 of file htlist.H.

References Aleph::HTList::append(), and Aleph::copy().

◆ append() [2/4]

template<typename T = int>
T & Aleph::DynList< T >::append ( const T item)
inline
Append a new item by copy.

Allocate memory for a new item, copy and append it at the end of the list.

Returns
a modifiable reference to the item in the list
Exceptions
`bad_alloc`if there is no enough memory

Definition at line 1271 of file htlist.H.

References Aleph::DynList< T >::__append().

Referenced by ComplexArray::ComplexArray(), Container< Ctype >::Container(), List_of_25_items::List_of_25_items(), WorkersSet< WorkerFct >::WorkersSet(), Aleph::__compute_cut_nodes(), Aleph::__dfp_phase2_list(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::_factorize_as_univariate_in_var(), Aleph::arcs(), Aleph::BitArray::bits_list(), Aleph::Gen_Mo_On_Tree_Node< T, Policy >::build(), build_complete_bipartite(), build_complete_graph(), build_cycle(), Aleph::build_feasible_spanning_tree(), DynListSortTest::build_list(), DynDlistSortTest::build_list(), Aleph::build_perms(), build_point_set(), Aleph::Build_Subgraph< GT, SA >::build_subgraph(), Aleph::chromatic_number(), Aleph::VoronoiDiagramFromDelaunay::clipped_cells(), Aleph::VoronoiDiagramFortune::clipped_cells(), GraphCommon< GT, Node, Arc >::collect_arcs_if(), Aleph::complete_rows(), Aleph::k_shortest_paths_detail::compose_candidate(), Aleph::k_shortest_paths_detail::compose_general_candidate(), Aleph::compute_bipartite_all_components(), Aleph::compute_cut_nodes(), Aleph::Lengauer_Tarjan_Dominators< GT, SA >::compute_idom(), Aleph::Lengauer_Tarjan_Post_Dominators< GT, SA >::compute_ipdom(), Aleph::Unconnected_Components< GT, SA >::compute_lists(), Aleph::concat(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::connected_components(), create_list(), Aleph::decompose_flow(), demo_advanced_algorithms(), demo_build(), demo_convex_hull_cities(), demo_coverage_area(), demo_dynlist(), demo_fold(), demo_performance(), demo_perm_predicates(), demo_permutations(), demo_practical(), demo_sieve_of_eratosthenes(), demo_simple_bloom_filter(), demo_subset_enumeration(), demo_transformation(), demo_transpose(), demo_traverse(), demo_zipping(), Aleph::deque_to_DynList(), Aleph::Gen_Polynomial< Coefficient >::divide_scalar_inplace(), FunctionalMethods< Container, T >::drop(), Aleph::drop_while(), Aleph::dynarray_to_DynList(), Aleph::enumerate_tuple(), Aleph::eppstein_k_shortest_paths(), extract_from_stl_container(), Aleph::Gen_Polynomial< Coefficient >::factor_mod_p(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::factor_recombination(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::factorize(), Aleph::Gen_Polynomial< Coefficient >::factorize(), Aleph::Karger_Min_Cut< GT, SA >::fast(), FunctionalMethods< Container, T >::filter(), Aleph::filter_perm(), Aleph::Gen_Interval_Tree< NodeType, T, Compare >::find_all_overlaps(), Aleph::ShortestPathInPolygon::find_sleeve(), Aleph::flat_map(), Aleph::flatten(), Aleph::flatten(), Aleph::flatten(), Aleph::flatten(), Aleph::format_string_csv(), Aleph::gen_seq_list_tuples(), generate_points(), Aleph::Hungarian_Assignment< Cost_Type >::get_assignments(), Aleph::get_curr_list(), Aleph::ZipIterator< C >::get_curr_list(), Aleph::get_futures(), Aleph::Hungarian_Result< Cost_Type >::get_pairs(), Aleph::get_partial_arcs(), get_pre_in_list(), Aleph::get_unitarian_DynList(), Aleph::Bloom_Filter< T >::hash_seeds(), Aleph::Gen_Polynomial< Coefficient >::hensel_lift(), GraphCommon< GT, Node, Arc >::in_arcs(), Aleph::in_arcs(), GraphCommon< GT, Node, Arc >::in_nodes(), Aleph::in_nodes(), Aleph::in_place_transpose(), Aleph::in_place_transpose(), Aleph::inconnected_components(), Aleph::init_to_DynList(), Aleph::HTList::insert(), Aleph::MapOpenHash< Key, Data, Cmp, HashTable >::items_ptr(), Aleph::DynMapTree< Key, Data, Tree, Compare >::items_ptr(), Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::items_ptr(), QuadTree::join(), Aleph::Karger_Min_Cut< GT, SA >::karger_min_cut(), Aleph::kosaraju_connected_components(), Aleph::kosaraju_connected_components(), Aleph::list_to_DynList(), main(), main(), Aleph::Net_Graph< NodeT, ArcT >::make_super_sink(), Aleph::Net_Graph< NodeT, ArcT >::make_super_source(), Aleph::map_keys_to_DynList(), Aleph::map_perm(), Aleph::map_to_DynList(), Aleph::map_values_to_DynList(), Aleph::maps(), FunctionalMethods< Container, T >::maps(), FunctionalMethods< Container, T >::maps_if(), Aleph::QuickHull::operator()(), Aleph::ConstrainedDelaunayTriangulation::operator()(), Aleph::AdversarialTraceCollector< Move, Score >::operator()(), Aleph::ShortestPathInPolygon::operator()(), Aleph::SearchSolutionCollector< Solution >::operator()(), Aleph::DelaunayTriangulationBowyerWatson::operator()(), Aleph::DelaunayTriangulationRandomizedIncremental::operator()(), Aleph::VoronoiDiagram::operator()(), Aleph::VoronoiDiagramFortune::operator()(), Aleph::ConstrainedDelaunayTriangulation::operator()(), Aleph::Stoer_Wagner_Min_Cut< GT, Distance, SA >::operator()(), Aleph::MonotonePolygonTriangulation::operator()(), Aleph::MinimumEnclosingCircle::operator()(), Aleph::DynList< T >::operator=(), GraphCommon< GT, Node, Arc >::out_arcs(), Aleph::out_arcs(), GraphCommon< GT, Node, Arc >::out_nodes(), Aleph::out_nodes(), Aleph::QuickHull::partition(), Aleph::k_shortest_paths_detail::path_to_state(), FunctionalMethods< Container, T >::pfilter(), Aleph::pointers_list(), Aleph::pointers_list(), populate_dyndlist(), populate_dynlist(), DlinkListOperationsTest::populateList(), Aleph::Gen_Polynomial< Coefficient >::positive_divisors(), FunctionalMethods< Container, T >::ptr_filter(), Aleph::DynListQueue< T >::put(), Aleph::DynListQueue< T >::put(), K2Tree< T >::range(), Aleph::range_to_DynList(), reference_split_string(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::remove_node(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::remove_zeros(), Aleph::Gen_Polynomial< Coefficient >::remove_zeros(), Aleph::rep(), roots_and_interpolation(), Aleph::Dial_Min_Paths< GT, Distance, Itor, SA >::run_dial(), Aleph::Gen_Polynomial< Coefficient >::scale_inplace(), Aleph::scanl(), Aleph::scanl_sum(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::scc_by_len(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::scc_by_lists(), scenario_construction(), scenario_in_circle_in_delaunay_context(), Aleph::sequential_groups(), Aleph::Bloom_Filter< T >::set_bits(), Aleph::set_to_DynList(), DynListRemovePredicateTest::SetUp(), DynListIteratorTest::SetUp(), Aleph::solve_assignment(), Aleph::solve_circulation(), sparse_polynomials(), Aleph::Dlink::split_list_ne(), Aleph::split_n(), Aleph::split_text_into_words(), Aleph::detail::spp_find_sleeve(), Aleph::stl_container_to_dynList(), Aleph::Gen_Polynomial< Coefficient >::sturm_chain(), Aleph::sublist(), Aleph::t_enum_zip(), Aleph::t_enum_zip_eq(), Aleph::t_zip(), Aleph::t_zip_eq(), FunctionalMethods< Container, T >::take(), FunctionalMethods< Container, T >::take(), Aleph::take_while(), Aleph::Gen_Polynomial< Coefficient >::terms_list(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), test_all_constructors_agree(), test_construct_all_identical(), test_construct_from_dynlist(), test_container(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), test_list(), to_dynlist(), Aleph::FunctionalMixin< Derived, Type >::tpartition(), FunctionalMethods< Container, T >::tpartition(), transfer_function(), Aleph::transpose(), Aleph::MonotonePolygonTriangulation::triangulate_monotone(), Aleph::tunzip(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST_P(), TYPED_TEST_P(), Aleph::uni_unzip(), Aleph::uni_zip_to_dynlist(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::uninit_paint(), Aleph::unzip(), Aleph::AHMapping< Key, ValueType >::values(), Aleph::MapOpenHash< Key, Data, Cmp, HashTable >::values_ptr(), Aleph::DynMapTree< Key, Data, Tree, Compare >::values_ptr(), Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::values_ptr(), Aleph::vector_to_DynList(), Aleph::vector_to_DynList(), Aleph::Tikz_Scene::visualize_convex_hull(), Aleph::welsh_powell_coloring(), Aleph::Cnode::words_impl(), Aleph::Dlink::wrap_header(), Aleph::yen_k_shortest_paths(), Aleph::Gen_Polynomial< Coefficient >::yun_sfd(), Aleph::zip_filter(), Aleph::zip_lists(), Aleph::zip_map(), Aleph::zip_maps(), Aleph::zip_maps_if(), Aleph::zip_partition(), Aleph::zip_take(), and Aleph::zip_take_while().

◆ append() [3/4]

template<typename T = int>
DynList & Aleph::DynList< T >::append ( DynList< T > &&  list)
inlinenoexcept

Append listat the end of this by movement.

append(l) (in this rvalue version), puts in constant time the items of l at the end of this. After calling l becomes empty.

Note
Since l is a rvalue reference, take care of that if you are interested in to avoid the copy. So, if you have a lvalue reference to a list, use std::move(), upon your responsibility, if and only if you are absolutely sure that the list will not be needed after.
Parameters
[in]lista rvalue reference to the list to be appended

Definition at line 1619 of file htlist.H.

References Aleph::HTList::append().

◆ append() [4/4]

template<typename T = int>
T & Aleph::DynList< T >::append ( T &&  item)
inline
Append a new item by movement.

Allocate memory for a new item, move to its allocated place and append it at the end of the list.

Returns
a modifiable reference to the item in the list
Exceptions
`bad_alloc`if there is no enough memory

Definition at line 1286 of file htlist.H.

References Aleph::DynList< T >::__append().

◆ clear()

template<typename T = int>
void Aleph::DynList< T >::clear ( )
inlinenoexcept

Empties the container.

Exceptions
none
See also
empty()

Definition at line 1411 of file htlist.H.

References Aleph::DynList< T >::empty().

Referenced by Aleph::AdversarialTraceCollector< Move, Score >::clear(), and TEST().

◆ empty()

◆ get() [1/2]

template<typename T = int>
T Aleph::DynList< T >::get ( )
inline

◆ get() [2/2]

template<typename T = int>
T & Aleph::DynList< T >::get ( const size_t  i)
inline

Obtains a modifiable reference to the i-th item of this.

Throws overflow_error if i is greater or equal to number of elements

Definition at line 1677 of file htlist.H.

References Aleph::and, Aleph::divide_and_conquer_partition_dp(), Aleph::DynList< T >::Iterator::get_curr(), Aleph::HTList::Iterator::has_curr(), and Aleph::HTList::Iterator::next_ne().

◆ get_first()

◆ get_first_ne()

template<typename T = int>
T & Aleph::DynList< T >::get_first_ne ( ) const
inlinenoexcept

Return the first item of the list without exception.

Returns
a modifiable reference to the first item

Definition at line 1353 of file htlist.H.

References Aleph::HTList::get_first().

Referenced by Aleph::DynList< T >::get_first(), and Aleph::merge_lists().

◆ get_head()

template<typename T = int>
Slinknc * Aleph::DynList< T >::get_head ( ) const
deletenoexcept

◆ get_last()

template<typename T = int>
T & Aleph::DynList< T >::get_last ( ) const
inline

◆ get_last_ne()

template<typename T = int>
T & Aleph::DynList< T >::get_last_ne ( ) const
inlinenoexcept

Return the last item of the list without exception.

Returns
a modifiable reference to the last item

Definition at line 1343 of file htlist.H.

References Aleph::Snodenc< T >::get_data(), and Aleph::HTList::get_last().

Referenced by Aleph::DynList< T >::get_last().

◆ get_tail()

template<typename T = int>
Slinknc * Aleph::DynList< T >::get_tail ( ) const
deletenoexcept

◆ insert() [1/4]

template<typename T = int>
DynList & Aleph::DynList< T >::insert ( const DynList< T > &  list)
inline

Insert to this a copy of list.

This version of insert(l) traverses the items of l and insert a copy into this.

Parameters
[in]listlist to be copied at the end
Exceptions
bad_allocif there is no enough memory

Definition at line 1668 of file htlist.H.

References Aleph::divide_and_conquer_partition_dp(), and Aleph::HTList::insert().

◆ insert() [2/4]

◆ insert() [3/4]

template<typename T = int>
DynList & Aleph::DynList< T >::insert ( DynList< T > &&  list)
inlinenoexcept

Insert listat the beginning of this by movement.

insert(l) (in this rvalue version), puts in constant time the items of l at the beginning of this. After calling l becomes empty.

Note
Since l is a rvalue reference, take care of that if you are interested in to avoid the copy. So, if you have a lvalue reference to a list, use std::move(), upon your responsibility, if and only if you are absolutely sure that the list will not be needed after.
Parameters
[in]lista rvalue reference to the list to be inserted

Definition at line 1639 of file htlist.H.

References Aleph::HTList::insert().

◆ insert() [4/4]

template<typename T = int>
Aleph::DynList< T >::insert ( T &&  item)
inline

Insert a new item by movement.

Allocate memory for a new item, move the item and insert into the list as the first item. This operation can be faster that the equivalent with copy

Returns
a modifiable reference to the item in the list
Exceptions
`bad_alloc`if there is no enough memory

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1235 of file htlist.H.

References Aleph::DynList< T >::__insert().

◆ operator=() [1/2]

template<typename T = int>
DynList & Aleph::DynList< T >::operator= ( const DynList< T > &  l)
inline

Assign to this a copy of l

First, the list is emptied (all its elements are deleted). Then sequential copy of each item of l is inserted into this.

This assignation takes \(O(|l|)\) in complexity.

Parameters
[in]llist whose items want to be inserted into this
Exceptions
`bad_alloc`if there is no enough memory

Definition at line 1573 of file htlist.H.

References Aleph::DynList< T >::append(), Aleph::DynList< T >::empty(), Aleph::HTList::Iterator::has_curr(), and l.

◆ operator=() [2/2]

template<typename T = int>
DynList & Aleph::DynList< T >::operator= ( DynList< T > &&  l)
inlinenoexcept

Assign to this by movement the list l

This assignation swaps the content of this with the content of l. This swapping is done in \(O(1)\).

Note
Since l is a rvalue reference, take care of that if you are interested in to avoid the copy. So, if you have a lvalue referenced to a list, use std::move(), upon your responsibility, if and only if you are absolutely sure that the list will not be needed after.
Parameters
[in]la rvalue reference to the list to be assigned by movement.

Definition at line 1600 of file htlist.H.

References l, and Aleph::DynList< T >::swap().

◆ operator[]()

template<typename T = int>
T & Aleph::DynList< T >::operator[] ( const size_t &  i)
inline

Array-style access to the i-th item. Equivalent to get(i).

Definition at line 1687 of file htlist.H.

References Aleph::DynList< T >::get().

◆ pop()

template<typename T = int>
T Aleph::DynList< T >::pop ( )
inline

Definition at line 1334 of file htlist.H.

References Aleph::DynList< T >::remove_first().

Referenced by TEST(), TEST(), TEST(), and TEST_F().

◆ push() [1/2]

template<typename T = int>
T & Aleph::DynList< T >::push ( const T item)
inline

Definition at line 1241 of file htlist.H.

References Aleph::DynList< T >::insert().

Referenced by Aleph::DynList< T >::put(), Aleph::DynList< T >::put(), and TEST_F().

◆ push() [2/2]

template<typename T = int>
T & Aleph::DynList< T >::push ( T &&  item)
inline

Definition at line 1247 of file htlist.H.

References Aleph::DynList< T >::insert().

◆ put() [1/2]

template<typename T = int>
T & Aleph::DynList< T >::put ( const T item)
inline

Definition at line 1250 of file htlist.H.

References Aleph::DynList< T >::push().

Referenced by Aleph::compute_bipartite(), TEST_F(), TEST_F(), and TEST_F().

◆ put() [2/2]

template<typename T = int>
T & Aleph::DynList< T >::put ( T &&  item)
inline

Definition at line 1256 of file htlist.H.

References Aleph::DynList< T >::push().

◆ remove() [1/2]

template<typename T = int>
Aleph::DynList< T >::remove ( )
inline

Remove the first item of the list.

Returns
a copy of removed item
Exceptions
underflow_errorif the list is empty

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1311 of file htlist.H.

References Aleph::divide_and_conquer_partition_dp(), l, and Aleph::HTList::remove_head().

Referenced by Aleph::DynList< T >::get(), Aleph::DynList< T >::remove_first(), and TEST().

◆ remove() [2/2]

template<typename T = int>
template<class Equal = std::equal_to<T>>
T Aleph::DynList< T >::remove ( Equal  eq)
inline

Remove the first element matching an equality criteria.

remove(eq) sequentially traverses the list and on each current element curr it calls to eq(curr). If the test is true, then curr is removed from the list and a copy of curr is returned. Otherwise, if no element matches with eq() test, then exception domain_error is thrown.

The eq() must match the following signature:

bool eq(const T& op)

This test would return true when op satisfies the finding criteria`.

Since that this method is overloaded, you could define several flavors: a more sophisticated functor, function pointers or lambdas.

Parameters
[in]eqequality test
Returns
a copy of removed element if the item was found and removed; otherwise the exception domain_error is thrown.

Definition at line 1529 of file htlist.H.

References ah_domain_error, Aleph::divide_and_conquer_partition_dp(), Aleph::eq(), and Aleph::HTList::Iterator::has_curr().

◆ remove_first()

◆ remove_first_ne()

template<typename T = int>
T Aleph::DynList< T >::remove_first_ne ( )
inlinenoexcept

Definition at line 1322 of file htlist.H.

References Aleph::DynList< T >::remove_ne().

Referenced by Aleph::merge_lists().

◆ remove_ne() [1/2]

template<typename T = int>
T Aleph::DynList< T >::remove_ne ( )
inlinenoexcept

Remove the first item of the list without exception.

Returns
a copy of removed item
Exceptions
underflow_errorif the list is empty

Definition at line 1296 of file htlist.H.

References Aleph::divide_and_conquer_partition_dp(), l, and Aleph::HTList::remove_head_ne().

Referenced by Aleph::DynList< T >::remove_first_ne().

◆ remove_ne() [2/2]

template<typename T = int>
template<class Equal = std::equal_to<T>>
T Aleph::DynList< T >::remove_ne ( Equal  eq)
inlinenoexcept

◆ rev() [1/2]

template<typename T = int>
DynList Aleph::DynList< T >::rev ( ) const
inline

Definition at line 1488 of file htlist.H.

References Aleph::DynList< T >::reverse().

◆ rev() [2/2]

template<typename T = int>
DynList & Aleph::DynList< T >::rev ( )
inlinenoexcept

◆ reverse() [1/2]

template<typename T = int>
DynList Aleph::DynList< T >::reverse ( ) const
inline

Return a reversed copy of this.

Not confuse with reverse without const which mutates this

Definition at line 1479 of file htlist.H.

References Aleph::divide_and_conquer_partition_dp(), LocateFunctions< Container, Type >::get_it(), and Aleph::DynList< T >::insert().

◆ reverse() [2/2]

template<typename T = int>
DynList & Aleph::DynList< T >::reverse ( )
inlinenoexcept

◆ swap()

◆ top()

template<typename T = int>
T & Aleph::DynList< T >::top ( ) const
inline

Definition at line 1383 of file htlist.H.

References Aleph::DynList< T >::get_first().

Referenced by TEST(), TEST(), and TEST_F().


The documentation for this class was generated from the following files: