本文整理汇总了C++中SuffixTree::inc_search方法的典型用法代码示例。如果您正苦于以下问题:C++ SuffixTree::inc_search方法的具体用法?C++ SuffixTree::inc_search怎么用?C++ SuffixTree::inc_search使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SuffixTree
的用法示例。
在下文中一共展示了SuffixTree::inc_search方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: find_match
int find_match(SuffixTree& base, string prefix, int procs, int rank)
{
struct timespec pp_time2_b = recorder_wtime();
Preprocess pp_right(prefix + string("log.") + to_string(rank), procs, rank, true);
pp_right.run();
str_hmap_list right = pp_right.get_data();
struct timespec pp_time2_e = recorder_wtime();
pp_time += (pp_time2_e - pp_time2_b);
struct timespec m_time_b = recorder_wtime();
ofstream fout("st/suffix_merged", ios::app);
fout << rank << "-info--------" << endl;
int begin = 0, end = 0, limit = right.size();
int pos;
int sub_begin;
int length, final_pos, begin_pos;
typename str_hmap_list::iterator r_iter = right.begin();
++r_iter; // skip the empty element
while (r_iter != right.end()) {
typename str_hmap_list::iterator pre_iter = r_iter;
r_iter = base.inc_search(r_iter, &final_pos);
if (r_iter == pre_iter) {
fout << "insert " << *r_iter << endl;
++r_iter;
}
else {
length = r_iter - pre_iter;
begin_pos = final_pos - length + 1;
fout << "keep " << begin_pos << " " << final_pos << endl;
}
}
fout.close();
struct timespec m_time_e = recorder_wtime();
merge_time += (m_time_e - m_time_b);
return 0;
}