本文整理汇总了C++中std::set::data方法的典型用法代码示例。如果您正苦于以下问题:C++ set::data方法的具体用法?C++ set::data怎么用?C++ set::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::set
的用法示例。
在下文中一共展示了set::data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
tmp_piece[l]='\0';
}
else {
for(int j=at;j<shiftTo;j++) tmp_piece[j-at]=base2char[t[j]];
tmp_piece[shiftTo-at]='\0';
}
for(int j=at;j<shiftTo;j++) fprintf(output_file, "%c", base2char[t[j]]);
if(check_target_repetitions) fprintf(output_file, ",direct-reverse:%d-%d,targetrepetitionsdirect-reverse:%d-%d\n", last_valid_direct_count, last_valid_reverse_count, last_valid_direct_count_target, last_valid_reverse_count_target);
else fprintf(output_file, ",direct-reverse:%d-%d\n", last_valid_direct_count, last_valid_reverse_count);
covering_pieces.insert(std::string(tmp_piece));
}
coverage+=shiftTo-at;
state=1;
}
else state=0;
at=shiftTo;
if(at>=trueStringLength) end=true;
}
// printf("\n\ncoverage: %d/%d\n", coverage, trueStringLength-1);
printf("%f\n", (double(coverage))/((double)(trueStringLength-1)));
if(fileoutput) {
fprintf(output_file, "\ncoverage: %d/%d\n", coverage, trueStringLength-1);
fprintf(output_file, "%f\n", (double(coverage))/((double)(trueStringLength-1)));
if(fclose(output_file)!=0) {
fprintf(stderr, "failed fclose of output");
exit(EXIT_FAILURE);
}
int search_index;
for(covering_pieces_ite=covering_pieces.begin();covering_pieces_ite!=covering_pieces.end();covering_pieces_ite++) {
fprintf(output_file_pieces, "SEGMENT: %s\n", covering_pieces_ite->data());
fprintf(output_file_pieces, "sources direct occurrences by starting index ");
initialize_new_match(search_source_direct);
search_index=0;
while((*covering_pieces_ite)[search_index]!='\0') search_source_direct->current_count=single_match(search_source_direct, char2base[(int)(*covering_pieces_ite)[search_index++]]);
fprintf(output_file_pieces, "(%d) :", search_source_direct->current_count);
if(search_source_direct->current_count>0) {
if(search_source_direct->current_node->leafId==0) {
//internal node
for(int i=search_source_direct->current_node->firstLeaf;i<=search_source_direct->current_node->lastLeaf;i++) {
fprintf(output_file_pieces, " %d", st_root->lastLeaf-st_leaves[i]->length);
}
}
else {
//leaf
fprintf(output_file_pieces, " %d", st_root->lastLeaf-search_source_direct->current_node->length);
}
}
fprintf(output_file_pieces, "\n");
fprintf(output_file_pieces, "sources reverse occurrences by starting index ");
initialize_new_match(search_source_reverse);
search_index=0;
while((*covering_pieces_ite)[search_index]!='\0') search_source_reverse->current_count=single_match(search_source_reverse, char2base[(int)(*covering_pieces_ite)[search_index++]]);
fprintf(output_file_pieces, "(%d) :", search_source_reverse->current_count);
if(search_source_reverse->current_count>0) {
if(search_source_reverse->current_node->leafId==0) {
//internal node
for(int i=search_source_reverse->current_node->firstLeaf;i<=search_source_reverse->current_node->lastLeaf;i++) {
fprintf(output_file_pieces, " %d", st_root->lastLeaf-st_leaves[i]->length);
}
}