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


Java Statistics.get方法代码示例

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


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

示例1: MedianFilter

import de.erichseifert.gral.data.statistics.Statistics; //导入方法依赖的package包/类
public MedianFilter(Iterable<T> data, int windowSize) {
	filtered = new LinkedList<>();

	windowIterator = new WindowIterator<>(data.iterator(), windowSize);

	while (windowIterator.hasNext()) {
		List<T> window = windowIterator.next();
		Statistics windowStatistics = new Statistics(window);
		double median = windowStatistics.get(Statistics.MEDIAN);
		filtered.add(median);
	}
}
 
开发者ID:eseifert,项目名称:gral,代码行数:13,代码来源:MedianFilter.java

示例2: createRasterData

import de.erichseifert.gral.data.statistics.Statistics; //导入方法依赖的package包/类
/**
 * Takes a matrix of values and creates a new data source that stores the
 * values in (x, y, value) format.
 * @param data Original data source with values in each cell.
 * @return New data source with (x, y, value) columns
 */
@SuppressWarnings("unchecked")
public static DataSource createRasterData(DataSource data) {
	if (data == null) {
		throw new NullPointerException("Cannot convert null data source.");
	}

	DataTable coordsValueData =
		new DataTable(Double.class, Double.class, Double.class);

	// Generate pixel data with (x, y, value)
	Statistics stats = data.getStatistics();
	double min = stats.get(Statistics.MIN);
	double max = stats.get(Statistics.MAX);
	double range = max - min;
	int i = 0;
	for (Comparable<?> cell : data) {
		int x =  i%data.getColumnCount();
		int y = -i/data.getColumnCount();
		double v = Double.NaN;
		if (cell instanceof Number) {
			Number numericCell = (Number) cell;
			v = (numericCell.doubleValue() - min) / range;
		}
		coordsValueData.add((double) x, (double) y, v);
		i++;
	}
	return coordsValueData;
}
 
开发者ID:charles-cooper,项目名称:idylfin,代码行数:35,代码来源:RasterPlot.java

示例3: getStatistics

import de.erichseifert.gral.data.statistics.Statistics; //导入方法依赖的package包/类
/**
 * Returns the specified statistical information for this data.
 * @param key Requested Statistical information.
 * @return Calculated value.
 */
public double getStatistics(String key) {
	Statistics statistics = new Statistics(this);
	return statistics.get(key);
}
 
开发者ID:eseifert,项目名称:gral,代码行数:10,代码来源:DataAccessor.java


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