libstdc++
__gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc > Class Template Reference

#include <binomial_heap_.hpp>

Inheritance diagram for __gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >:
[legend]

Public Types

typedef base_type::allocator_type allocator_type
 
typedef base_type::cmp_fn cmp_fn
 
typedef base_type::const_iterator const_iterator
 
typedef base_type::const_pointer const_pointer
 
typedef base_type::const_reference const_reference
 
typedef _Alloc::difference_type difference_type
 
typedef base_type::iterator iterator
 
typedef base_type::point_const_iterator point_const_iterator
 
typedef base_type::point_iterator point_iterator
 
typedef base_type::pointer pointer
 
typedef base_type::reference reference
 
typedef _Alloc::size_type size_type
 
typedef Value_Type value_type
 

Public Member Functions

 binomial_heap (const binomial_heap &)
 
 binomial_heap (const Cmp_Fn &)
 
iterator begin ()
 
const_iterator begin () const
 
void clear ()
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
void erase (point_iterator)
 
template<typename Pred>
size_type erase_if (Pred)
 
Cmp_Fn & get_cmp_fn ()
 
const Cmp_Fn & get_cmp_fn () const
 
void join (binomial_heap_base< Value_Type, Cmp_Fn, _Alloc > &)
 
size_type max_size () const
 
void modify (point_iterator, const_reference)
 
void pop ()
 
point_iterator push (const_reference)
 
size_type size () const
 
template<typename Pred>
void split (Pred, binomial_heap_base< Value_Type, Cmp_Fn, _Alloc > &)
 
void swap (left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc > &)
 
const_reference top () const
 

Protected Types

typedef base_type::node node
 
typedef alloc_traits::allocator_type node_allocator
 
typedef _Alloc::size_type node_metadata
 
typedef std::pair< node_pointer, node_pointer > node_pointer_pair
 

Protected Member Functions

void actual_erase_node (node_pointer)
 
void bubble_to_top (node_pointer)
 
void clear_imp (node_pointer)
 
template<typename It>
void copy_from_range (It, It)
 
void find_max ()
 
node_pointer get_new_node_for_insert (const_reference)
 
node_pointer prune (Pred)
 
void swap (binomial_heap_base< Value_Type, Cmp_Fn, _Alloc > &)
 
void swap_with_parent (node_pointer, node_pointer)
 
void to_linked_list ()
 
void value_swap (left_child_next_sibling_heap &)
 

Static Protected Member Functions

static void make_child_of (node_pointer, node_pointer)
 
static node_pointer parent (node_pointer)
 

Protected Attributes

node_pointer m_p_max
 
node_pointer m_p_root
 
size_type m_size
 

Detailed Description

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
class __gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >

Binomial heap.

Definition at line 68 of file binomial_heap_.hpp.

Member Typedef Documentation

◆ allocator_type

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
typedef base_type::allocator_type __gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::allocator_type

Definition at line 89 of file binomial_heap_.hpp.

◆ cmp_fn

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
typedef base_type::cmp_fn __gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::cmp_fn

Definition at line 88 of file binomial_heap_.hpp.

◆ const_iterator

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
typedef base_type::const_iterator __gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::const_iterator

Definition at line 86 of file binomial_heap_.hpp.

◆ const_pointer

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
typedef base_type::const_pointer __gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::const_pointer

Definition at line 81 of file binomial_heap_.hpp.

◆ const_reference

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
typedef base_type::const_reference __gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::const_reference

Definition at line 83 of file binomial_heap_.hpp.

◆ difference_type

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
typedef _Alloc::difference_type __gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::difference_type

Definition at line 79 of file binomial_heap_.hpp.

◆ iterator

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
typedef base_type::iterator __gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::iterator

Definition at line 87 of file binomial_heap_.hpp.

◆ node

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
typedef base_type::node __gnu_pbds::detail::binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::node
protectedinherited

Definition at line 85 of file binomial_heap_base_.hpp.

◆ node_allocator

typedef alloc_traits::allocator_type __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::node_allocator
protectedinherited

Definition at line 101 of file left_child_next_sibling_heap_.hpp.

◆ node_metadata

typedef _Alloc::size_type __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::node_metadata
protectedinherited

Definition at line 105 of file left_child_next_sibling_heap_.hpp.

◆ node_pointer_pair

typedef std::pair<node_pointer, node_pointer> __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::node_pointer_pair
protectedinherited

Definition at line 106 of file left_child_next_sibling_heap_.hpp.

◆ point_const_iterator

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
typedef base_type::point_const_iterator __gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::point_const_iterator

Definition at line 84 of file binomial_heap_.hpp.

◆ point_iterator

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
typedef base_type::point_iterator __gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::point_iterator

Definition at line 85 of file binomial_heap_.hpp.

◆ pointer

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
typedef base_type::pointer __gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::pointer

Definition at line 80 of file binomial_heap_.hpp.

◆ reference

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
typedef base_type::reference __gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::reference

Definition at line 82 of file binomial_heap_.hpp.

◆ size_type

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
typedef _Alloc::size_type __gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::size_type

Definition at line 78 of file binomial_heap_.hpp.

◆ value_type

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
typedef Value_Type __gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::value_type

Definition at line 77 of file binomial_heap_.hpp.

Constructor & Destructor Documentation

◆ binomial_heap() [1/3]

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
__gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::binomial_heap ( )

Definition at line 45 of file binomial_heap_.hpp.

◆ binomial_heap() [2/3]

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
__gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::binomial_heap ( const Cmp_Fn & r_cmp_fn)

Definition at line 50 of file binomial_heap_.hpp.

◆ binomial_heap() [3/3]

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
__gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::binomial_heap ( const binomial_heap< Value_Type, Cmp_Fn, _Alloc > & other)

Definition at line 56 of file binomial_heap_.hpp.

◆ ~binomial_heap()

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
__gnu_pbds::detail::binomial_heap< Value_Type, Cmp_Fn, _Alloc >::~binomial_heap ( )

Definition at line 62 of file binomial_heap_.hpp.

Member Function Documentation

◆ actual_erase_node()

void __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::actual_erase_node ( node_pointer p_nd)
inlineprotectedinherited

Definition at line 205 of file left_child_next_sibling_heap_.hpp.

◆ begin() [1/2]

left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::iterator __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::begin ( )
inlineinherited

Definition at line 166 of file left_child_next_sibling_heap_.hpp.

◆ begin() [2/2]

left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::const_iterator __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::begin ( ) const
inlineinherited

Definition at line 169 of file left_child_next_sibling_heap_.hpp.

◆ bubble_to_top()

void __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::bubble_to_top ( node_pointer p_nd)
protectedinherited

Definition at line 202 of file left_child_next_sibling_heap_.hpp.

◆ clear()

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
void __gnu_pbds::detail::binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::clear ( )
inlineinherited

Definition at line 97 of file binomial_heap_base_.hpp.

◆ clear_imp()

void __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::clear_imp ( node_pointer p_nd)
protectedinherited

Definition at line 208 of file left_child_next_sibling_heap_.hpp.

◆ copy_from_range()

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
template<typename It>
void __gnu_pbds::detail::binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::copy_from_range ( It first_it,
It last_it )
protectedinherited

Definition at line 47 of file binomial_heap_base_.hpp.

◆ empty()

bool __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::empty ( ) const
inlinenodiscardinherited

Definition at line 151 of file left_child_next_sibling_heap_.hpp.

◆ end() [1/2]

left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::iterator __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::end ( )
inlineinherited

Definition at line 172 of file left_child_next_sibling_heap_.hpp.

◆ end() [2/2]

left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::const_iterator __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::end ( ) const
inlineinherited

Definition at line 175 of file left_child_next_sibling_heap_.hpp.

◆ erase()

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
void __gnu_pbds::detail::binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::erase ( point_iterator it)
inherited

Definition at line 106 of file binomial_heap_base_.hpp.

◆ erase_if()

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
template<typename Pred>
binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::size_type __gnu_pbds::detail::binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::erase_if ( Pred pred)
inherited

Definition at line 122 of file binomial_heap_base_.hpp.

◆ find_max()

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
void __gnu_pbds::detail::binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::find_max ( )
inlineprotectedinherited

Definition at line 61 of file binomial_heap_base_.hpp.

◆ get_cmp_fn() [1/2]

Cmp_Fn & __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::get_cmp_fn ( )
inherited

Definition at line 160 of file left_child_next_sibling_heap_.hpp.

◆ get_cmp_fn() [2/2]

const Cmp_Fn & __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::get_cmp_fn ( ) const
inherited

Definition at line 163 of file left_child_next_sibling_heap_.hpp.

◆ get_new_node_for_insert()

left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::node_pointer __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::get_new_node_for_insert ( const_reference r_val)
inlineprotectedinherited

Definition at line 187 of file left_child_next_sibling_heap_.hpp.

◆ join()

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
void __gnu_pbds::detail::binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::join ( binomial_heap_base< Value_Type, Cmp_Fn, _Alloc > & other)
inlineinherited

Definition at line 108 of file binomial_heap_base_.hpp.

◆ make_child_of()

void __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::make_child_of ( node_pointer p_nd,
node_pointer p_new_parent )
inlinestaticprotectedinherited

Definition at line 190 of file left_child_next_sibling_heap_.hpp.

◆ max_size()

left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::size_type __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::max_size ( ) const
inlineinherited

Definition at line 157 of file left_child_next_sibling_heap_.hpp.

◆ modify()

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
void __gnu_pbds::detail::binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::modify ( point_iterator it,
const_reference r_new_val )
inherited

Definition at line 146 of file binomial_heap_base_.hpp.

◆ parent()

left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::node_pointer __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::parent ( node_pointer p_nd)
inlinestaticprotectedinherited

Definition at line 196 of file left_child_next_sibling_heap_.hpp.

◆ pop()

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
void __gnu_pbds::detail::binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::pop ( )
inherited

Definition at line 46 of file binomial_heap_base_.hpp.

◆ prune()

left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::node_pointer __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::prune ( Pred pred)
protectedinherited

Definition at line 215 of file left_child_next_sibling_heap_.hpp.

◆ push()

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::point_iterator __gnu_pbds::detail::binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::push ( const_reference r_val)
inlineinherited

Definition at line 46 of file binomial_heap_base_.hpp.

◆ size()

left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::size_type __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::size ( ) const
inlineinherited

Definition at line 154 of file left_child_next_sibling_heap_.hpp.

◆ split()

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
template<typename Pred>
void __gnu_pbds::detail::binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::split ( Pred pred,
binomial_heap_base< Value_Type, Cmp_Fn, _Alloc > & other )
inherited

Definition at line 47 of file binomial_heap_base_.hpp.

◆ swap() [1/2]

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
void __gnu_pbds::detail::binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::swap ( binomial_heap_base< Value_Type, Cmp_Fn, _Alloc > & other)
protectedinherited

Definition at line 76 of file binomial_heap_base_.hpp.

◆ swap() [2/2]

void __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::swap ( left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc > & other)
inherited

Definition at line 146 of file left_child_next_sibling_heap_.hpp.

◆ swap_with_parent()

void __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::swap_with_parent ( node_pointer p_nd,
node_pointer p_parent )
inlineprotectedinherited

Definition at line 199 of file left_child_next_sibling_heap_.hpp.

◆ to_linked_list()

void __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::to_linked_list ( )
protectedinherited

Definition at line 211 of file left_child_next_sibling_heap_.hpp.

◆ top()

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::const_reference __gnu_pbds::detail::binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::top ( ) const
inlineinherited

Definition at line 46 of file binomial_heap_base_.hpp.

◆ value_swap()

void __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::value_swap ( left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc > & other)
protectedinherited

Definition at line 193 of file left_child_next_sibling_heap_.hpp.

Member Data Documentation

◆ m_p_max

template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
node_pointer __gnu_pbds::detail::binomial_heap_base< Value_Type, Cmp_Fn, _Alloc >::m_p_max
protectedinherited

Definition at line 186 of file binomial_heap_base_.hpp.

◆ m_p_root

node_pointer __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::m_p_root
protectedinherited

Definition at line 270 of file left_child_next_sibling_heap_.hpp.

◆ m_size

size_type __gnu_pbds::detail::left_child_next_sibling_heap< Value_Type, Cmp_Fn, _Alloc::size_type, _Alloc >::m_size
protectedinherited

Definition at line 271 of file left_child_next_sibling_heap_.hpp.


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