commons-math3-3.6.1-org.apache.commons.math3.RealFieldElement<T>-中英对照文档及源码赏析
完整中文文档、中英对照文档下载请移步:commons-math3-中文文档、中英对照文档-CSDN下载
1. 开源组件说明
jar包名称:commons-math3-3.6.1.jar
Maven 依赖:
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.6.1</version>
</dependency>
完整中文文档、中英对照文档下载请移步:commons-math3-中文文档、中英对照文档-CSDN下载
本文介绍的类名:org.apache.commons.math3.RealFieldElement<T>
2. RealFieldElement<T>
中文-英语对照文档
接口 RealFieldElement<T>
-
-
Type Parameters:
-
T
- the type of the field elements
t - 现场元素的类型
-
All Superinterfaces:
-
FieldElement<T>
FieldElement
-
All Known Implementing Classes:
-
Decimal64,
DerivativeStructure,
Dfp,
DfpDec,
SparseGradient
DECIMAL64,DerivativeStucture,DFP,DFPDEC,SparseGradient
public interface RealFieldElement<T> extends FieldElement<T>
-
从以下版本开始:
-
3.2
3.2
另请参阅:
-
FieldElement
FieldElement.
-
-
-
方法概要
Methods 限定符和类型 方法和说明 T
abs()
absolute value.
绝对值。
T
acos()
Arc cosine operation.
弧余弦操作。
T
acosh()
Inverse hyperbolic cosine operation.
反向双曲余弦操作。
T
add(double a)
'+' operator.
'+'运营商。
T
asin()
Arc sine operation.
电弧正弦操作。
T
asinh()
Inverse hyperbolic sine operation.
反转双曲正弦操作。
T
atan()
Arc tangent operation.
电弧切线操作。
T
atan2(T x)
Two arguments arc tangent operation.
两个参数arc切线操作。
T
atanh()
Inverse hyperbolic tangent operation.
反向双曲线切线操作。
T
cbrt()
Cubic root.
立方根。
T
ceil()
Get the smallest whole number larger than instance.
获得比实例大的最小整数。
T
copySign(double sign)
Returns the instance with the sign of the argument.
使用参数的符号返回实例。
T
copySign(T sign)
Returns the instance with the sign of the argument.
使用参数的符号返回实例。
T
cos()
Cosine operation.
余弦运行。
T
cosh()
Hyperbolic cosine operation.
双曲线余弦操作。
T
divide(double a)
'÷' operator.
'÷'运营商。
T
exp()
Exponential.
指数。
T
expm1()
Exponential minus 1.
指数减去1。
T
floor()
Get the largest whole number smaller than instance.
获得比实例小的最大数量。
double
getReal()
Get the real value of the number.
获得数字的实际值。
T
hypot(T y)
Returns the hypotenuse of a triangle with sidesthis
andy
- sqrt( this 2 + y 2) avoiding intermediate overflow or underflow.
返回三角形的斜边,与侧面和Y - SQRT(This2 + Y2)避免中间溢出或下溢。
T
linearCombination(double[] a, T[] b)
Compute a linear combination.
计算线性组合。
T
linearCombination(double a1, T b1, double a2, T b2)
Compute a linear combination.
计算线性组合。
T
linearCombination(double a1, T b1, double a2, T b2, double a3, T b3)
Compute a linear combination.
计算线性组合。
T
linearCombination(double a1, T b1, double a2, T b2, double a3, T b3, double a4, T b4)
Compute a linear combination.
计算线性组合。
T
linearCombination(T[] a, T[] b)
Compute a linear combination.
计算线性组合。
T
linearCombination(T a1, T b1, T a2, T b2)
Compute a linear combination.
计算线性组合。
T
linearCombination(T a1, T b1, T a2, T b2, T a3, T b3)
Compute a linear combination.
计算线性组合。
T
linearCombination(T a1, T b1, T a2, T b2, T a3, T b3, T a4, T b4)
Compute a linear combination.
计算线性组合。
T
log()
Natural logarithm.
自然对数。
T
log1p()
Shifted natural logarithm.
移动自然对数。
T
multiply(double a)
'×' operator.
'×'算子。
T
pow(double p)
Power operation.
电源操作。
T
pow(int n)
Integer power operation.
整数电源操作。
T
pow(T e)
Power operation.
电源操作。
T
reciprocal()
Returns the multiplicative inverse ofthis
element.
返回此元素的乘法倒数。
T
remainder(double a)
IEEE remainder operator.
IEEE剩余的运营商。
T
remainder(T a)
IEEE remainder operator.
IEEE剩余的运营商。
T
rint()
Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers.
获取最接近实例的整个数字,或者如果x在两个整数之间正好一半。
T
rootN(int n)
N th root.
第n根。
long
round()
Get the closest long to instance value.
获得最接近的时间达实例值。
T
scalb(int n)
Multiply the instance by a power of 2.
将实例乘以2的功率。
T
signum()
Compute the signum of the instance.
计算实例的Signum。
T
sin()
Sine operation.
正弦操作。
T
sinh()
Hyperbolic sine operation.
双曲正弦操作。
T
sqrt()
Square root.
平方根。
T
subtract(double a)
'-' operator.
'-' 操作员。
T
tan()
Tangent operation.
切线操作。
T
tanh()
Hyperbolic tangent operation.
双曲线切线操作。
-
Methods inherited from interface org.apache.commons.math3.FieldElement
add, divide, getField, multiply, multiply, negate, subtract
-
-
-
-
方法详细说明
getReal
double getReal()
Get the real value of the number.
获得数字的实际值。
-
返回:
-
real value
实际价值
-
real value
add
T add(double a)
'+' operator.
'+'运营商。
-
参数:
-
a
- right hand side parameter of the operator
操作员的右手侧参数
返回:
-
this+a
这个+ A.
-
subtract
T subtract(double a)
'-' operator.
'-' 操作员。
-
参数:
-
a
- right hand side parameter of the operator
操作员的右手侧参数
返回:
-
this-a
这是
-
multiply
T multiply(double a)
'×' operator.
'×'算子。
-
参数:
-
a
- right hand side parameter of the operator
操作员的右手侧参数
返回:
-
this×a
这个×A.
-
divide
T divide(double a)
'÷' operator.
'÷'运营商。
-
参数:
-
a
- right hand side parameter of the operator
操作员的右手侧参数
返回:
-
this÷a
这个÷啊
-
remainder
T remainder(double a)
IEEE remainder operator.
IEEE剩余的运营商。
-
参数:
-
a
- right hand side parameter of the operator
操作员的右手侧参数
返回:
-
this - n × a where n is the closest integer to this/a (the even integer is chosen for n if this/a is halfway between two integers)
这个 - n×a其中n是最接近的整数/ a(如果这个/ a在两个整数之间是半途的,则选择偶数整数)
-
remainder
T remainder(T a) throws DimensionMismatchException
IEEE remainder operator.
IEEE剩余的运营商。
-
参数:
-
a
- right hand side parameter of the operator
操作员的右手侧参数
返回:
-
this - n × a where n is the closest integer to this/a (the even integer is chosen for n if this/a is halfway between two integers)
这个 - n×a其中n是最接近的整数/ a(如果这个/ a在两个整数之间是半途的,则选择偶数整数)
抛出:
-
DimensionMismatchException
- if number of free parameters or orders are inconsistent
DimensionMismatchException - 如果免费参数或订单的数量不一致
-
abs
T abs()
absolute value.
绝对值。
-
返回:
-
abs(this)
ABS(这)
-
abs(this)
ceil
T ceil()
Get the smallest whole number larger than instance.
获得比实例大的最小整数。
-
返回:
-
ceil(this)
CEIL(这)
-
ceil(this)
floor
T floor()
Get the largest whole number smaller than instance.
获得比实例小的最大数量。
-
返回:
-
floor(this)
地板(这)
-
floor(this)
rint
T rint()
Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers.
获取最接近实例的整个数字,或者如果x在两个整数之间正好一半。
-
返回:
-
a double number r such that r is an integer r - 0.5 ≤ this ≤ r + 0.5
双数R,使R是整数R - 0.5≤这≤R+ 0.5
-
a double number r such that r is an integer r - 0.5 ≤ this ≤ r + 0.5
round
long round()
Get the closest long to instance value.
获得最接近的时间达实例值。
-
返回:
-
closest long to
getReal()
最近的渴望()
-
closest long to
signum
T signum()
Compute the signum of the instance. The signum is -1 for negative numbers, +1 for positive numbers and 0 otherwise
计算实例的Signum。Signum为-1用于负数,+1为正数,否则为0
-
返回:
-
-1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a
-1.0,-0.0,+0.0,+1.0或NaN取决于a的标志
-
-1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a
copySign
T copySign(T sign)
Returns the instance with the sign of the argument. A NaNsign
argument is treated as positive.
使用参数的符号返回实例。NAN标志论证被视为积极。
-
参数:
-
sign
- the sign for the returned value
签署 - 返回值的标志
返回:
-
the instance with the same sign as the
sign
argument
具有与标志参数相同的符号的实例
-
copySign
T copySign(double sign)
Returns the instance with the sign of the argument. A NaNsign
argument is treated as positive.
使用参数的符号返回实例。NAN标志论证被视为积极。
-
参数:
-
sign
- the sign for the returned value
签署 - 返回值的标志
返回:
-
the instance with the same sign as the
sign
argument
具有与标志参数相同的符号的实例
-
scalb
T scalb(int n)
Multiply the instance by a power of 2.
将实例乘以2的功率。
-
参数:
-
n
- power of 2
n - 力量为2
返回:
-
this × 2
n
这个×2n.
-
hypot
T hypot(T y) throws DimensionMismatchException
Returns the hypotenuse of a triangle with sidesthis
andy
- sqrt( this 2 + y 2) avoiding intermediate overflow or underflow.- If either argument is infinite, then the result is positive infinity.
- else, if either argument is NaN then the result is NaN.
返回三角形的斜边,与侧面和Y - SQRT(This2 + Y2)避免中间溢出或下溢。如果任一参数是无限的,那么结果是正无穷大。否则,如果任一参数是NaN,那么结果是NaN。
-
参数:
-
y
- a value
y - 一个值
返回:
-
sqrt(
this
2 +
y
2)
SQRT(this2 + y2)
抛出:
-
DimensionMismatchException
- if number of free parameters or orders are inconsistent
DimensionMismatchException - 如果免费参数或订单的数量不一致
reciprocal
T reciprocal()
Returns the multiplicative inverse ofthis
element.
返回此元素的乘法倒数。
-
指定者:
-
reciprocal
in interfaceFieldElement<T>
互联互联器FieldElement
返回:
-
the inverse of
this
.
这方面的反向。
-
sqrt
T sqrt()
Square root.
平方根。
-
返回:
-
square root of the instance
实例的平方根
-
square root of the instance
cbrt
T cbrt()
Cubic root.
立方根。
-
返回:
-
cubic root of the instance
实例的立方根
-
cubic root of the instance
rootN
T rootN(int n)
N th root.
第n根。
-
参数:
-
n
- order of the root
n - root的顺序
返回:
-
n
th root of the instance
实例的第n个根
-
pow
T pow(double p)
Power operation.
电源操作。
-
参数:
-
p
- power to apply
P - 申请权力
返回:
-
this
p
这个
-
pow
T pow(int n)
Integer power operation.
整数电源操作。
-
参数:
-
n
- power to apply
n - 申请的力量
返回:
-
this
n
本来
-
pow
T pow(T e) throws DimensionMismatchException
Power operation.
电源操作。
-
参数:
-
e
- exponent
E - 指数
返回:
-
this
e
这件事
抛出:
-
DimensionMismatchException
- if number of free parameters or orders are inconsistent
DimensionMismatchException - 如果免费参数或订单的数量不一致
-
exp
T exp()
Exponential.
指数。
-
返回:
-
exponential of the instance
实例的指数
-
exponential of the instance
expm1
T expm1()
Exponential minus 1.
指数减去1。
-
返回:
-
exponential minus one of the instance
指数减去其中一个实例
-
exponential minus one of the instance
log
T log()
Natural logarithm.
自然对数。
-
返回:
-
logarithm of the instance
实例的对数
-
logarithm of the instance
log1p
T log1p()
Shifted natural logarithm.
移动自然对数。
-
返回:
-
logarithm of one plus the instance
一个加上实例的对数
-
logarithm of one plus the instance
cos
T cos()
Cosine operation.
余弦运行。
-
返回:
-
cos(this)
Cos(这)
-
cos(this)
sin
T sin()
Sine operation.
正弦操作。
-
返回:
-
sin(this)
罪(这)
-
sin(this)
tan
T tan()
Tangent operation.
切线操作。
-
返回:
-
tan(this)
棕褐色(这)
-
tan(this)
acos
T acos()
Arc cosine operation.
弧余弦操作。
-
返回:
-
acos(this)
ACOS(这)
-
acos(this)
asin
T asin()
Arc sine operation.
电弧正弦操作。
-
返回:
-
asin(this)
asin(这)
-
asin(this)
atan
T atan()
Arc tangent operation.
电弧切线操作。
-
返回:
-
atan(this)
atan(这)
-
atan(this)
atan2
T atan2(T x) throws DimensionMismatchException
Two arguments arc tangent operation.
两个参数arc切线操作。
-
参数:
-
x
- second argument of the arc tangent
X - 弧形切线的第二个论点
返回:
-
atan2(this, x)
atan2(这个,x)
抛出:
-
DimensionMismatchException
- if number of free parameters or orders are inconsistent
DimensionMismatchException - 如果免费参数或订单的数量不一致
-
cosh
T cosh()
Hyperbolic cosine operation.
双曲线余弦操作。
-
返回:
-
cosh(this)
Cosh(这个)
-
cosh(this)
sinh
T sinh()
Hyperbolic sine operation.
双曲正弦操作。
-
返回:
-
sinh(this)
sinh(这)
-
sinh(this)
tanh
T tanh()
Hyperbolic tangent operation.
双曲线切线操作。
-
返回:
-
tanh(this)
Tanh(这个)
-
tanh(this)
acosh
T acosh()
Inverse hyperbolic cosine operation.
反向双曲余弦操作。
-
返回:
-
acosh(this)
Acosh(这个)
-
acosh(this)
asinh
T asinh()
Inverse hyperbolic sine operation.
反转双曲正弦操作。
-
返回:
-
asin(this)
asin(这)
-
asin(this)
atanh
T atanh()
Inverse hyperbolic tangent operation.
反向双曲线切线操作。
-
返回:
-
atanh(this)
atanh(这)
-
atanh(this)
linearCombination
T linearCombination(T[] a, T[] b) throws DimensionMismatchException
Compute a linear combination.
计算线性组合。
-
参数:
-
a
- Factors.
a - 因素。
-
b
- Factors.
B - 因素。
返回:
-
Σi ai bi
.
Σiai bi。
抛出:
-
DimensionMismatchException
- if arrays dimensions don't match
DimensionMismatchException - 如果阵列尺寸不匹配
从以下版本开始:
-
3.2
3.2
-
linearCombination
T linearCombination(double[] a, T[] b) throws DimensionMismatchException
Compute a linear combination.
计算线性组合。
-
参数:
-
a
- Factors.
a - 因素。
-
b
- Factors.
B - 因素。
返回:
-
Σi ai bi
.
Σiai bi。
抛出:
-
DimensionMismatchException
- if arrays dimensions don't match
DimensionMismatchException - 如果阵列尺寸不匹配
从以下版本开始:
-
3.2
3.2
-
linearCombination
T linearCombination(T a1, T b1, T a2, T b2)
Compute a linear combination.
计算线性组合。
-
参数:
-
a1
- first factor of the first term
A1 - 第一项的第一因素
-
b1
- second factor of the first term
B1 - 第一个术语的第二个因素
-
a2
- first factor of the second term
A2 - 第二项的第一因素
-
b2
- second factor of the second term
B2 - 第二项的第二个因素
返回:
-
a
1×b
1 + a
2×b
2
A1×B1 + A2×B2
从以下版本开始:
-
3.2
3.2
另请参阅:
-
linearCombination(Object, Object, Object, Object, Object, Object)
,linearCombination(Object, Object, Object, Object, Object, Object, Object, Object)
Linearcomination(对象,对象,对象,对象,对象,对象),linearcomination(对象,对象,对象,对象,对象,对象,对象,对象)
-
linearCombination
T linearCombination(double a1, T b1, double a2, T b2)
Compute a linear combination.
计算线性组合。
-
参数:
-
a1
- first factor of the first term
A1 - 第一项的第一因素
-
b1
- second factor of the first term
B1 - 第一个术语的第二个因素
-
a2
- first factor of the second term
A2 - 第二项的第一因素
-
b2
- second factor of the second term
B2 - 第二项的第二个因素
返回:
-
a
1×b
1 + a
2×b
2
A1×B1 + A2×B2
从以下版本开始:
-
3.2
3.2
另请参阅:
-
linearCombination(double, Object, double, Object, double, Object)
,linearCombination(double, Object, double, Object, double, Object, double, Object)
线性组合(双,对象,双,对象,双,对象),线性组合(双,对象,双,对象,双,对象,双,对象)
-
linearCombination
T linearCombination(T a1, T b1, T a2, T b2, T a3, T b3)
Compute a linear combination.
计算线性组合。
-
参数:
-
a1
- first factor of the first term
A1 - 第一项的第一因素
-
b1
- second factor of the first term
B1 - 第一个术语的第二个因素
-
a2
- first factor of the second term
A2 - 第二项的第一因素
-
b2
- second factor of the second term
B2 - 第二项的第二个因素
-
a3
- first factor of the third term
A3 - 第三个术语的第一因素
-
b3
- second factor of the third term
B3 - 第三个术语的第二个因素
返回:
-
a
1×b
1 + a
2×b
2 + a
3×b
3
A1×B1 + A2×B2 + A3×B3
从以下版本开始:
-
3.2
3.2
另请参阅:
-
linearCombination(Object, Object, Object, Object)
,linearCombination(Object, Object, Object, Object, Object, Object, Object, Object)
Linearcomination(对象,对象,对象,对象),linearcombination(对象,对象,对象,对象,对象,对象,对象,对象)
-
linearCombination
T linearCombination(double a1, T b1, double a2, T b2, double a3, T b3)
Compute a linear combination.
计算线性组合。
-
参数:
-
a1
- first factor of the first term
A1 - 第一项的第一因素
-
b1
- second factor of the first term
B1 - 第一个术语的第二个因素
-
a2
- first factor of the second term
A2 - 第二项的第一因素
-
b2
- second factor of the second term
B2 - 第二项的第二个因素
-
a3
- first factor of the third term
A3 - 第三个术语的第一因素
-
b3
- second factor of the third term
B3 - 第三个术语的第二个因素
返回:
-
a
1×b
1 + a
2×b
2 + a
3×b
3
A1×B1 + A2×B2 + A3×B3
从以下版本开始:
-
3.2
3.2
另请参阅:
-
linearCombination(double, Object, double, Object)
,linearCombination(double, Object, double, Object, double, Object, double, Object)
线性组合(双,对象,双,对象),线性组合(双,对象,双,对象,双,对象,双,对象)
-
linearCombination
T linearCombination(T a1, T b1, T a2, T b2, T a3, T b3, T a4, T b4)
Compute a linear combination.
计算线性组合。
-
参数:
-
a1
- first factor of the first term
A1 - 第一项的第一因素
-
b1
- second factor of the first term
B1 - 第一个术语的第二个因素
-
a2
- first factor of the second term
A2 - 第二项的第一因素
-
b2
- second factor of the second term
B2 - 第二项的第二个因素
-
a3
- first factor of the third term
A3 - 第三个术语的第一因素
-
b3
- second factor of the third term
B3 - 第三个术语的第二个因素
-
a4
- first factor of the third term
A4 - 第三个术语的第一因素
-
b4
- second factor of the third term
B4 - 第三个任期的第二个因素
返回:
-
a
1×b
1 + a
2×b
2 + a
3×b
3 + a
4×b
4
A1×B1 + A2×B2 + A3×B3 + A4×B4
从以下版本开始:
-
3.2
3.2
另请参阅:
-
linearCombination(Object, Object, Object, Object)
,linearCombination(Object, Object, Object, Object, Object, Object)
Linearcomination(对象,对象,对象,对象),linearcomination(对象,对象,对象,对象,对象,对象)
-
linearCombination
T linearCombination(double a1, T b1, double a2, T b2, double a3, T b3, double a4, T b4)
Compute a linear combination.
计算线性组合。
-
参数:
-
a1
- first factor of the first term
A1 - 第一项的第一因素
-
b1
- second factor of the first term
B1 - 第一个术语的第二个因素
-
a2
- first factor of the second term
A2 - 第二项的第一因素
-
b2
- second factor of the second term
B2 - 第二项的第二个因素
-
a3
- first factor of the third term
A3 - 第三个术语的第一因素
-
b3
- second factor of the third term
B3 - 第三个术语的第二个因素
-
a4
- first factor of the third term
A4 - 第三个术语的第一因素
-
b4
- second factor of the third term
B4 - 第三个任期的第二个因素
返回:
-
a
1×b
1 + a
2×b
2 + a
3×b
3 + a
4×b
4
A1×B1 + A2×B2 + A3×B3 + A4×B4
从以下版本开始:
-
3.2
3.2
另请参阅:
-
linearCombination(double, Object, double, Object)
,linearCombination(double, Object, double, Object, double, Object)
线性组合(双,对象,双,对象),线性组合(双,对象,双,对象,双,对象)
-
-
3. 源码赏析
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3;
import org.apache.commons.math3.exception.DimensionMismatchException;
/**
* Interface representing a <a href="http://mathworld.wolfram.com/RealNumber.html">real</a>
* <a href="http://mathworld.wolfram.com/Field.html">field</a>.
* @param <T> the type of the field elements
* @see FieldElement
* @since 3.2
*/
public interface RealFieldElement<T> extends FieldElement<T> {
/** Get the real value of the number.
* @return real value
*/
double getReal();
/** '+' operator.
* @param a right hand side parameter of the operator
* @return this+a
*/
T add(double a);
/** '-' operator.
* @param a right hand side parameter of the operator
* @return this-a
*/
T subtract(double a);
/** '×' operator.
* @param a right hand side parameter of the operator
* @return this×a
*/
T multiply(double a);
/** '÷' operator.
* @param a right hand side parameter of the operator
* @return this÷a
*/
T divide(double a);
/** IEEE remainder operator.
* @param a right hand side parameter of the operator
* @return this - n × a where n is the closest integer to this/a
* (the even integer is chosen for n if this/a is halfway between two integers)
*/
T remainder(double a);
/** IEEE remainder operator.
* @param a right hand side parameter of the operator
* @return this - n × a where n is the closest integer to this/a
* (the even integer is chosen for n if this/a is halfway between two integers)
* @exception DimensionMismatchException if number of free parameters or orders are inconsistent
*/
T remainder(T a)
throws DimensionMismatchException;
/** absolute value.
* @return abs(this)
*/
T abs();
/** Get the smallest whole number larger than instance.
* @return ceil(this)
*/
T ceil();
/** Get the largest whole number smaller than instance.
* @return floor(this)
*/
T floor();
/** Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers.
* @return a double number r such that r is an integer r - 0.5 ≤ this ≤ r + 0.5
*/
T rint();
/** Get the closest long to instance value.
* @return closest long to {@link #getReal()}
*/
long round();
/** Compute the signum of the instance.
* The signum is -1 for negative numbers, +1 for positive numbers and 0 otherwise
* @return -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a
*/
T signum();
/**
* Returns the instance with the sign of the argument.
* A NaN {@code sign} argument is treated as positive.
*
* @param sign the sign for the returned value
* @return the instance with the same sign as the {@code sign} argument
*/
T copySign(T sign);
/**
* Returns the instance with the sign of the argument.
* A NaN {@code sign} argument is treated as positive.
*
* @param sign the sign for the returned value
* @return the instance with the same sign as the {@code sign} argument
*/
T copySign(double sign);
/**
* Multiply the instance by a power of 2.
* @param n power of 2
* @return this × 2<sup>n</sup>
*/
T scalb(int n);
/**
* Returns the hypotenuse of a triangle with sides {@code this} and {@code y}
* - sqrt(<i>this</i><sup>2</sup> +<i>y</i><sup>2</sup>)
* avoiding intermediate overflow or underflow.
*
* <ul>
* <li> If either argument is infinite, then the result is positive infinity.</li>
* <li> else, if either argument is NaN then the result is NaN.</li>
* </ul>
*
* @param y a value
* @return sqrt(<i>this</i><sup>2</sup> +<i>y</i><sup>2</sup>)
* @exception DimensionMismatchException if number of free parameters or orders are inconsistent
*/
T hypot(T y)
throws DimensionMismatchException;
/** {@inheritDoc} */
T reciprocal();
/** Square root.
* @return square root of the instance
*/
T sqrt();
/** Cubic root.
* @return cubic root of the instance
*/
T cbrt();
/** N<sup>th</sup> root.
* @param n order of the root
* @return n<sup>th</sup> root of the instance
*/
T rootN(int n);
/** Power operation.
* @param p power to apply
* @return this<sup>p</sup>
*/
T pow(double p);
/** Integer power operation.
* @param n power to apply
* @return this<sup>n</sup>
*/
T pow(int n);
/** Power operation.
* @param e exponent
* @return this<sup>e</sup>
* @exception DimensionMismatchException if number of free parameters or orders are inconsistent
*/
T pow(T e)
throws DimensionMismatchException;
/** Exponential.
* @return exponential of the instance
*/
T exp();
/** Exponential minus 1.
* @return exponential minus one of the instance
*/
T expm1();
/** Natural logarithm.
* @return logarithm of the instance
*/
T log();
/** Shifted natural logarithm.
* @return logarithm of one plus the instance
*/
T log1p();
// TODO: add this method in 4.0, as it is not possible to do it in 3.2
// due to incompatibility of the return type in the Dfp class
// /** Base 10 logarithm.
// * @return base 10 logarithm of the instance
// */
// T log10();
/** Cosine operation.
* @return cos(this)
*/
T cos();
/** Sine operation.
* @return sin(this)
*/
T sin();
/** Tangent operation.
* @return tan(this)
*/
T tan();
/** Arc cosine operation.
* @return acos(this)
*/
T acos();
/** Arc sine operation.
* @return asin(this)
*/
T asin();
/** Arc tangent operation.
* @return atan(this)
*/
T atan();
/** Two arguments arc tangent operation.
* @param x second argument of the arc tangent
* @return atan2(this, x)
* @exception DimensionMismatchException if number of free parameters or orders are inconsistent
*/
T atan2(T x)
throws DimensionMismatchException;
/** Hyperbolic cosine operation.
* @return cosh(this)
*/
T cosh();
/** Hyperbolic sine operation.
* @return sinh(this)
*/
T sinh();
/** Hyperbolic tangent operation.
* @return tanh(this)
*/
T tanh();
/** Inverse hyperbolic cosine operation.
* @return acosh(this)
*/
T acosh();
/** Inverse hyperbolic sine operation.
* @return asin(this)
*/
T asinh();
/** Inverse hyperbolic tangent operation.
* @return atanh(this)
*/
T atanh();
/**
* Compute a linear combination.
* @param a Factors.
* @param b Factors.
* @return <code>Σ<sub>i</sub> a<sub>i</sub> b<sub>i</sub></code>.
* @throws DimensionMismatchException if arrays dimensions don't match
* @since 3.2
*/
T linearCombination(T[] a, T[] b)
throws DimensionMismatchException;
/**
* Compute a linear combination.
* @param a Factors.
* @param b Factors.
* @return <code>Σ<sub>i</sub> a<sub>i</sub> b<sub>i</sub></code>.
* @throws DimensionMismatchException if arrays dimensions don't match
* @since 3.2
*/
T linearCombination(double[] a, T[] b)
throws DimensionMismatchException;
/**
* Compute a linear combination.
* @param a1 first factor of the first term
* @param b1 second factor of the first term
* @param a2 first factor of the second term
* @param b2 second factor of the second term
* @return a<sub>1</sub>×b<sub>1</sub> +
* a<sub>2</sub>×b<sub>2</sub>
* @see #linearCombination(Object, Object, Object, Object, Object, Object)
* @see #linearCombination(Object, Object, Object, Object, Object, Object, Object, Object)
* @since 3.2
*/
T linearCombination(T a1, T b1, T a2, T b2);
/**
* Compute a linear combination.
* @param a1 first factor of the first term
* @param b1 second factor of the first term
* @param a2 first factor of the second term
* @param b2 second factor of the second term
* @return a<sub>1</sub>×b<sub>1</sub> +
* a<sub>2</sub>×b<sub>2</sub>
* @see #linearCombination(double, Object, double, Object, double, Object)
* @see #linearCombination(double, Object, double, Object, double, Object, double, Object)
* @since 3.2
*/
T linearCombination(double a1, T b1, double a2, T b2);
/**
* Compute a linear combination.
* @param a1 first factor of the first term
* @param b1 second factor of the first term
* @param a2 first factor of the second term
* @param b2 second factor of the second term
* @param a3 first factor of the third term
* @param b3 second factor of the third term
* @return a<sub>1</sub>×b<sub>1</sub> +
* a<sub>2</sub>×b<sub>2</sub> + a<sub>3</sub>×b<sub>3</sub>
* @see #linearCombination(Object, Object, Object, Object)
* @see #linearCombination(Object, Object, Object, Object, Object, Object, Object, Object)
* @since 3.2
*/
T linearCombination(T a1, T b1, T a2, T b2, T a3, T b3);
/**
* Compute a linear combination.
* @param a1 first factor of the first term
* @param b1 second factor of the first term
* @param a2 first factor of the second term
* @param b2 second factor of the second term
* @param a3 first factor of the third term
* @param b3 second factor of the third term
* @return a<sub>1</sub>×b<sub>1</sub> +
* a<sub>2</sub>×b<sub>2</sub> + a<sub>3</sub>×b<sub>3</sub>
* @see #linearCombination(double, Object, double, Object)
* @see #linearCombination(double, Object, double, Object, double, Object, double, Object)
* @since 3.2
*/
T linearCombination(double a1, T b1, double a2, T b2, double a3, T b3);
/**
* Compute a linear combination.
* @param a1 first factor of the first term
* @param b1 second factor of the first term
* @param a2 first factor of the second term
* @param b2 second factor of the second term
* @param a3 first factor of the third term
* @param b3 second factor of the third term
* @param a4 first factor of the third term
* @param b4 second factor of the third term
* @return a<sub>1</sub>×b<sub>1</sub> +
* a<sub>2</sub>×b<sub>2</sub> + a<sub>3</sub>×b<sub>3</sub> +
* a<sub>4</sub>×b<sub>4</sub>
* @see #linearCombination(Object, Object, Object, Object)
* @see #linearCombination(Object, Object, Object, Object, Object, Object)
* @since 3.2
*/
T linearCombination(T a1, T b1, T a2, T b2, T a3, T b3, T a4, T b4);
/**
* Compute a linear combination.
* @param a1 first factor of the first term
* @param b1 second factor of the first term
* @param a2 first factor of the second term
* @param b2 second factor of the second term
* @param a3 first factor of the third term
* @param b3 second factor of the third term
* @param a4 first factor of the third term
* @param b4 second factor of the third term
* @return a<sub>1</sub>×b<sub>1</sub> +
* a<sub>2</sub>×b<sub>2</sub> + a<sub>3</sub>×b<sub>3</sub> +
* a<sub>4</sub>×b<sub>4</sub>
* @see #linearCombination(double, Object, double, Object)
* @see #linearCombination(double, Object, double, Object, double, Object)
* @since 3.2
*/
T linearCombination(double a1, T b1, double a2, T b2, double a3, T b3, double a4, T b4);
}