本文整理汇总了C++中Cst::select_child方法的典型用法代码示例。如果您正苦于以下问题:C++ Cst::select_child方法的具体用法?C++ Cst::select_child怎么用?C++ Cst::select_child使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cst
的用法示例。
在下文中一共展示了Cst::select_child方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: first_child
inline node_type first_child()
{
if (m_stack_cache != nullptr and m_stack_size < cache_size) // push node to the stack
m_stack_cache[m_stack_size] = m_v;
m_stack_size++;
return m_cst->select_child(m_v, 1);
}
示例2:
//! Prefix increment of the iterator.
iterator& operator++()
{
if (!m_valid) return *this;
if (m_queue.empty()) {
m_valid = false;
return *this;
}
value_type v = m_queue.front();
m_queue.pop();
value_type child = m_cst->select_child(v, 1);
while (m_cst->root() != child) {
m_queue.push(child);
child = m_cst->sibling(child);
}
return *this;
}
示例3: test_cst_1th_child_operation
void test_cst_1th_child_operation(const Cst& cst, typename Cst::size_type times=1000000, uint64_t x=17)
{
typedef typename Cst::size_type size_type;
typedef typename Cst::node_type node_type;
std::vector<node_type> nodes;
generate_nodes_from_random_leaves(cst, times, nodes, x);
node_type c; // for 1th_child node
size_type cnt=0;
write_R_output("cst","1th_child","begin",nodes.size(),cnt);
for (size_type i=0; i<nodes.size(); ++i) {
c = cst.select_child(nodes[i], 1);
if (c==cst.root())
++cnt;
}
write_R_output("cst","1th_child","end",nodes.size(),cnt);
}