本文整理汇总了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);
}
}
示例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);
}
示例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};
}
示例4: value
import org.apache.commons.math.util.FastMath; //导入方法依赖的package包/类
/** {@inheritDoc} */
public double value(double x) {
return FastMath.log10(x);
}