41 #ifdef PB_DS_CLASS_C_DEC
48 PB_DS_ASSERT_VALID((*
this))
49 _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
50 _GLIBCXX_DEBUG_ASSERT(m_p_max != 0);
52 node_pointer p_nd = m_p_max;
54 base_type::actual_erase_node(p_nd);
55 PB_DS_ASSERT_VALID((*this))
72 node_pointer p_add = base_type::m_p_root;
73 while (p_add != m_p_max)
75 node_pointer p_next_add = p_add->m_p_next_sibling;
80 p_add = m_p_max->m_p_l_child;
83 node_pointer p_next_add = p_add->m_p_next_sibling;
84 p_add->m_metadata = p_add->m_p_l_child == 0 ?
85 0 : p_add->m_p_l_child->m_metadata + 1;
91 p_add = m_p_max->m_p_next_sibling;
94 node_pointer p_next_add = p_add->m_p_next_sibling;
103 add_to_aux(node_pointer p_nd)
105 size_type r = p_nd->m_metadata;
106 while (m_a_aux[r] != 0)
108 _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata < rank_bound());
109 if (Cmp_Fn::operator()(m_a_aux[r]->m_value, p_nd->m_value))
110 make_child_of(m_a_aux[r], p_nd);
113 make_child_of(p_nd, m_a_aux[r]);
121 _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata < rank_bound());
129 make_child_of(node_pointer p_nd, node_pointer p_new_parent)
131 _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata == p_new_parent->m_metadata);
132 _GLIBCXX_DEBUG_ASSERT(m_a_aux[p_nd->m_metadata] == p_nd ||
133 m_a_aux[p_nd->m_metadata] == p_new_parent);
135 ++p_new_parent->m_metadata;
136 base_type::make_child_of(p_nd, p_new_parent);
144 base_type::m_p_root = m_p_max = 0;
145 const size_type rnk_bnd = rank_bound();
151 make_root_and_link(m_a_aux[i]);
157 PB_DS_ASSERT_AUX_NULL((*
this))
163 remove_node(node_pointer p_nd)
165 node_pointer p_parent = p_nd;
166 while (base_type::parent(p_parent) != 0)
167 p_parent = base_type::parent(p_parent);
169 base_type::bubble_to_top(p_nd);
172 node_pointer p_fix = base_type::m_p_root;
173 while (p_fix != 0&& p_fix->m_p_next_sibling != p_parent)
174 p_fix = p_fix->m_p_next_sibling;
177 p_fix->m_p_next_sibling = p_nd;
194 erase(point_iterator it)
196 PB_DS_ASSERT_VALID((*
this))
197 _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
199 node_pointer p_nd = it.m_p_nd;
201 base_type::actual_erase_node(p_nd);
202 PB_DS_ASSERT_VALID((*this))
206 template<typename Pred>
207 typename PB_DS_CLASS_C_DEC::size_type
211 PB_DS_ASSERT_VALID((*
this))
212 if (base_type::empty())
214 PB_DS_ASSERT_VALID((*
this))
218 base_type::to_linked_list();
219 node_pointer p_out = base_type::prune(pred);
224 node_pointer p_next = p_out->m_p_next_sibling;
225 base_type::actual_erase_node(p_out);
229 node_pointer p_cur = base_type::m_p_root;
230 m_p_max = base_type::m_p_root = 0;
233 node_pointer p_next = p_cur->m_p_next_sibling;
234 make_root_and_link(p_cur);
238 PB_DS_ASSERT_VALID((*
this))
243 inline typename PB_DS_CLASS_C_DEC::size_type
248 const size_t*
const p_upper =
249 std::upper_bound(g_a_rank_bounds,
250 g_a_rank_bounds + num_distinct_rank_bounds,
253 if (p_upper == g_a_rank_bounds + num_distinct_rank_bounds)
256 return (p_upper - g_a_rank_bounds);
ISO C++ entities toplevel namespace is std.