Binary heaps composed of resize and compare policies. More...
#include <binary_heap_.hpp>
Public Types | |
typedef _Alloc | allocator_type |
typedef Cmp_Fn | cmp_fn |
typedef cond_dealtor< value_type, _Alloc > | cond_dealtor_t |
typedef binary_heap_const_iterator_< value_type, entry, simple_value, _Alloc > | const_iterator |
typedef value_allocator::const_pointer | const_pointer |
typedef value_allocator::const_reference | const_reference |
typedef _Alloc::difference_type | difference_type |
typedef __conditional_type< simple_value, value_type, pointer >::__type | entry |
typedef _Alloc::template rebind< entry >::other | entry_allocator |
typedef entry_cmp< Value_Type, Cmp_Fn, _Alloc, is_simple< Value_Type >::value >::type | entry_cmp |
typedef entry_allocator::pointer | entry_pointer |
typedef const_iterator | iterator |
typedef binary_heap_point_const_iterator_< value_type, entry, simple_value, _Alloc > | point_const_iterator |
typedef point_const_iterator | point_iterator |
typedef value_allocator::pointer | pointer |
typedef value_allocator::reference | reference |
typedef __gnu_pbds::detail::resize_policy< typename _Alloc::size_type > | resize_policy |
typedef _Alloc::size_type | size_type |
typedef Value_Type | value_type |
Static Public Attributes | |
static const _Alloc::size_type | min_size |
Protected Member Functions | |
template<typename It > | |
void | copy_from_range (It, It) |
Private Types | |
enum | { simple_value = is_simple<value_type>::value } |
typedef _Alloc::template rebind< value_type > | __rebind_v |
typedef integral_constant< int, simple_value > | no_throw_copies_t |
typedef __rebind_v::other | value_allocator |
Private Member Functions | |
void | fix (entry_pointer) |
void | insert_value (const_reference, false_type) |
void | insert_value (value_type, true_type) |
bool | is_heap () |
void | make_heap () |
template<typename Pred > | |
size_type | partition (Pred) |
void | pop_heap () |
void | push_heap () |
void | resize_for_erase_if_needed () |
void | resize_for_insert_if_needed () |
void | swap_value_imp (entry_pointer, value_type, true_type) |
void | swap_value_imp (entry_pointer, const_reference, false_type) |
const_reference | top_imp (true_type) const |
const_reference | top_imp (false_type) const |
void | value_swap (binary_heap &) |
Static Private Member Functions | |
static size_type | left_child (size_type) |
static size_type | parent (size_type) |
static size_type | right_child (size_type) |
Private Attributes | |
entry_pointer | m_a_entries |
size_type | m_actual_size |
size_type | m_size |
Static Private Attributes | |
static entry_allocator | s_entry_allocator |
static no_throw_copies_t | s_no_throw_copies_ind |
static value_allocator | s_value_allocator |
Binary heaps composed of resize and compare policies.
Based on CLRS.
|
private |
typedef _Alloc __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::allocator_type |
typedef Cmp_Fn __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::cmp_fn |
typedef cond_dealtor<value_type, _Alloc> __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::cond_dealtor_t |
typedef binary_heap_const_iterator_<value_type, entry, simple_value, _Alloc> __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::const_iterator |
typedef value_allocator::const_pointer __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::const_pointer |
typedef value_allocator::const_reference __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::const_reference |
typedef _Alloc::difference_type __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::difference_type |
typedef __conditional_type<simple_value, value_type, pointer>::__type __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::entry |
typedef _Alloc::template rebind<entry>::other __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::entry_allocator |
typedef entry_cmp<Value_Type, Cmp_Fn, _Alloc, is_simple<Value_Type>::value>::type __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::entry_cmp |
typedef entry_allocator::pointer __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::entry_pointer |
typedef const_iterator __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::iterator |
|
private |
typedef binary_heap_point_const_iterator_<value_type, entry, simple_value, _Alloc> __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::point_const_iterator |
typedef point_const_iterator __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::point_iterator |
typedef value_allocator::pointer __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::pointer |
typedef value_allocator::reference __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::reference |
typedef __gnu_pbds::detail::resize_policy<typename _Alloc::size_type> __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::resize_policy |
typedef _Alloc::size_type __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::size_type |
|
private |
typedef Value_Type __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::value_type |
__gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::binary_heap | ( | ) |
__gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::binary_heap | ( | const cmp_fn & | ) |
__gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::binary_heap | ( | const binary_heap< Value_Type, Cmp_Fn, _Alloc > & | ) |
__gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::~binary_heap | ( | ) |
|
inline |
|
inline |
void __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::clear | ( | ) |
|
protected |
|
inline |
|
inline |
Referenced by __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::is_heap(), __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::make_heap(), __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::pop_heap(), and __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::push_heap().
|
inline |
|
inline |
|
inline |
|
inline |
size_type __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::erase_if | ( | Pred | ) |
|
private |
Cmp_Fn& __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::get_cmp_fn | ( | ) |
const Cmp_Fn& __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::get_cmp_fn | ( | ) | const |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
References __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::end(), __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::m_a_entries, and __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::m_size.
Referenced by __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::make_heap(), and __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::push_heap().
void __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::join | ( | binary_heap< Value_Type, Cmp_Fn, _Alloc > & | ) |
|
inlinestaticprivate |
|
inlineprivate |
References _GLIBCXX_DEBUG_ASSERT, __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::end(), __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::is_heap(), __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::m_a_entries, and __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::m_size.
Referenced by __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::push_heap().
|
inline |
void __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::modify | ( | point_iterator | , |
const_reference | |||
) |
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inlinestaticprivate |
|
private |
|
inline |
|
inlineprivate |
References __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::end(), __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::m_a_entries, and __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::m_size.
|
inline |
|
inlineprivate |
References __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::end(), __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::is_heap(), __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::m_a_entries, __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::m_size, and __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::make_heap().
|
inlineprivate |
|
inlineprivate |
|
inlineinherited |
|
inlineinherited |
|
inlinestaticprivate |
|
inlineinherited |
|
inline |
void __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::split | ( | Pred | , |
binary_heap< Value_Type, Cmp_Fn, _Alloc > & | |||
) |
|
inlineinherited |
void __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::swap | ( | binary_heap< Value_Type, Cmp_Fn, _Alloc > & | ) |
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
private |
|
private |
Referenced by __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::is_heap(), __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::make_heap(), __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::pop_heap(), and __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::push_heap().
|
private |
|
private |
Referenced by __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::is_heap(), __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::make_heap(), __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::pop_heap(), and __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::push_heap().
|
staticinherited |
|
staticprivate |
|
staticprivate |
|
staticprivate |