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


Java ResultUtil.removeRecursive方法代码示例

本文整理汇总了Java中de.lmu.ifi.dbs.elki.result.ResultUtil.removeRecursive方法的典型用法代码示例。如果您正苦于以下问题:Java ResultUtil.removeRecursive方法的具体用法?Java ResultUtil.removeRecursive怎么用?Java ResultUtil.removeRecursive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在de.lmu.ifi.dbs.elki.result.ResultUtil的用法示例。


在下文中一共展示了ResultUtil.removeRecursive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: removePreviousRelation

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入方法依赖的package包/类
/**
 * Remove the previous relation.
 *
 * Manually also log index statistics, as we may be removing indexes.
 *
 * @param relation Relation to remove
 */
protected void removePreviousRelation(Relation<?> relation) {
  if(keep) {
    return;
  }
  boolean first = true;
  for(It<Index> it = relation.getHierarchy().iterDescendants(relation).filter(Index.class); it.valid(); it.advance()) {
    if(first) {
      Logging.getLogger(getClass()).statistics("Index statistics when removing initial data relation.");
      first = false;
    }
    it.get().logStatistics();
  }
  ResultUtil.removeRecursive(relation.getHierarchy(), relation);
}
 
开发者ID:elki-project,项目名称:elki,代码行数:22,代码来源:AbstractProjectionAlgorithm.java

示例2: run

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入方法依赖的package包/类
@Override
public void run() throws UnableToComplyException {
  // Force the logging level to include statistics, so we always see the
  // runtimes measured below.
  LoggingConfiguration.setStatistics();

  // Start a timer to measure overall runtime:
  MillisTimeDuration timerAll = new MillisTimeDuration("algorithm.runtime.all").begin();

  // We let the ELKI input step take care of loading the data
  // This way, the user can choose the file type, parser, add filters, and use
  // compressed files.
  Database database = input.getDatabase();

  // Create a progress bar (if -verbose is set).
  FiniteProgress progress = LOG.isVerbose() ? new FiniteProgress("Repetitions", repetitions, LOG) : null;
  MillisTimeDuration timer = new MillisTimeDuration("algorithm.runtime");
  for(int i = 0; i < repetitions; i++) {
    // Create our algorithm.
    // We want some extra control here, so we do this in plain Java:
    ExampleAlgorithm<NumberVector> alg = new ExampleAlgorithm<NumberVector>();

    // AbstractAlgorithm will choose the appropriate data relation
    // automatically, based on the data type information:
    timer.begin();
    Result result = alg.run(database);
    LOG.statistics(timer.end()); // Log the time taken.
    // Drop the result, to not leak memory across repetitions:
    ResultUtil.removeRecursive(database.getHierarchy(), result);

    LOG.incrementProcessed(progress);
  }
  // Close the progress bar
  LOG.ensureCompleted(progress);
  // Log the total runtime (including overhead!)
  LOG.statistics(timerAll.end());
  // Log the average runtime (including overhead!)
  LOG.statistics(new DoubleStatistic("algorithm.runtime.average", timerAll.getDuration() / (double) repetitions));
  // Log how many repetitions we did, for later analysis
  LOG.statistics(new LongStatistic("algorithm.repetitions", repetitions));
}
 
开发者ID:elki-project,项目名称:example-elki-project,代码行数:42,代码来源:ExampleApplication.java


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