41#ifdef PB_DS_CLASS_C_DEC
48assert_valid(
const char* __file,
int __line)
const
50 base_type::assert_valid(__file, __line);
51 assert_node_consistent(base_type::m_p_root,
true, __file, __line);
52 assert_max(__file, __line);
53 assert_aux_null(__file, __line);
59assert_aux_null(
const char* __file,
int __line)
const
61 for (size_type i = 0; i < max_rank; ++i)
62 PB_DS_DEBUG_VERIFY(m_a_aux[i] == 0);
68assert_max(
const char* __file,
int __line)
const
72 PB_DS_DEBUG_VERIFY(base_type::empty());
76 PB_DS_DEBUG_VERIFY(!base_type::empty());
77 PB_DS_DEBUG_VERIFY(base_type::parent(m_p_max) == 0);
78 PB_DS_DEBUG_VERIFY(m_p_max->m_p_prev_or_parent == 0);
79 for (const_iterator it = base_type::begin(); it != base_type::end(); ++it)
80 PB_DS_DEBUG_VERIFY(!Cmp_Fn::operator()(m_p_max->m_value, it.m_p_nd->m_value));
86assert_node_consistent(node_const_pointer p_nd,
bool root,
87 const char* __file,
int __line)
const
89 base_type::assert_node_consistent(p_nd, root, __file, __line);
93 assert_node_consistent(p_nd->m_p_next_sibling, root, __file, __line);
94 assert_node_consistent(p_nd->m_p_l_child,
false, __file, __line);
97 if (p_nd->m_metadata == 0)
98 PB_DS_DEBUG_VERIFY(p_nd->m_p_next_sibling == 0);
100 PB_DS_DEBUG_VERIFY(p_nd->m_metadata == p_nd->m_p_next_sibling->m_metadata + 1);
103 if (p_nd->m_p_l_child != 0)
104 PB_DS_DEBUG_VERIFY(p_nd->m_p_l_child->m_metadata + 1 == base_type::degree(p_nd));
106 const bool unmarked_valid =
107 (p_nd->m_p_l_child == 0 && p_nd->m_metadata == 0)
108 || (p_nd->m_p_l_child != 0
109 && p_nd->m_metadata == p_nd->m_p_l_child->m_metadata + 1);
111 const bool marked_valid =
112 (p_nd->m_p_l_child == 0 && p_nd->m_metadata == 1)
113 || (p_nd->m_p_l_child != 0
114 && p_nd->m_metadata == p_nd->m_p_l_child->m_metadata + 2);
116 PB_DS_DEBUG_VERIFY(unmarked_valid || marked_valid);
118 PB_DS_DEBUG_VERIFY(unmarked_valid);