本文整理汇总了Java中org.apache.commons.math3.util.FastMath.log10方法的典型用法代码示例。如果您正苦于以下问题:Java FastMath.log10方法的具体用法?Java FastMath.log10怎么用?Java FastMath.log10使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.math3.util.FastMath
的用法示例。
在下文中一共展示了FastMath.log10方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: log10
import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** Computes base 10 logarithm of a derivative structure.
* @param operand array holding the operand
* @param operandOffset offset of the operand in its array
* @param result array where result must be stored (for
* base 10 logarithm the result array <em>cannot</em> be the input array)
* @param resultOffset offset of the result in its array
*/
public void log10(final double[] operand, final int operandOffset,
final double[] result, final int resultOffset) {
// create the function value and derivatives
double[] function = new double[1 + order];
function[0] = FastMath.log10(operand[operandOffset]);
if (order > 0) {
double inv = 1.0 / operand[operandOffset];
double xk = inv / FastMath.log(10.0);
for (int i = 1; i <= order; ++i) {
function[i] = xk;
xk *= -i * inv;
}
}
// apply function composition
compose(operand, operandOffset, function, result, resultOffset);
}
示例2: value
import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** {@inheritDoc} */
public double value(double x) {
return FastMath.log10(x);
}
示例3: log10
import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** Base 10 logarithm.
* @return base 10 logarithm of the instance
*/
public SparseGradient log10() {
return new SparseGradient(FastMath.log10(value), 1.0 / (FastMath.log(10.0) * value), derivatives);
}