41#ifdef PB_DS_CLASS_C_DEC
44inline typename PB_DS_CLASS_C_DEC::iterator
46find_by_order(size_type order)
48 node_iterator it = node_begin();
49 node_iterator end_it = node_end();
53 node_iterator l_it = it.get_l_child();
54 const size_type o = (l_it == end_it)? 0 : l_it.get_metadata();
63 it = it.get_r_child();
67 return base_type::end_iterator();
71inline typename PB_DS_CLASS_C_DEC::const_iterator
73find_by_order(size_type order)
const
74{
return const_cast<PB_DS_CLASS_C_DEC*
>(
this)->find_by_order(order); }
77inline typename PB_DS_CLASS_C_DEC::size_type
79order_of_key(key_const_reference r_key)
const
81 node_const_iterator it = node_begin();
82 node_const_iterator end_it = node_end();
84 const cmp_fn& r_cmp_fn =
const_cast<PB_DS_CLASS_C_DEC*
>(
this)->get_cmp_fn();
88 node_const_iterator l_it = it.get_l_child();
90 if (r_cmp_fn(r_key, this->extract_key(*(*it))))
92 else if (r_cmp_fn(this->extract_key(*(*it)), r_key))
94 ord += (l_it == end_it)? 1 : 1 + l_it.get_metadata();
95 it = it.get_r_child();
99 ord += (l_it == end_it)? 0 : l_it.get_metadata();
109operator()(node_iterator node_it, node_const_iterator end_nd_it)
const
111 node_iterator l_it = node_it.get_l_child();
112 const size_type l_rank = (l_it == end_nd_it) ? 0 : l_it.get_metadata();
114 node_iterator r_it = node_it.get_r_child();
115 const size_type r_rank = (r_it == end_nd_it) ? 0 : r_it.get_metadata();
117 const_cast<metadata_reference
>(node_it.get_metadata())= 1 + l_rank + r_rank;
122~tree_order_statistics_node_update()