41 #ifdef PB_DS_PAT_TRIE_TRACE_
48 std::cerr << std::endl;
49 if (m_p_head->m_p_parent == 0)
51 trace_node(m_p_head->m_p_parent, 0);
52 std::cerr << std::endl;
58 trace_node(node_const_pointer p_nd, size_type level)
60 for (size_type i = 0; i < level; ++i)
62 std::cerr << p_nd <<
" ";
63 std::cerr << ((p_nd->m_type == pat_trie_leaf_node_type) ?
"l " :
"i ");
65 trace_node_metadata(p_nd, type_to_type<typename node::metadata_type>());
66 typename access_traits::const_iterator el_it = pref_begin(p_nd);
67 while (el_it != pref_end(p_nd))
73 if (p_nd->m_type == pat_trie_leaf_node_type)
75 std::cerr << std::endl;
79 inode_const_pointer p_internal =
static_cast<inode_const_pointer
>(p_nd);
82 static_cast<unsigned long>(p_internal->get_e_ind()) << std::endl;
84 const size_type num_children =
std::distance(p_internal->begin(),
87 for (size_type child_i = 0; child_i < num_children; ++child_i)
89 typename inode::const_iterator child_it = p_internal->begin();
91 trace_node(*child_it, level + 1);
96 template<
typename Metadata_>
99 trace_node_metadata(node_const_pointer p_nd, type_to_type<Metadata_>)
101 std::cerr <<
"(" <<
static_cast<unsigned long>(p_nd->get_metadata()) <<
") ";
107 trace_node_metadata(node_const_pointer, type_to_type<null_type>)
iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
void advance(_InputIterator &__i, _Distance __n)
A generalization of pointer arithmetic.