41 #ifndef PB_DS_BINOMIAL_HEAP_BASE_HPP
42 #define PB_DS_BINOMIAL_HEAP_BASE_HPP
59 #define PB_DS_CLASS_T_DEC \
60 template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
62 #define PB_DS_CLASS_C_DEC \
63 binomial_heap_base<Value_Type, Cmp_Fn, _Alloc>
66 #define PB_DS_B_HEAP_BASE \
67 left_child_next_sibling_heap<Value_Type, Cmp_Fn, \
68 typename _Alloc::size_type, _Alloc, false>
70 #define PB_DS_B_HEAP_BASE \
71 left_child_next_sibling_heap<Value_Type, Cmp_Fn, \
72 typename _Alloc::size_type, _Alloc>
76 template<
typename Value_Type,
typename Cmp_Fn,
typename _Alloc>
78 :
public PB_DS_B_HEAP_BASE
81 typedef typename _Alloc::template rebind<Value_Type>::other __rebind_v;
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_v::pointer pointer;
97 typedef typename __rebind_v::const_pointer const_pointer;
98 typedef typename __rebind_v::reference reference;
99 typedef typename __rebind_v::const_reference const_reference;
108 inline point_iterator
109 push(const_reference);
112 modify(point_iterator, const_reference);
114 inline const_reference
121 erase(point_iterator);
126 template<
typename Pred>
130 template<
typename Pred>
132 split(Pred, PB_DS_CLASS_C_DEC&);
135 join(PB_DS_CLASS_C_DEC&);
146 swap(PB_DS_CLASS_C_DEC&);
150 template<
typename It>
152 copy_from_range(It, It);
157 #ifdef _GLIBCXX_DEBUG
159 assert_valid(
bool,
const char*,
int)
const;
162 assert_max(
const char*,
int)
const;
168 fix(node_pointer)
const;
171 insert_node(node_pointer);
174 remove_parentless_node(node_pointer);
177 join(node_pointer, node_pointer)
const;
179 #ifdef _GLIBCXX_DEBUG
181 assert_node_consistent(node_const_pointer,
bool,
bool,
182 const char*,
int)
const;
186 node_pointer m_p_max;
189 #define PB_DS_ASSERT_VALID_COND(X, _StrictlyBinomial) \
190 _GLIBCXX_DEBUG_ONLY(X.assert_valid(_StrictlyBinomial,__FILE__, __LINE__);)
192 #define PB_DS_ASSERT_BASE_NODE_CONSISTENT(_Node, _Bool) \
193 _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(_Node, _Bool, \
194 __FILE__, __LINE__);)
203 #undef PB_DS_ASSERT_BASE_NODE_CONSISTENT
204 #undef PB_DS_ASSERT_VALID_COND
205 #undef PB_DS_CLASS_C_DEC
206 #undef PB_DS_CLASS_T_DEC
207 #undef PB_DS_B_HEAP_BASE
Base class for binomial heap.
Const point-type iterator.
Const point-type iterator.
GNU extensions for policy-based data structures for public use.
Base class for a basic heap.