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


Java TDoubleArrayList.size方法代码示例

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


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

示例1: findCutPoint

import gnu.trove.list.array.TDoubleArrayList; //导入方法依赖的package包/类
public TreeNode findCutPoint() {
	List<TreeNode> _children = new ArrayList<TreeNode>();
	TDoubleArrayList scores = new TDoubleArrayList();
	Queue<TreeNode> q = new ArrayDeque<TreeNode>();
	q.add(this);
	while (!q.isEmpty()) {
		TreeNode c = q.poll();
		q.addAll(c.children);
		TreeNode p = c.getParent();
		if (p == null) {
			continue;
		}
		double aboveSize = fragment_size - c.size;
		if (aboveSize >= 3d || c.size >= 3d) {
			_children.add(c);
			scores.add(c.d / Math.min(aboveSize, c.size));
		}
	}
	TreeNode minc = null;
	double minScore = Double.MAX_VALUE;
	for (int i = 0; i < scores.size(); i++) {
		if (scores.get(i) < minScore) {
			minScore = scores.get(i);
			minc = _children.get(i);
		}
	}
	return minc;
}
 
开发者ID:artem-lysenko,项目名称:modularity,代码行数:29,代码来源:Dcut.java

示例2: _findCutPoint

import gnu.trove.list.array.TDoubleArrayList; //导入方法依赖的package包/类
public TreeNode _findCutPoint() {
	List<TreeNode> _children = new ArrayList<TreeNode>();
	TDoubleArrayList scores = new TDoubleArrayList();
	Queue<TreeNode> q = new ArrayDeque<TreeNode>();
	q.add(this);
	while (!q.isEmpty()) {
		TreeNode c = q.poll();
		q.addAll(c.children);
		TreeNode p = c.getParent();
		if (p == null) {
			continue;
		}
		double aboveSize = fragment_size - c.size;
		if (aboveSize >= minModuleSize || c.size >= minModuleSize) {
			_children.add(c);
			scores.add(c.d / Math.max(aboveSize, c.size));
		}
	}
	TreeNode maxc = null;
	double maxScore = Double.MIN_VALUE;
	for (int i = 0; i < scores.size(); i++) {
		if (scores.get(i) > maxScore) {
			maxScore = scores.get(i);
			maxc = _children.get(i);
		}
	}
	return maxc;
}
 
开发者ID:artem-lysenko,项目名称:modularity,代码行数:29,代码来源:Dcut.java

示例3: computeAccuracy

import gnu.trove.list.array.TDoubleArrayList; //导入方法依赖的package包/类
private double computeAccuracy(TDoubleArrayList posDistances, TDoubleArrayList negDistances, double thresh) {
	int correct = 0;
	for (int i = 0; i < posDistances.size(); i++) {
		if (posDistances.get(i) < thresh)
			correct++;
	}

	for (int i = 0; i < negDistances.size(); i++) {
		if (negDistances.get(i) >= thresh)
			correct++;
	}

	return (double) correct / (double) (posDistances.size() + negDistances.size());
}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:15,代码来源:LargeMarginDimensionalityReduction.java


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