本文整理汇总了C++中Index::cross_alignment方法的典型用法代码示例。如果您正苦于以下问题:C++ Index::cross_alignment方法的具体用法?C++ Index::cross_alignment怎么用?C++ Index::cross_alignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Index
的用法示例。
在下文中一共展示了Index::cross_alignment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main_index
//.........这里部分代码省略.........
Index index;
if (compact) {
index.open_for_write(rocksdb_name);
index.compact();
index.flush();
index.close();
}
// todo, switch to xg for graph storage
// index should write and load index/xg or such
// then a handful of functions used in main.cpp and mapper.cpp need to be rewritten to use the xg index
if (store_graph && file_names.size() > 0) {
index.open_for_write(rocksdb_name);
VGset graphs(file_names);
graphs.show_progress = show_progress;
graphs.store_in_index(index);
//index.flush();
//index.close();
// reopen to index paths
// this requires the index to be queryable
//index.open_for_write(db_name);
graphs.store_paths_in_index(index);
index.compact();
index.flush();
index.close();
}
if (store_node_alignments && file_names.size() > 0) {
index.open_for_bulk_load(rocksdb_name);
int64_t aln_idx = 0;
function<void(Alignment&)> lambda = [&index,&aln_idx](Alignment& aln) {
index.cross_alignment(aln_idx++, aln);
};
for (auto& file_name : file_names) {
get_input_file(file_name, [&](istream& in) {
stream::for_each_parallel(in, lambda);
});
}
index.flush();
index.close();
}
if (store_alignments && file_names.size() > 0) {
index.open_for_bulk_load(rocksdb_name);
function<void(Alignment&)> lambda = [&index](Alignment& aln) {
index.put_alignment(aln);
};
for (auto& file_name : file_names) {
get_input_file(file_name, [&](istream& in) {
stream::for_each_parallel(in, lambda);
});
}
index.flush();
index.close();
}
if (dump_alignments) {
vector<Alignment> output_buf;
index.open_read_only(rocksdb_name);
auto lambda = [&output_buf](const Alignment& aln) {
output_buf.push_back(aln);
stream::write_buffered(cout, output_buf, 100);
};
index.for_each_alignment(lambda);