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

Dynamic heap of elements of type T ordered by a comparison functor. More...

#include <tpl_dynBinHeap.H>

Inheritance diagram for Aleph::DynBinHeap< T, Compare >:
[legend]
Collaboration diagram for Aleph::DynBinHeap< T, Compare >:
[legend]

Classes

struct  Iterator
 

Public Types

using Set_Type = DynBinHeap
 
using Item_Type = T
 
using Key_Type = T
 
- Public Types inherited from Aleph::BinHeap< Key, Compare >
using Node = BinHeapNode< Key >
 El tipo de nodo del heap.
 
- Public Types inherited from Aleph::GenBinHeap< NodeType, Key, Compare >
using Node = NodeType< Key >
 
- Public Types inherited from StlAlephIterator< SetName >
using iterator = StlIterator< SetName >
 
using const_iterator = StlConstIterator< SetName >
 

Public Member Functions

 DynBinHeap (Compare &cmp) noexcept
 
 DynBinHeap (Compare &&cmp=Compare()) noexcept
 
 DynBinHeap (const DynBinHeap &h)
 
 DynBinHeap (DynBinHeap &&h)
 
template<template< typename > class List>
 DynBinHeap (const List< T > &l)
 
template<class It >
 DynBinHeap (It b, It e)
 
 DynBinHeap (std::initializer_list< T > l)
 
template<typename ... Args>
 DynBinHeap (const T &item, Args &... args)
 
template<typename ... Args>
 DynBinHeap (T &&item, Args &... args)
 
DynBinHeapoperator= (const DynBinHeap &h)
 
DynBinHeapoperator= (DynBinHeap &&h) noexcept
 
Tinsert (const T &item)
 Insert a copy of item into the heap.
 
Tinsert (T &&item)
 
Tappend (const T &item)
 
Tappend (T &&item)
 
Tput (const T &item)
 Synonym of insert().
 
Tput (T &&item)
 
T getMin ()
 Remove the minimum element (according to Compare) and return it.
 
T getMax ()
 
T get ()
 Alias for getMin().
 
void update (T &data) noexcept
 Adjust the position of an element after mutating its priority.
 
bool remove (T &data) noexcept
 Remove an arbitrary element belonging to the heap.
 
bool erase (T &data) noexcept
 Alias for remove().
 
Ttop () const
 Return a reference to the smallest element.
 
void empty () noexcept
 Remove every element.
 
 ~DynBinHeap ()
 Destructor.
 
template<class Operation >
bool traverse (Operation &op)
 
template<class Operation >
bool traverse (Operation &&op=Operation())
 
template<class Operation >
bool traverse (Operation &op) const
 
template<class Operation >
bool traverse (Operation &&op=Operation()) const
 
- Public Member Functions inherited from Aleph::GenBinHeap< NodeType, Key, Compare >
Compare & key_comp () noexcept
 
Compare & get_compare () noexcept
 
void swap (GenBinHeap &h) noexcept
 
NodegetRoot () noexcept
 
NodegetRoot () const noexcept
 
template<class Operation >
bool preorder_traverse (Operation op) const
 
template<class Operation >
void for_each_in_preorder (Operation &operation) const
 
template<class Operation >
void for_each_in_preorder (Operation &&operation=Operation()) const
 
template<class Operation >
void for_each_in_inorder (Operation &operation) const
 
template<class Operation >
void for_each_in_inorder (Operation &&operation=Operation()) const
 
template<class Op >
bool level_traverse (Op operation=Op()) const
 
 GenBinHeap (Compare __cmp=Compare()) noexcept
 
virtual ~GenBinHeap () noexcept
 
Nodeinsert (Node *p) noexcept
 Inserta un nodo en un heap.
 
NodegetMin_ne () noexcept
 
NodegetMin ()
 Elimina del heap el nodo de menor prioridad.
 
NodegetMax ()
 
void update (Node *p) noexcept
 Actualiza prioridad de un nodo contenido en el heap.
 
Noderemove (Node *node)
 Elimina del heap el nodo node.
 
void remove_all_and_delete () noexcept
 Borra todos los nodos del heap, invoca a los destructores de los nodos eliminados y libera toda la memoria.
 
Nodetop ()
 Retorna el nodo con menor prioridad según el criterio de comparación especificado en la declaración.
 
Nodetop () const
 
const size_tsize () const noexcept
 
bool is_empty () const noexcept
 
bool verify_heap () const
 
- Public Member Functions inherited from LocateFunctions< Container, Type >
auto get_it () const
 Return a properly initialized iterator positioned at the first item on the container.
 
auto get_it (const size_t pos) const
 Return a properly initialized iterator positioned at the pos item on the container.
 
auto get_itor () const
 Alias of get_it().
 
Type & nth_ne (const size_t n) noexcept
 Return the n‑th element without bounds checking.
 
const Type & nth_ne (const size_t n) const noexcept
 Const overload of nth_ne(size_t).
 
Type & nth (const size_t n)
 Return the n-th item of container.
 
const Type & nth (const size_t n) const
 Const overload of nth(size_t).
 
template<class Operation >
Type * find_ptr (Operation &operation) noexcept(operation_is_noexcept< Operation >())
 Find a pointer to an item in the container according to a searching criteria.
 
template<class Operation >
const Type * find_ptr (Operation &operation) const noexcept(operation_is_noexcept< Operation >())
 Const overload of find_ptr(Operation&).
 
template<class Operation >
const Type * find_ptr (Operation &&operation) const noexcept(operation_is_noexcept< Operation >())
 Overload of find_ptr(Operation&) const that accepts rvalues.
 
template<class Operation >
Type * find_ptr (Operation &&operation) noexcept(operation_is_noexcept< Operation >())
 Overload of find_ptr(Operation&) that accepts rvalues.
 
template<class Operation >
size_t find_index (Operation &operation) const noexcept(operation_is_noexcept< Operation >())
 Find the position of an item in the container according to a searching criteria.
 
template<class Operation >
size_t find_index (Operation &&operation) const noexcept(operation_is_noexcept< Operation >())
 Overload of find_index(Operation&) that accepts rvalues.
 
template<class Operation >
std::tuple< bool, Type > find_item (Operation &operation) noexcept(operation_is_noexcept< Operation >())
 Safe sequential searching of an item matching a criteria.
 
template<class Operation >
std::tuple< bool, Type > find_item (Operation &operation) const noexcept(operation_is_noexcept< Operation >())
 
template<class Operation >
std::tuple< bool, Type > find_item (Operation &&operation) noexcept(operation_is_noexcept< Operation >())
 
template<class Operation >
std::tuple< bool, Type > find_item (Operation &&operation) const noexcept(operation_is_noexcept< Operation >())
 
- Public Member Functions inherited from FunctionalMethods< Container, T >
template<typename ... Args>
void emplace (Args &&... args)
 Appends a new element into the container by constructing it in-place with the given args.
 
template<typename ... Args>
void emplace_end (Args &&... args)
 
template<typename ... Args>
void emplace_ins (Args &&... args)
 Insert a new element into the container by constructing it in-place with the given args.
 
template<typename ... Args>
size_t ninsert (Args ... args)
 Insert n variadic items.
 
template<typename ... Args>
size_t nappend (Args ... args)
 Append n variadic items.
 
template<class Operation >
void for_each (Operation &operation)
 Traverse all the container and performs an operation on each element.
 
template<class Operation >
void for_each (Operation &operation) const
 Const overload of for_each(Operation&).
 
template<class Operation >
void for_each (Operation &&operation) const
 Overload of for_each(Operation&) const that accepts rvalues.
 
template<class Operation >
void for_each (Operation &&operation)
 Overload of for_each(Operation&) that accepts rvalues.
 
template<class Operation >
void each (Operation &operation)
 Alias of for_each(Operation&).
 
template<class Operation >
void each (Operation &operation) const
 Const alias of for_each(Operation&).
 
template<class Operation >
void each (Operation &&operation) const
 Const alias of for_each(Operation&) that accepts rvalues.
 
template<class Operation >
void each (Operation &&operation)
 Alias of for_each(Operation&) that accepts rvalues.
 
template<class Operation >
void each (size_t pos, const size_t slice, Operation &operation) const
 Traverse the container starting at pos taking one item every slice, performing a mutable operation on each visited element.
 
template<class Operation >
void each (const size_t pos, const size_t slice, Operation &&operation) const
 
template<class Operation >
void mutable_for_each (Operation &operation)
 
template<class Operation >
void mutable_for_each (Operation &&operation)
 
template<class Operation >
bool all (Operation &operation) const
 Check if all the elements of container satisfy a condition.
 
template<class Operation >
bool all (Operation &&operation) const
 Overload of all(Operation&) that accepts rvalues.
 
template<class Operation >
bool exists (Operation &op) const
 Test for existence in the container of an element satisfying a criteria.
 
template<class Operation >
bool exists (Operation &&op) const
 Overload of exists(Operation&) that accepts rvalues.
 
template<typename __T = T, class Operation = Aleph::Dft_Map_Op<T, __T>>
Aleph::DynList< __T > maps (Operation &op) const
 Map the elements of the container.
 
template<typename __T = T, class Operation = Aleph::Dft_Map_Op<__T, __T>>
Aleph::DynList< __T > maps (Operation &&op) const
 Overload of maps(Operation&) that accepts rvalues.
 
template<typename __T = T, class Prop , class Operation >
Aleph::DynList< __Tmaps_if (Prop prop, Operation &op) const
 Conditional mapping of the elements of the container.
 
template<typename __T = T, class Prop , class Operation >
Aleph::DynList< __Tmaps_if (Prop prop, Operation &&op) const
 Overload of maps_if(Prop, Operation&) that accepts rvalues.
 
Aleph::DynList< T > to_dynlist () const
 Convert container to DynList.
 
std::vector< T > to_vector () const
 Convert container to std::vector.
 
template<typename __T = T, class Op = Aleph::Dft_Fold_Op<__T, T>>
__T foldl (const __T &init, Op &op) const
 Fold the elements of the container to a specific result.
 
template<typename __T = T, class Op = Aleph::Dft_Fold_Op<__T, T>>
__T foldl (const __T &init, Op &&op=Op()) const
 Overload of foldl(const __T&, Op&) that accepts rvalues.
 
template<typename __T = T, class Op = Aleph::Dft_Fold_Op<__T, T>>
__T fold_left (const __T &init, Op &op) const
 Alias for foldl with the same accumulator type.
 
template<typename __T = T, class Op = Aleph::Dft_Fold_Op<__T, T>>
__T fold_left (const __T &init, Op &&op=Op()) const
 Overload of fold_left(const __T&, Op&) that accepts rvalues.
 
template<class Operation >
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(const T&, Operation&) that accepts rvalues.
 
template<class Operation >
Aleph::DynList< T > filter (Operation &operation) const
 Filter the elements of a container according to a matching criteria.
 
template<class Operation >
Aleph::DynList< T > filter (Operation &&operation) const
 Overload of filter(Operation&) that accepts rvalues.
 
template<class Operation >
Aleph::DynList< const T * > ptr_filter (Operation &operation) const
 Filter the elements of a container according to a matching criteria and return a pointer to the matched items in the container.
 
template<class Operation >
Aleph::DynList< const T * > ptr_filter (Operation &&operation) const
 Overload of ptr_filter(Operation&) that accepts rvalues.
 
template<class Operation >
Aleph::DynList< std::tuple< T, size_t > > pfilter (Operation &operation) const
 Filter the elements of a container according to a matching criteria and determine its positions respect to the traversal of container.
 
template<class Operation >
Aleph::DynList< std::tuple< T, size_t > > pfilter (Operation &&operation) const
 Overload of pfilter(Operation&) that accepts rvalues.
 
template<class Operation >
std::pair< Aleph::DynList< T >, Aleph::DynList< T > > partition (Operation &op) const
 Exclusive partition of container according to a filter criteria.
 
template<class Operation >
std::pair< Aleph::DynList< T >, Aleph::DynList< T > > partition (Operation &&op) const
 Overload of partition(Operation&) that accepts rvalues.
 
template<class Operation >
std::pair< Aleph::DynList< T >, Aleph::DynList< T > > partition (size_t n) const
 Exclusive partition of container in the nth item.
 
std::pair< Aleph::DynList< T >, Aleph::DynList< T > > split_half () const
 Split the container into two halves by alternating elements.
 
template<class Operation >
std::tuple< Aleph::DynList< T >, Aleph::DynList< T > > tpartition (Operation &op) const
 Exclusive partition of container according to a filter criteria.
 
template<class Operation >
std::tuple< Aleph::DynList< T >, Aleph::DynList< T > > tpartition (Operation &&op) const
 Overload of tpartition(Operation&) that accepts rvalues.
 
size_t length () const noexcept
 Count the number of elements of a container.
 
Aleph::DynList< T > rev () const
 Return a list with the elements of container in reverse order respect to its traversal order.
 
Aleph::DynList< T > take (const size_t n) const
 Return a list with the first n elements seen in the container during its traversal.
 
Aleph::DynList< T > take (size_t i, const size_t j, const size_t step=1) const
 Return a list with elements seen in the container between i and j position respect to its traversal.
 
Aleph::DynList< T > drop (const size_t n) const
 Drop the first n elements seen in the container during its traversal.
 
void mutable_drop (const size_t n)
 Drop the first n elements seen from container.
 
- Public Member Functions inherited from GenericItems< Container, T >
Aleph::DynList< T > items () const
 Return a list of all the elements of a container sorted by traversal order.
 
Aleph::DynList< T > keys () const
 
- Public Member Functions inherited from EqualToMethod< Container >
bool equal_to (const Container &r) const noexcept
 Test if elements of this are exactly contained in another container.
 
bool operator== (const Container &r) const noexcept
 
bool operator!= (const Container &r) const noexcept
 Negation of equal_to()
 
- 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 Base = BinHeap< T, Compare >
 
using Node = typename BinHeap< T, Compare >::Node
 

Private Member Functions

T__insert (Node *p) noexcept
 
void copy (const DynBinHeap &src)
 

Additional Inherited Members

- Protected Member Functions inherited from Aleph::GenBinHeap< NodeType, Key, Compare >
virtual bool verify_heap (Node *p) const
 
- Static Protected Member Functions inherited from Aleph::GenBinHeap< NodeType, Key, Compare >
static Nodeadvance_left (Node *p) noexcept
 
static Nodeadvance_right (Node *p) noexcept
 
- Protected Attributes inherited from Aleph::GenBinHeap< NodeType, Key, Compare >
Compare cmp
 

Detailed Description

template<class T, class Compare = Aleph::less<T>>
class Aleph::DynBinHeap< T, Compare >

Dynamic heap of elements of type T ordered by a comparison functor.

DynBinHeap stores items in a binary heap whose nodes are allocated dynamically (no backing array), so the structure can grow or shrink as needed.

Author
Leandro Rabindranath León

Definition at line 74 of file tpl_dynBinHeap.H.

Member Typedef Documentation

◆ Base

template<class T , class Compare = Aleph::less<T>>
using Aleph::DynBinHeap< T, Compare >::Base = BinHeap<T, Compare>
private

Definition at line 91 of file tpl_dynBinHeap.H.

◆ Item_Type

template<class T , class Compare = Aleph::less<T>>
using Aleph::DynBinHeap< T, Compare >::Item_Type = T

Definition at line 85 of file tpl_dynBinHeap.H.

◆ Key_Type

template<class T , class Compare = Aleph::less<T>>
using Aleph::DynBinHeap< T, Compare >::Key_Type = T

Definition at line 87 of file tpl_dynBinHeap.H.

◆ Node

template<class T , class Compare = Aleph::less<T>>
using Aleph::DynBinHeap< T, Compare >::Node = typename BinHeap<T, Compare>::Node
private

Definition at line 93 of file tpl_dynBinHeap.H.

◆ Set_Type

template<class T , class Compare = Aleph::less<T>>
using Aleph::DynBinHeap< T, Compare >::Set_Type = DynBinHeap

Definition at line 83 of file tpl_dynBinHeap.H.

Constructor & Destructor Documentation

◆ DynBinHeap() [1/9]

template<class T , class Compare = Aleph::less<T>>
Aleph::DynBinHeap< T, Compare >::DynBinHeap ( Compare &  cmp)
inlinenoexcept

Definition at line 110 of file tpl_dynBinHeap.H.

◆ DynBinHeap() [2/9]

template<class T , class Compare = Aleph::less<T>>
Aleph::DynBinHeap< T, Compare >::DynBinHeap ( Compare &&  cmp = Compare())
inlinenoexcept

Definition at line 112 of file tpl_dynBinHeap.H.

◆ DynBinHeap() [3/9]

template<class T , class Compare = Aleph::less<T>>
Aleph::DynBinHeap< T, Compare >::DynBinHeap ( const DynBinHeap< T, Compare > &  h)
inline

Definition at line 115 of file tpl_dynBinHeap.H.

References Aleph::DynBinHeap< T, Compare >::copy(), and h.

◆ DynBinHeap() [4/9]

template<class T , class Compare = Aleph::less<T>>
Aleph::DynBinHeap< T, Compare >::DynBinHeap ( DynBinHeap< T, Compare > &&  h)
inline

Definition at line 120 of file tpl_dynBinHeap.H.

References h, and Aleph::swap().

◆ DynBinHeap() [5/9]

template<class T , class Compare = Aleph::less<T>>
template<template< typename > class List>
Aleph::DynBinHeap< T, Compare >::DynBinHeap ( const List< T > &  l)
inline

Definition at line 125 of file tpl_dynBinHeap.H.

◆ DynBinHeap() [6/9]

template<class T , class Compare = Aleph::less<T>>
template<class It >
Aleph::DynBinHeap< T, Compare >::DynBinHeap ( It  b,
It  e 
)
inline

Definition at line 125 of file tpl_dynBinHeap.H.

◆ DynBinHeap() [7/9]

template<class T , class Compare = Aleph::less<T>>
Aleph::DynBinHeap< T, Compare >::DynBinHeap ( std::initializer_list< T l)
inline

Definition at line 125 of file tpl_dynBinHeap.H.

◆ DynBinHeap() [8/9]

template<class T , class Compare = Aleph::less<T>>
template<typename ... Args>
Aleph::DynBinHeap< T, Compare >::DynBinHeap ( const T item,
Args &...  args 
)
inline

Definition at line 127 of file tpl_dynBinHeap.H.

◆ DynBinHeap() [9/9]

template<class T , class Compare = Aleph::less<T>>
template<typename ... Args>
Aleph::DynBinHeap< T, Compare >::DynBinHeap ( T &&  item,
Args &...  args 
)
inline

Definition at line 127 of file tpl_dynBinHeap.H.

◆ ~DynBinHeap()

template<class T , class Compare = Aleph::less<T>>
Aleph::DynBinHeap< T, Compare >::~DynBinHeap ( )
inline

Destructor.

Definition at line 264 of file tpl_dynBinHeap.H.

References Aleph::DynBinHeap< T, Compare >::empty().

Member Function Documentation

◆ __insert()

◆ append() [1/2]

template<class T , class Compare = Aleph::less<T>>
T & Aleph::DynBinHeap< T, Compare >::append ( const T item)
inline

Definition at line 163 of file tpl_dynBinHeap.H.

References Aleph::DynBinHeap< T, Compare >::__insert().

◆ append() [2/2]

template<class T , class Compare = Aleph::less<T>>
T & Aleph::DynBinHeap< T, Compare >::append ( T &&  item)
inline

Definition at line 168 of file tpl_dynBinHeap.H.

References Aleph::DynBinHeap< T, Compare >::__insert().

◆ copy()

◆ empty()

template<class T , class Compare = Aleph::less<T>>
void Aleph::DynBinHeap< T, Compare >::empty ( )
inlinenoexcept

◆ erase()

template<class T , class Compare = Aleph::less<T>>
bool Aleph::DynBinHeap< T, Compare >::erase ( T data)
inlinenoexcept

Alias for remove().

Definition at line 246 of file tpl_dynBinHeap.H.

References Aleph::DynBinHeap< T, Compare >::remove().

◆ get()

template<class T , class Compare = Aleph::less<T>>
T Aleph::DynBinHeap< T, Compare >::get ( )
inline

Alias for getMin().

Definition at line 207 of file tpl_dynBinHeap.H.

References Aleph::DynBinHeap< T, Compare >::getMin().

Referenced by demo_binary_heap(), and demo_performance_comparison().

◆ getMax()

template<class T , class Compare = Aleph::less<T>>
T Aleph::DynBinHeap< T, Compare >::getMax ( )
inline

Definition at line 201 of file tpl_dynBinHeap.H.

References Aleph::DynBinHeap< T, Compare >::getMin().

◆ getMin()

template<class T , class Compare = Aleph::less<T>>
Aleph::DynBinHeap< T, Compare >::getMin ( )
inline

Remove the minimum element (according to Compare) and return it.

Returns
copy of the removed element.
Exceptions
underflow_errorif the heap 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 189 of file tpl_dynBinHeap.H.

References Aleph::GenBinHeap< NodeType, Key, Compare >::getMin(), and FunctionalMethods< Container, T >::maps().

Referenced by Aleph::DynBinHeap< T, Compare >::get(), Aleph::DynBinHeap< T, Compare >::getMax(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ insert() [1/2]

template<class T , class Compare = Aleph::less<T>>
T & Aleph::DynBinHeap< T, Compare >::insert ( const T item)
inline

Insert a copy of item into the heap.

Parameters
[in]itemvalue to insert.
Returns
reference to the stored element.
Exceptions
bad_allocif allocation fails.

Definition at line 153 of file tpl_dynBinHeap.H.

References Aleph::DynBinHeap< T, Compare >::__insert().

Referenced by demo_binary_heap(), demo_performance_comparison(), Aleph::DynBinHeap< T, Compare >::put(), Aleph::DynBinHeap< T, Compare >::put(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ insert() [2/2]

template<class T , class Compare = Aleph::less<T>>
T & Aleph::DynBinHeap< T, Compare >::insert ( T &&  item)
inline

Definition at line 158 of file tpl_dynBinHeap.H.

References Aleph::DynBinHeap< T, Compare >::__insert().

◆ operator=() [1/2]

template<class T , class Compare = Aleph::less<T>>
DynBinHeap & Aleph::DynBinHeap< T, Compare >::operator= ( const DynBinHeap< T, Compare > &  h)
inline

◆ operator=() [2/2]

template<class T , class Compare = Aleph::less<T>>
DynBinHeap & Aleph::DynBinHeap< T, Compare >::operator= ( DynBinHeap< T, Compare > &&  h)
inlinenoexcept

Definition at line 141 of file tpl_dynBinHeap.H.

References h, and Aleph::swap().

◆ put() [1/2]

template<class T , class Compare = Aleph::less<T>>
T & Aleph::DynBinHeap< T, Compare >::put ( const T item)
inline

Synonym of insert().

Definition at line 174 of file tpl_dynBinHeap.H.

References Aleph::DynBinHeap< T, Compare >::insert().

◆ put() [2/2]

template<class T , class Compare = Aleph::less<T>>
T & Aleph::DynBinHeap< T, Compare >::put ( T &&  item)
inline

Definition at line 179 of file tpl_dynBinHeap.H.

References Aleph::DynBinHeap< T, Compare >::insert().

◆ remove()

template<class T , class Compare = Aleph::less<T>>
bool Aleph::DynBinHeap< T, Compare >::remove ( T data)
inlinenoexcept

Remove an arbitrary element belonging to the heap.

The reference must have been obtained from insert(). The underlying node is freed.

Parameters
dataelement to erase.
Returns
true if a node was removed.

Definition at line 231 of file tpl_dynBinHeap.H.

References Aleph::GenBinHeap< NodeType, Key, Compare >::is_empty(), Aleph::BinHeapNode< Key >::key_to_node(), FunctionalMethods< Container, T >::maps(), and Aleph::GenBinHeap< NodeType, Key, Compare >::remove().

Referenced by Aleph::DynBinHeap< T, Compare >::erase(), and TEST().

◆ top()

template<class T , class Compare = Aleph::less<T>>
T & Aleph::DynBinHeap< T, Compare >::top ( ) const
inline

Return a reference to the smallest element.

Definition at line 252 of file tpl_dynBinHeap.H.

References Aleph::GenBinHeap< NodeType, Key, Compare >::top().

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

◆ traverse() [1/4]

template<class T , class Compare = Aleph::less<T>>
template<class Operation >
bool Aleph::DynBinHeap< T, Compare >::traverse ( Operation &&  op = Operation())
inline

Definition at line 277 of file tpl_dynBinHeap.H.

References Aleph::DynBinHeap< T, Compare >::traverse().

◆ traverse() [2/4]

template<class T , class Compare = Aleph::less<T>>
template<class Operation >
bool Aleph::DynBinHeap< T, Compare >::traverse ( Operation &&  op = Operation()) const
inline

Definition at line 290 of file tpl_dynBinHeap.H.

References FunctionalMethods< Container, T >::maps().

◆ traverse() [3/4]

template<class T , class Compare = Aleph::less<T>>
template<class Operation >
bool Aleph::DynBinHeap< T, Compare >::traverse ( Operation op)
inline

◆ traverse() [4/4]

template<class T , class Compare = Aleph::less<T>>
template<class Operation >
bool Aleph::DynBinHeap< T, Compare >::traverse ( Operation op) const
inline

◆ update()

template<class T , class Compare = Aleph::less<T>>
void Aleph::DynBinHeap< T, Compare >::update ( T data)
inlinenoexcept

Adjust the position of an element after mutating its priority.

Parameters
[in]datareference previously returned by insert().
Note
Behavior is undefined if data does not belong to this heap.

Definition at line 217 of file tpl_dynBinHeap.H.

References Aleph::GenBinHeap< NodeType, Key, Compare >::update().

Referenced by TEST(), and TEST().


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