41 #ifdef PB_DS_CLASS_C_DEC
43 #ifdef PB_DS_PAT_TRIE_TRACE_
51 if (m_p_head->m_p_parent == 0)
53 trace_node(m_p_head->m_p_parent, 0);
60 trace_node(node_const_pointer p_nd, size_type level)
62 for (size_type i = 0; i < level; ++i)
65 std::cerr << ((p_nd->m_type == pat_trie_leaf_node_type) ?
"l " :
"i ");
67 trace_node_metadata(p_nd, type_to_type<typename node::metadata_type>());
68 typename access_traits::const_iterator el_it = pref_begin(p_nd);
69 while (el_it != pref_end(p_nd))
75 if (p_nd->m_type == pat_trie_leaf_node_type)
81 inode_const_pointer p_internal =
static_cast<inode_const_pointer
>(p_nd);
84 static_cast<unsigned long>(p_internal->get_e_ind()) <<
std::endl;
86 const size_type num_children =
std::distance(p_internal->begin(),
89 for (size_type child_i = 0; child_i < num_children; ++child_i)
91 typename inode::const_iterator child_it = p_internal->begin();
93 trace_node(*child_it, level + 1);
98 template<
typename Metadata_>
101 trace_node_metadata(node_const_pointer p_nd, type_to_type<Metadata_>)
103 std::cerr <<
"(" <<
static_cast<unsigned long>(p_nd->get_metadata()) <<
") ";
109 trace_node_metadata(node_const_pointer, type_to_type<null_type>)
constexpr iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
ostream cerr
Linked to standard output.
basic_ostream< _CharT, _Traits > & endl(basic_ostream< _CharT, _Traits > &__os)
Write a newline and flush the stream.
constexpr void advance(_InputIterator &__i, _Distance __n)
A generalization of pointer arithmetic.