本文整理汇总了C++中ProgressBar::childProgress方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgressBar::childProgress方法的具体用法?C++ ProgressBar::childProgress怎么用?C++ ProgressBar::childProgress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgressBar
的用法示例。
在下文中一共展示了ProgressBar::childProgress方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
#ifdef __linux__
gettimeofday(&start, NULL);
#endif
if(options::inputFormat == ""){
// try to determine the input format
if (options::fileName.compare(options::fileName.length() - 4, 4, ".sth") == 0){
if(options::verbose){
cerr << "Input format determined as stockholm" << endl;
}
options::inputFormat="sth";
} else if (options::fileName.compare(options::fileName.length() - 3, 3, ".fa") == 0 ||
options::fileName.compare(options::fileName.length() - 6, 6, ".fasta") == 0) {
if(options::verbose) {
cerr << "Input format determined as FASTA" << endl;
}
options::inputFormat="fa";
} else {
options::inputFormat = guessPhylipType(options::fileName);
if(options::verbose){
cerr << "Input format determined as phylip ";
if(options::inputFormat == "pa"){
cerr << "alignment" << endl;
} else {
cerr << "distance matrix" << endl;
}
}
}
}
dataloader* dl = NULL;
ProgressBar* pb = new ProgressBar();
if(options::inputFormat == "pd"){
//input is a distance matrix.
if(options::replicates > -1) {
cerr << "ERROR: Cannot perform bootstrapping with a distance matrix input." << endl;
exit(1);
}
distanceMatrixInput = true;
matrixSize = getMatrixSize();
} else {
dl = loadAlignment();
matrixSize = dl->getSequenceCount();
distanceMatrixInput = false;
}
if(options::outputFormat == "m") {
double memSize = getMemSize();
double requiredMemory = 0;
if(dl == NULL) {
cerr << "ERROR: Both input and output format is a distance matrix." << endl;
exit(1);
}
if(dl->type == DNA) {
requiredMemory += matrixSize * dl->getSequenceLength() / 2.0;
} else {
requiredMemory += matrixSize * dl->getSequenceLength();
}
requiredMemory += matrixSize * matrixSize * (double)sizeof(distType);
if(memSize < requiredMemory || options::cacheDir != "") {
//use a disk matrix
if(options::verbose) {
cerr << "Using disk based matrix" << endl;
}
computeDistanceMatrix(true, out, true, dl);
} else {
computeDistanceMatrix(false, out, true, dl);
}
} else {
if(options::replicates > -1) {
pb->childProgress(1.0 / (options::replicates + 1.0));
}
polytree* tree = computeTree(out, dl, pb);
if(options::replicates > -1) {
bootstrapTree(out, tree, dl, pb);
tree->serialize_tree(out);
} else {
tree->serialize_tree(out);
}
delete tree;
}
if(!distanceMatrixInput) {
delete dl;
}
delete pb;
if(options::verbose){
cerr << endl;
//printTime("Total running time:");
}
out.flush();
if(fileOutStream.is_open()) {
fileOutStream.close();
}
return 0;
}