STLdoc
STLdocumentation
|
#include <ext/pb_ds/detail/binary_heap_/binary_heap_.hpp>
Public Types | |
typedef Value_Type | value_type |
typedef Cmp_Fn | cmp_fn |
typedef _Alloc | allocator_type |
typedef _Alloc::size_type | size_type |
typedef _Alloc::difference_type | difference_type |
typedef PB_DS_ENTRY_CMP_DEC | entry_cmp |
typedef PB_DS_RESIZE_POLICY_DEC | resize_policy |
typedef cond_dealtor < value_type, _Alloc > | cond_dealtor_t |
typedef value_allocator::pointer | pointer |
typedef value_allocator::const_pointer | const_pointer |
typedef value_allocator::reference | reference |
typedef value_allocator::const_reference | const_reference |
typedef __conditional_type < simple_value, value_type, pointer >::__type | entry |
typedef _Alloc::template rebind< entry >::other | entry_allocator |
typedef entry_allocator::pointer | entry_pointer |
typedef binary_heap_point_const_iterator_ < value_type, entry, simple_value, _Alloc > | point_const_iterator |
typedef point_const_iterator | point_iterator |
typedef binary_heap_const_iterator_ < value_type, entry, simple_value, _Alloc > | const_iterator |
typedef const_iterator | iterator |
Public Member Functions | |
binary_heap () | |
binary_heap (const cmp_fn &) | |
binary_heap (const binary_heap &) | |
void | swap (binary_heap &) |
~binary_heap () | |
bool | empty () const |
size_type | size () const |
size_type | max_size () const |
Cmp_Fn & | get_cmp_fn () |
const Cmp_Fn & | get_cmp_fn () const |
point_iterator | push (const_reference) |
void | modify (point_iterator, const_reference) |
const_reference | top () const |
void | pop () |
void | erase (point_iterator) |
template<typename Pred > | |
size_type | erase_if (Pred) |
void | erase_at (entry_pointer, size_type, false_type) |
void | erase_at (entry_pointer, size_type, true_type) |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
void | clear () |
template<typename Pred > | |
void | split (Pred, binary_heap &) |
void | join (binary_heap &) |
Protected Member Functions | |
template<typename It > | |
void | copy_from_range (It, It) |
Private Types | |
enum | { simple_value = is_simple<value_type>::value } |
typedef integral_constant< int, simple_value > | no_throw_copies_t |
typedef _Alloc::template rebind< value_type > | __rebind_v |
typedef __rebind_v::other | value_allocator |
Private Member Functions | |
void | value_swap (binary_heap &) |
void | insert_value (const_reference, false_type) |
void | insert_value (value_type, true_type) |
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) |
void | fix (entry_pointer) |
const_reference | top_imp (true_type) const |
const_reference | top_imp (false_type) const |
void | resize_for_erase_if_needed () |
template<typename Pred > | |
size_type | partition (Pred) |
void | make_heap () |
void | push_heap () |
void | pop_heap () |
bool | is_heap () |
Static Private Member Functions | |
static size_type | left_child (size_type) |
static size_type | right_child (size_type) |
static size_type | parent (size_type) |
Private Attributes | |
size_type | m_size |
size_type | m_actual_size |
entry_pointer | m_a_entries |
Static Private Attributes | |
static entry_allocator | s_entry_allocator |
static value_allocator | s_value_allocator |
static no_throw_copies_t | s_no_throw_copies_ind |
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 PB_DS_ENTRY_CMP_DEC __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 PB_DS_RESIZE_POLICY_DEC __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 |
|
private |
__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 |
|
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 |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
void __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::join | ( | binary_heap< Value_Type, Cmp_Fn, _Alloc > & | ) |
|
inlinestaticprivate |
|
inlineprivate |
|
inline |
void __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::modify | ( | point_iterator | , |
const_reference | |||
) |
|
inlinestaticprivate |
|
private |
|
inline |
|
inlineprivate |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlinestaticprivate |
|
inline |
void __gnu_pbds::detail::binary_heap< Value_Type, Cmp_Fn, _Alloc >::split | ( | Pred | , |
binary_heap< Value_Type, Cmp_Fn, _Alloc > & | |||
) |
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 |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |