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


Java DoubleIterator.nextDouble方法代码示例

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


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

示例1: getProductMap

import it.unimi.dsi.fastutil.doubles.DoubleIterator; //导入方法依赖的package包/类
private Int2DoubleMap getProductMap(int uidx) {
    Int2DoubleOpenHashMap productMap = new Int2DoubleOpenHashMap();
    productMap.defaultReturnValue(0.0);

    if (data.useIteratorsPreferentially()) {
        IntIterator iidxs = data.getUidxIidxs(uidx);
        DoubleIterator ivs = data.getUidxVs(uidx);
        while (iidxs.hasNext()) {
            int iidx = iidxs.nextInt();
            double iv = ivs.nextDouble();
            IntIterator vidxs = data.getIidxUidxs(iidx);
            DoubleIterator vvs = data.getIidxVs(iidx);
            while (vidxs.hasNext()) {
                productMap.addTo(vidxs.nextInt(), iv * vvs.nextDouble());
            }
        }
    } else {
        data.getUidxPreferences(uidx)
                .forEach(ip -> data.getIidxPreferences(ip.v1)
                        .forEach(up -> productMap.addTo(up.v1, ip.v2 * up.v2)));
    }

    productMap.remove(uidx);

    return productMap;
}
 
开发者ID:RankSys,项目名称:RankSys,代码行数:27,代码来源:VectorSimilarity.java

示例2: getProductArray

import it.unimi.dsi.fastutil.doubles.DoubleIterator; //导入方法依赖的package包/类
private double[] getProductArray(int uidx) {
    double[] productArray = new double[data.numUsers()];

    if (data.useIteratorsPreferentially()) {
        IntIterator iidxs = data.getUidxIidxs(uidx);
        DoubleIterator ivs = data.getUidxVs(uidx);
        while (iidxs.hasNext()) {
            int iidx = iidxs.nextInt();
            double iv = ivs.nextDouble();
            IntIterator vidxs = data.getIidxUidxs(iidx);
            DoubleIterator vvs = data.getIidxVs(iidx);
            while (vidxs.hasNext()) {
                productArray[vidxs.nextInt()] += iv * vvs.nextDouble();
            }
        }
    } else {
        data.getUidxPreferences(uidx)
                .forEach(ip -> data.getIidxPreferences(ip.v1)
                        .forEach(up -> productArray[up.v1] += ip.v2 * up.v2));
    }

    productArray[uidx] = 0.0;

    return productArray;
}
 
开发者ID:RankSys,项目名称:RankSys,代码行数:26,代码来源:VectorSimilarity.java

示例3: getNorm2

import it.unimi.dsi.fastutil.doubles.DoubleIterator; //导入方法依赖的package包/类
private double getNorm2(int uidx) {
    if (data.useIteratorsPreferentially()) {
        DoubleIterator ivs = data.getUidxVs(uidx);
        double sum = 0;
        while (ivs.hasNext()) {
            double iv = ivs.nextDouble();
            sum += iv * iv;
        }
        return sum;
    } else {
        return data.getUidxPreferences(uidx)
                .mapToDouble(IdxPref::v2)
                .map(x -> x * x)
                .sum();
    }
}
 
开发者ID:RankSys,项目名称:RankSys,代码行数:17,代码来源:VectorSimilarity.java

示例4: isBad

import it.unimi.dsi.fastutil.doubles.DoubleIterator; //导入方法依赖的package包/类
@Override
public boolean isBad() {
	final DoubleIterator iterator = values.values().iterator();
	while (iterator.hasNext()) {
		final double value = iterator.nextDouble();
		if (Double.isNaN(value) || Double.isInfinite(value)) {
			return true;
		}
	}
	return false;
}
 
开发者ID:clic-lab,项目名称:spf,代码行数:12,代码来源:FastTreeHashVector.java

示例5: cosineProduct

import it.unimi.dsi.fastutil.doubles.DoubleIterator; //导入方法依赖的package包/类
private double cosineProduct(Object2DoubleMap<String> vector1, Object2DoubleMap<String> vector2) {
    double aa = 0, bb = 0, ab = 0;
    for(Object2DoubleMap.Entry<String> e : vector1.object2DoubleEntrySet()) {
        aa += e.getDoubleValue() * e.getDoubleValue();
        ab += e.getDoubleValue() * vector2.getDouble(e.getKey());
    }
    DoubleIterator di  = vector2.values().iterator();
    while(di.hasNext()) {
        double d = di.nextDouble();
        bb +=  d * d;
    }
    return ab / Math.sqrt(aa * bb);
}
 
开发者ID:jmccrae,项目名称:naisc,代码行数:14,代码来源:CLESAFeatureExtractor.java

示例6: isEqualTo

import it.unimi.dsi.fastutil.doubles.DoubleIterator; //导入方法依赖的package包/类
public Selection isEqualTo(DoubleColumn d) {
    Selection results = new BitmapBackedSelection();
    int i = 0;
    DoubleIterator doubleIterator = d.iterator();
    for (double doubles : data) {
        if (doubles == doubleIterator.nextDouble()) {
            results.add(i);
        }
        i++;
    }
    return results;
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:13,代码来源:DoubleColumn.java

示例7: isGreaterThan

import it.unimi.dsi.fastutil.doubles.DoubleIterator; //导入方法依赖的package包/类
public Selection isGreaterThan(DoubleColumn d) {
    Selection results = new BitmapBackedSelection();
    int i = 0;
    DoubleIterator doubleIterator = d.iterator();
    for (double doubles : data) {
        if (doubles > doubleIterator.nextDouble()) {
            results.add(i);
        }
        i++;
    }
    return results;
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:13,代码来源:DoubleColumn.java

示例8: isLessThan

import it.unimi.dsi.fastutil.doubles.DoubleIterator; //导入方法依赖的package包/类
public Selection isLessThan(DoubleColumn d) {
    Selection results = new BitmapBackedSelection();
    int i = 0;
    DoubleIterator doubleIterator = d.iterator();
    for (double doubles : data) {
        if (doubles < doubleIterator.nextDouble()) {
            results.add(i);
        }
        i++;
    }
    return results;
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:13,代码来源:DoubleColumn.java

示例9: numberOfNonZeroEntries

import it.unimi.dsi.fastutil.doubles.DoubleIterator; //导入方法依赖的package包/类
public int numberOfNonZeroEntries() {
	int n = 0;
	DoubleIterator values = values();
	while (values.hasNext())
		if (values.nextDouble() != 0)
			n++;
	return n;
}
 
开发者ID:corradomonti,项目名称:llamafur,代码行数:9,代码来源:Matrix.java

示例10: norm2

import it.unimi.dsi.fastutil.doubles.DoubleIterator; //导入方法依赖的package包/类
public double norm2() {
	double sumOfSquares = 0;
	DoubleIterator values = values();
	double v;
	while (values.hasNext()) {
		v = values.nextDouble();
		sumOfSquares += v * v;
	}
	return Math.sqrt(sumOfSquares);
}
 
开发者ID:corradomonti,项目名称:llamafur,代码行数:11,代码来源:Matrix.java

示例11: cutBelow

import it.unimi.dsi.fastutil.doubles.DoubleIterator; //导入方法依赖的package包/类
public void cutBelow(double k) {
    DoubleIterator iter = values().iterator();
    while (iter.hasNext()) {
        if (iter.nextDouble() < k)
            iter.remove();
    }
}
 
开发者ID:htools,项目名称:htools,代码行数:8,代码来源:FHashMapObjectDouble.java

示例12: cutAbove

import it.unimi.dsi.fastutil.doubles.DoubleIterator; //导入方法依赖的package包/类
public void cutAbove(double k) {
    DoubleIterator iter = values().iterator();
    while (iter.hasNext()) {
        if (iter.nextDouble() > k)
            iter.remove();
    }
}
 
开发者ID:htools,项目名称:htools,代码行数:8,代码来源:FHashMapObjectDouble.java

示例13: cutBelow

import it.unimi.dsi.fastutil.doubles.DoubleIterator; //导入方法依赖的package包/类
public void cutBelow(double k) {
    DoubleIterator iter = values().iterator();
    while (iter.hasNext()) {
        if (iter.nextDouble() < k) {
            iter.remove();
        }
    }
}
 
开发者ID:htools,项目名称:htools,代码行数:9,代码来源:FHashMapIntDouble.java

示例14: cutAbove

import it.unimi.dsi.fastutil.doubles.DoubleIterator; //导入方法依赖的package包/类
public void cutAbove(double k) {
    DoubleIterator iter = values().iterator();
    while (iter.hasNext()) {
        if (iter.nextDouble() > k) {
            iter.remove();
        }
    }
}
 
开发者ID:htools,项目名称:htools,代码行数:9,代码来源:FHashMapIntDouble.java


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