41 #ifndef PB_DS_THIN_HEAP_HPP
42 #define PB_DS_THIN_HEAP_HPP
54 #define PB_DS_CLASS_T_DEC \
55 template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
57 #define PB_DS_CLASS_C_DEC \
58 thin_heap<Value_Type, Cmp_Fn, _Alloc>
61 #define PB_DS_BASE_T_P \
62 <Value_Type, Cmp_Fn, typename _Alloc::size_type, _Alloc, true>
64 #define PB_DS_BASE_T_P \
65 <Value_Type, Cmp_Fn, typename _Alloc::size_type, _Alloc>
76 template<
typename Value_Type,
typename Cmp_Fn,
typename _Alloc>
81 typedef typename _Alloc::template rebind<Value_Type>::other __rebind_a;
85 typedef typename base_type::node node;
86 typedef typename base_type::node_pointer node_pointer;
87 typedef typename base_type::node_const_pointer node_const_pointer;
90 typedef Value_Type value_type;
91 typedef Cmp_Fn cmp_fn;
92 typedef _Alloc allocator_type;
93 typedef typename _Alloc::size_type size_type;
94 typedef typename _Alloc::difference_type difference_type;
96 typedef typename __rebind_a::pointer pointer;
97 typedef typename __rebind_a::const_pointer const_pointer;
98 typedef typename __rebind_a::reference reference;
99 typedef typename __rebind_a::const_reference const_reference;
107 inline point_iterator
108 push(const_reference);
111 modify(point_iterator, const_reference);
113 inline const_reference
120 erase(point_iterator);
125 template<
typename Pred>
129 template<
typename Pred>
131 split(Pred, PB_DS_CLASS_C_DEC&);
134 join(PB_DS_CLASS_C_DEC&);
144 swap(PB_DS_CLASS_C_DEC&);
148 template<
typename It>
150 copy_from_range(It, It);
152 #ifdef _GLIBCXX_DEBUG
154 assert_valid(
const char*,
int)
const;
157 assert_max(
const char*,
int)
const;
160 #ifdef PB_DS_THIN_HEAP_TRACE_
168 max_rank = (
sizeof(size_type) << 4) + 2
175 update_max(node_pointer);
181 fix_root(node_pointer);
184 fix_sibling_rank_1_unmarked(node_pointer);
187 fix_sibling_rank_1_marked(node_pointer);
190 fix_sibling_general_unmarked(node_pointer);
193 fix_sibling_general_marked(node_pointer);
196 fix_child(node_pointer);
199 make_root(node_pointer);
202 make_root_and_link(node_pointer);
211 add_to_aux(node_pointer);
220 make_child_of(node_pointer, node_pointer);
223 remove_node(node_pointer);
226 join(node_pointer, node_pointer)
const;
228 #ifdef _GLIBCXX_DEBUG
230 assert_node_consistent(node_const_pointer,
bool,
const char*,
int)
const;
233 assert_aux_null(
const char*,
int)
const;
236 node_pointer m_p_max;
237 node_pointer m_a_aux[max_rank];
242 num_distinct_rank_bounds = 48
246 static const std::size_t g_a_rank_bounds[num_distinct_rank_bounds] =
300 #define PB_DS_ASSERT_NODE_CONSISTENT(_Node, _Bool) \
301 _GLIBCXX_DEBUG_ONLY(assert_node_consistent(_Node, _Bool, \
302 __FILE__, __LINE__);)
304 #define PB_DS_ASSERT_AUX_NULL(X) \
305 _GLIBCXX_DEBUG_ONLY(X.assert_aux_null(__FILE__, __LINE__);)
315 #undef PB_DS_ASSERT_AUX_NULL
316 #undef PB_DS_ASSERT_NODE_CONSISTENT
317 #undef PB_DS_CLASS_C_DEC
318 #undef PB_DS_CLASS_T_DEC
319 #undef PB_DS_BASE_T_P
GNU extensions for policy-based data structures for public use.
Const point-type iterator.
Const point-type iterator.
Base class for a basic heap.