当前位置: 首页>>代码示例>>C++>>正文


C++ ProgressBar::childProgress方法代码示例

本文整理汇总了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;
}
开发者ID:gabet1337,项目名称:bioinformatics,代码行数:101,代码来源:main.cpp


注:本文中的ProgressBar::childProgress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。