本文整理汇总了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;
}
示例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;
}
示例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());
}