41 #ifndef PB_DS_BINARY_HEAP_HPP
42 #define PB_DS_BINARY_HEAP_HPP
54 #ifdef PB_DS_BINARY_HEAP_TRACE_
64 #define PB_DS_CLASS_T_DEC \
65 template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
67 #define PB_DS_CLASS_C_DEC \
68 binary_heap<Value_Type, Cmp_Fn, _Alloc>
70 #define PB_DS_ENTRY_CMP_DEC \
71 entry_cmp<Value_Type, Cmp_Fn, _Alloc, is_simple<Value_Type>::value>::type
73 #define PB_DS_RESIZE_POLICY_DEC \
74 __gnu_pbds::detail::resize_policy<typename _Alloc::size_type>
83 template<
typename Value_Type,
typename Cmp_Fn,
typename _Alloc>
105 typedef typename _Alloc::template rebind<value_type>
__rebind_v;
109 typedef typename value_allocator::pointer
pointer;
118 typedef typename _Alloc::template rebind<entry>::other
177 template<
typename Pred>
202 template<
typename Pred>
209 #ifdef PB_DS_BINARY_HEAP_TRACE_
215 template<
typename It>
259 template<
typename Pred>
302 #ifdef _GLIBCXX_DEBUG
304 assert_valid(
const char*,
int)
const;
307 #ifdef PB_DS_BINARY_HEAP_TRACE_
324 #define PB_DS_ASSERT_VALID(X) \
325 _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
327 #define PB_DS_DEBUG_VERIFY(_Cond) \
328 _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \
329 _M_message(#_Cond" assertion from %1;:%2;") \
330 ._M_string(__FILE__)._M_integer(__LINE__) \
344 #undef PB_DS_CLASS_C_DEC
345 #undef PB_DS_CLASS_T_DEC
346 #undef PB_DS_ENTRY_CMP_DEC
347 #undef PB_DS_RESIZE_POLICY_DEC
_Alloc::difference_type difference_type
Definition: binary_heap_.hpp:92
entry_allocator::pointer entry_pointer
Definition: binary_heap_.hpp:121
static size_type left_child(size_type)
Cmp_Fn cmp_fn
Definition: binary_heap_.hpp:89
Definition: type_utils.hpp:95
void value_swap(binary_heap &)
void insert_value(const_reference, false_type)
static entry_allocator s_entry_allocator
Definition: binary_heap_.hpp:315
point_const_iterator point_iterator
Definition: binary_heap_.hpp:127
const_reference top() const
static size_type right_child(size_type)
static size_type parent(size_type)
void push_heap()
Definition: binary_heap_.hpp:273
#define _GLIBCXX_DEBUG_ASSERT(_Condition)
Definition: debug.h:61
Value_Type value_type
Definition: binary_heap_.hpp:88
void resize_for_insert_if_needed()
const_reference top_imp(true_type) const
const_iterator iterator
Definition: binary_heap_.hpp:133
#define PB_DS_ENTRY_CMP_DEC
Definition: binary_heap_.hpp:70
void erase_at(entry_pointer, size_type, false_type)
bool is_heap()
Definition: binary_heap_.hpp:294
_Alloc::size_type size_type
Definition: binary_heap_.hpp:91
Const point-type iterator.
Definition: const_iterator.hpp:60
void modify(point_iterator, const_reference)
_Alloc allocator_type
Definition: binary_heap_.hpp:90
#define PB_DS_RESIZE_POLICY_DEC
Definition: binary_heap_.hpp:73
Definition: binary_heap_.hpp:100
binary_heap_point_const_iterator_< value_type, entry, simple_value, _Alloc > point_const_iterator
Definition: binary_heap_.hpp:125
cond_dealtor< value_type, _Alloc > cond_dealtor_t
Definition: binary_heap_.hpp:95
_Alloc::template rebind< entry >::other entry_allocator
Definition: binary_heap_.hpp:119
__rebind_v::other value_allocator
Definition: binary_heap_.hpp:106
value_allocator::pointer pointer
Definition: binary_heap_.hpp:109
void resize_for_erase_if_needed()
value_allocator::reference reference
Definition: binary_heap_.hpp:111
PB_DS_ENTRY_CMP_DEC entry_cmp
Definition: binary_heap_.hpp:93
static value_allocator s_value_allocator
Definition: binary_heap_.hpp:316
binary_heap_const_iterator_< value_type, entry, simple_value, _Alloc > const_iterator
Definition: binary_heap_.hpp:131
std::tr1::integral_constant< int, 1 > true_type
Definition: type_utils.hpp:70
Conditional dey destructor, cc_hash.
Definition: cond_key_dtor_entry_dealtor.hpp:47
Const point-type iterator.
Definition: point_const_iterator.hpp:55
void erase(point_iterator)
PB_DS_RESIZE_POLICY_DEC resize_policy
Definition: binary_heap_.hpp:94
void make_heap()
Definition: binary_heap_.hpp:264
integral_constant< int, simple_value > no_throw_copies_t
Definition: binary_heap_.hpp:103
void copy_from_range(It, It)
value_allocator::const_reference const_reference
Definition: binary_heap_.hpp:112
Definition: binary_heap_.hpp:84
size_type m_size
Definition: binary_heap_.hpp:319
value_allocator::const_pointer const_pointer
Definition: binary_heap_.hpp:110
void split(Pred, binary_heap &)
size_type max_size() const
size_type m_actual_size
Definition: binary_heap_.hpp:320
__conditional_type< simple_value, value_type, pointer >::__type entry
Definition: binary_heap_.hpp:116
static no_throw_copies_t s_no_throw_copies_ind
Definition: binary_heap_.hpp:317
size_type partition(Pred)
entry_pointer m_a_entries
Definition: binary_heap_.hpp:321
point_iterator push(const_reference)
_Alloc::template rebind< value_type > __rebind_v
Definition: binary_heap_.hpp:105
void pop_heap()
Definition: binary_heap_.hpp:286
void swap_value_imp(entry_pointer, value_type, true_type)
std::tr1::integral_constant< int, 0 > false_type
Definition: type_utils.hpp:71