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


Java FastMath.log10方法代码示例

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


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

示例1: SimpleNoiseDistribution

import org.apache.commons.math.util.FastMath; //导入方法依赖的package包/类
/**
 * Constructor.
 * 
 * @param peakList the peak list
 * 
 * @throws MathException thrown if a math error occurs
 */
public SimpleNoiseDistribution(HashMap<Double, Peak> peakList) throws MathException {

    ArrayList<Double> intensitiesLog = new ArrayList<Double>(peakList.size());
    for (Peak peak : peakList.values()) {
        double log = FastMath.log10(peak.intensity);
        intensitiesLog.add(log);
    }
    Collections.sort(intensitiesLog);
    intensityLogDistribution = NonSymmetricalNormalDistribution.getRobustNonSymmetricalNormalDistributionFromSortedList(intensitiesLog);

    orderedBins = new int[nBins - 1];
    pLog = new double[nBins - 1];
    binSize = 1.0 / nBins;

    for (int i = 1; i < nBins; i++) {
        double p = binSize * i;
        double x = intensityLogDistribution.getValueAtDescendingCumulativeProbability(p);
        orderedBins[i - 1] = (int) FastMath.pow(10, x);
        pLog[i - 1] = FastMath.log10(p);
    }
}
 
开发者ID:compomics,项目名称:compomics-utilities,代码行数:29,代码来源:SimpleNoiseDistribution.java

示例2: call

import org.apache.commons.math.util.FastMath; //导入方法依赖的package包/类
public static TypeFloat call(TypeFloat x) {
	Double val = x.getValue();
	if (val <= 0)
		throw new ExpressionFault.ValueError("argument must be positive");

	Double ret = FastMath.log10(val);
	return new TypeFloat(ret);
}
 
开发者ID:BrainTech,项目名称:jsignalml,代码行数:9,代码来源:Builtins.java

示例3: getInterpolationValues

import org.apache.commons.math.util.FastMath; //导入方法依赖的package包/类
/**
 * Returns the interpolation values for the given score histogram in the
 * form {a, b}.
 *
 * @param scoreHistogram the score histogram
 * @param useCache if true the interpolation values will be stored in the
 * histograms in cache
 *
 * @return the interpolation values for the given score histogram
 */
public double[] getInterpolationValues(HashMap<Integer, Integer> scoreHistogram, boolean useCache) {

    ArrayList<Integer> bins = new ArrayList<Integer>(scoreHistogram.keySet());
    Collections.sort(bins, Collections.reverseOrder());
    ArrayList<Double> evalueFunctionX = new ArrayList<Double>(scoreHistogram.size());
    ArrayList<Double> evalueFunctionY = new ArrayList<Double>(scoreHistogram.size());
    Integer currentSum = 0;
    for (Integer bin : bins) {
        Integer nInBin = scoreHistogram.get(bin);
        if (nInBin != null) {
            currentSum += nInBin;
        }
        if (currentSum > 0) {
            Double xValue = new Double(bin);
            xValue = FastMath.log10(xValue);
            evalueFunctionX.add(xValue);
            Double yValue = new Double(currentSum);
            yValue = FastMath.log10(yValue);
            evalueFunctionY.add(yValue);
        }
    }
    if (evalueFunctionX.size() <= 1) {
        return null;
    }
    RegressionStatistics regressionStatistics = LinearRegression.getSimpleLinearRegression(evalueFunctionX, evalueFunctionY);
    if (useCache) {
        Double roundedA = Util.roundDouble(regressionStatistics.a, 2);
        Double roundedB = Util.roundDouble(regressionStatistics.b, 2);
        Integer nA = as.get(roundedA);
        if (nA == null) {
            as.put(roundedA, 1);
        } else {
            as.put(roundedA, nA + 1);
        }
        Integer nB = bs.get(roundedB);
        if (nB == null) {
            bs.put(roundedB, 1);
        } else {
            bs.put(roundedB, nB + 1);
        }
    }
    return new double[]{regressionStatistics.a, regressionStatistics.b};
}
 
开发者ID:compomics,项目名称:compomics-utilities,代码行数:54,代码来源:HyperScore.java

示例4: value

import org.apache.commons.math.util.FastMath; //导入方法依赖的package包/类
/** {@inheritDoc} */
public double value(double x) {
    return FastMath.log10(x);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:5,代码来源:Log10.java


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