Top Description Methods
org.apache.commons.math3

public Interface RealFieldElement<T>

extends FieldElement<T>
Known Direct Implementers
org.apache.commons.math3.analysis.differentiation.DerivativeStructure, org.apache.commons.math3.analysis.differentiation.SparseGradient, org.apache.commons.math3.dfp.Dfp, org.apache.commons.math3.util.Decimal64
Type Parameters
<T>
the type of the field elements
Imports
org.apache.commons.math3.exception.DimensionMismatchException

Interface representing a real field.
Since
3.2
See Also
FieldElement

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

abs(this)
abs
()

absolute value.

public T

Returns:

acos(this)
acos
()

Arc cosine operation.

public T

Returns:

acosh(this)
acosh
()

Inverse hyperbolic cosine operation.

public T

Returns:

this+a
add
(double
right hand side parameter of the operator
a
)

Redeclares org.apache.commons.math3.FieldElement.add.

'+' operator.

public T

Returns:

asin(this)
asin
()

Arc sine operation.

public T

Returns:

asin(this)
asinh
()

Inverse hyperbolic sine operation.

public T

Returns:

atan(this)
atan
()

Arc tangent operation.

public T

Returns:

atan2(this, x)
atan2
(T
second argument of the arc tangent
x
)

Two arguments arc tangent operation.

public T

Returns:

atanh(this)
atanh
()

Inverse hyperbolic tangent operation.

public T

Returns:

cubic root of the instance
cbrt
()

Cubic root.

public T

Returns:

ceil(this)
ceil
()

Get the smallest whole number larger than instance.

public T

Returns:

the instance with the same sign as the sign argument
copySign
(T
the sign for the returned value
sign
)

Returns the instance with the sign of the argument.

public T

Returns:

the instance with the same sign as the sign argument
copySign
(double
the sign for the returned value
sign
)

Returns the instance with the sign of the argument.

public T

Returns:

cos(this)
cos
()

Cosine operation.

public T

Returns:

cosh(this)
cosh
()

Hyperbolic cosine operation.

public T

Returns:

this÷a
divide
(double
right hand side parameter of the operator
a
)

Redeclares org.apache.commons.math3.FieldElement.divide.

'÷' operator.

public T

Returns:

exponential of the instance
exp
()

Exponential.

public T

Returns:

exponential minus one of the instance
expm1
()

Exponential minus 1.

public T

Returns:

floor(this)
floor
()

Get the largest whole number smaller than instance.

public double

Returns:

real value
getReal
()

Get the real value of the number.

public T

Returns:

sqrt(this2 +y2)
hypot
(T
a value
y
)

Returns the hypotenuse of a triangle with sides this and y - sqrt(this2 +y2) avoiding intermediate overflow or underflow.

public T

Returns:

Σi ai bi.
linearCombination
(T[]
Factors.
a
,
T[]
Factors.
b
)

Compute a linear combination.

public T

Returns:

Σi ai bi.
linearCombination
(double[]
Factors.
a
,
T[]
Factors.
b
)

Compute a linear combination.

public T

Returns:

a1×b1 + a2×b2
linearCombination
(T
first factor of the first term
a1
,
T
second factor of the first term
b1
,
T
first factor of the second term
a2
,
T
second factor of the second term
b2
)

Compute a linear combination.

public T

Returns:

a1×b1 + a2×b2
linearCombination
(double
first factor of the first term
a1
,
T
second factor of the first term
b1
,
double
first factor of the second term
a2
,
T
second factor of the second term
b2
)

Compute a linear combination.

public T

Returns:

a1×b1 + a2×b2 + a3×b3
linearCombination
(T
first factor of the first term
a1
,
T
second factor of the first term
b1
,
T
first factor of the second term
a2
,
T
second factor of the second term
b2
,
T
first factor of the third term
a3
,
T
second factor of the third term
b3
)

Compute a linear combination.

public T

Returns:

a1×b1 + a2×b2 + a3×b3
linearCombination
(double
first factor of the first term
a1
,
T
second factor of the first term
b1
,
double
first factor of the second term
a2
,
T
second factor of the second term
b2
,
double
first factor of the third term
a3
,
T
second factor of the third term
b3
)

Compute a linear combination.

public T

Returns:

a1×b1 + a2×b2 + a3×b3 + a4×b4
linearCombination
(T
first factor of the first term
a1
,
T
second factor of the first term
b1
,
T
first factor of the second term
a2
,
T
second factor of the second term
b2
,
T
first factor of the third term
a3
,
T
second factor of the third term
b3
,
T
first factor of the third term
a4
,
T
second factor of the third term
b4
)

Compute a linear combination.

public T

Returns:

a1×b1 + a2×b2 + a3×b3 + a4×b4
linearCombination
(double
first factor of the first term
a1
,
T
second factor of the first term
b1
,
double
first factor of the second term
a2
,
T
second factor of the second term
b2
,
double
first factor of the third term
a3
,
T
second factor of the third term
b3
,
double
first factor of the third term
a4
,
T
second factor of the third term
b4
)

Compute a linear combination.

public T

Returns:

logarithm of the instance
log
()

Natural logarithm.

public T

Returns:

logarithm of one plus the instance
log1p
()

Shifted natural logarithm.

public T

Returns:

this×a
multiply
(double
right hand side parameter of the operator
a
)

Redeclares org.apache.commons.math3.FieldElement.multiply.

'×' operator.

public T

Returns:

thisp
pow
(double
power to apply
p
)

Power operation.

public T

Returns:

thisn
pow
(int
power to apply
n
)

Integer power operation.

public T

Returns:

thise
pow
(T
exponent
e
)

Power operation.

public T
reciprocal()

Redeclares org.apache.commons.math3.FieldElement.reciprocal.

Returns the multiplicative inverse of this element.

public T

Returns:

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)
remainder
(double
right hand side parameter of the operator
a
)

IEEE remainder operator.

public T

Returns:

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)
remainder
(T
right hand side parameter of the operator
a
)

IEEE remainder operator.

public T

Returns:

a double number r such that r is an integer r - 0.5 ≤ this ≤ r + 0.5
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.

public T

Returns:

nth root of the instance
rootN
(int
order of the root
n
)

Nth root.

public long

Returns:

closest long to getReal()
round
()

Get the closest long to instance value.

public T

Returns:

this × 2n
scalb
(int
power of 2
n
)

Multiply the instance by a power of 2.

public T

Returns:

-1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a
signum
()

Compute the signum of the instance.

public T

Returns:

sin(this)
sin
()

Sine operation.

public T

Returns:

sinh(this)
sinh
()

Hyperbolic sine operation.

public T

Returns:

square root of the instance
sqrt
()

Square root.

public T

Returns:

this-a
subtract
(double
right hand side parameter of the operator
a
)

Redeclares org.apache.commons.math3.FieldElement.subtract.

'-' operator.

public T

Returns:

tan(this)
tan
()

Tangent operation.

public T

Returns:

tanh(this)
tanh
()

Hyperbolic tangent operation.

Inherited from org.apache.commons.math3.FieldElement:
getFieldmultiplynegate

Method Detail

absback to summary
public T abs()

absolute value.

Returns:T

abs(this)

acosback to summary
public T acos()

Arc cosine operation.

Returns:T

acos(this)

acoshback to summary
public T acosh()

Inverse hyperbolic cosine operation.

Returns:T

acosh(this)

addback to summary
public T add(double a)

Redeclares org.apache.commons.math3.FieldElement.add.

'+' operator.

Parameters
a:double

right hand side parameter of the operator

Returns:T

this+a

asinback to summary
public T asin()

Arc sine operation.

Returns:T

asin(this)

asinhback to summary
public T asinh()

Inverse hyperbolic sine operation.

Returns:T

asin(this)

atanback to summary
public T atan()

Arc tangent operation.

Returns:T

atan(this)

atan2back to summary
public T atan2(T x) throws DimensionMismatchException

Two arguments arc tangent operation.

Parameters
x:T

second argument of the arc tangent

Returns:T

atan2(this, x)

Exceptions
DimensionMismatchException:
if number of free parameters or orders are inconsistent
atanhback to summary
public T atanh()

Inverse hyperbolic tangent operation.

Returns:T

atanh(this)

cbrtback to summary
public T cbrt()

Cubic root.

Returns:T

cubic root of the instance

ceilback to summary
public T ceil()

Get the smallest whole number larger than instance.

Returns:T

ceil(this)

copySignback to summary
public T copySign(T sign)

Returns the instance with the sign of the argument. A NaN sign argument is treated as positive.

Parameters
sign:T

the sign for the returned value

Returns:T

the instance with the same sign as the sign argument

copySignback to summary
public T copySign(double sign)

Returns the instance with the sign of the argument. A NaN sign argument is treated as positive.

Parameters
sign:double

the sign for the returned value

Returns:T

the instance with the same sign as the sign argument

cosback to summary
public T cos()

Cosine operation.

Returns:T

cos(this)

coshback to summary
public T cosh()

Hyperbolic cosine operation.

Returns:T

cosh(this)

divideback to summary
public T divide(double a)

Redeclares org.apache.commons.math3.FieldElement.divide.

'÷' operator.

Parameters
a:double

right hand side parameter of the operator

Returns:T

this÷a

expback to summary
public T exp()

Exponential.

Returns:T

exponential of the instance

expm1back to summary
public T expm1()

Exponential minus 1.

Returns:T

exponential minus one of the instance

floorback to summary
public T floor()

Get the largest whole number smaller than instance.

Returns:T

floor(this)

getRealback to summary
public double getReal()

Get the real value of the number.

Returns:double

real value

hypotback to summary
public T hypot(T y) throws DimensionMismatchException

Returns the hypotenuse of a triangle with sides this and y - sqrt(this2 +y2) 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.
Parameters
y:T

a value

Returns:T

sqrt(this2 +y2)

Exceptions
DimensionMismatchException:
if number of free parameters or orders are inconsistent
linearCombinationback to summary
public T linearCombination(T[] a, T[] b) throws DimensionMismatchException

Compute a linear combination.

Parameters
a:T[]

Factors.

b:T[]

Factors.

Returns:T

Σi ai bi.

Exceptions
DimensionMismatchException:
if arrays dimensions don't match
Since
3.2
linearCombinationback to summary
public T linearCombination(double[] a, T[] b) throws DimensionMismatchException

Compute a linear combination.

Parameters
a:double[]

Factors.

b:T[]

Factors.

Returns:T

Σi ai bi.

Exceptions
DimensionMismatchException:
if arrays dimensions don't match
Since
3.2
linearCombinationback to summary
public T linearCombination(T a1, T b1, T a2, T b2)

Compute a linear combination.

Parameters
a1:T

first factor of the first term

b1:T

second factor of the first term

a2:T

first factor of the second term

b2:T

second factor of the second term

Returns:T

a1×b1 + a2×b2

Since
3.2
See Also
linearCombination(Object, Object, Object, Object, Object, Object), linearCombination(Object, Object, Object, Object, Object, Object, Object, Object)
linearCombinationback to summary
public T linearCombination(double a1, T b1, double a2, T b2)

Compute a linear combination.

Parameters
a1:double

first factor of the first term

b1:T

second factor of the first term

a2:double

first factor of the second term

b2:T

second factor of the second term

Returns:T

a1×b1 + a2×b2

Since
3.2
See Also
linearCombination(double, Object, double, Object, double, Object), linearCombination(double, Object, double, Object, double, Object, double, Object)
linearCombinationback to summary
public T linearCombination(T a1, T b1, T a2, T b2, T a3, T b3)

Compute a linear combination.

Parameters
a1:T

first factor of the first term

b1:T

second factor of the first term

a2:T

first factor of the second term

b2:T

second factor of the second term

a3:T

first factor of the third term

b3:T

second factor of the third term

Returns:T

a1×b1 + a2×b2 + a3×b3

Since
3.2
See Also
linearCombination(Object, Object, Object, Object), linearCombination(Object, Object, Object, Object, Object, Object, Object, Object)
linearCombinationback to summary
public T linearCombination(double a1, T b1, double a2, T b2, double a3, T b3)

Compute a linear combination.

Parameters
a1:double

first factor of the first term

b1:T

second factor of the first term

a2:double

first factor of the second term

b2:T

second factor of the second term

a3:double

first factor of the third term

b3:T

second factor of the third term

Returns:T

a1×b1 + a2×b2 + a3×b3

Since
3.2
See Also
linearCombination(double, Object, double, Object), linearCombination(double, Object, double, Object, double, Object, double, Object)
linearCombinationback to summary
public T linearCombination(T a1, T b1, T a2, T b2, T a3, T b3, T a4, T b4)

Compute a linear combination.

Parameters
a1:T

first factor of the first term

b1:T

second factor of the first term

a2:T

first factor of the second term

b2:T

second factor of the second term

a3:T

first factor of the third term

b3:T

second factor of the third term

a4:T

first factor of the third term

b4:T

second factor of the third term

Returns:T

a1×b1 + a2×b2 + a3×b3 + a4×b4

Since
3.2
See Also
linearCombination(Object, Object, Object, Object), linearCombination(Object, Object, Object, Object, Object, Object)
linearCombinationback to summary
public T linearCombination(double a1, T b1, double a2, T b2, double a3, T b3, double a4, T b4)

Compute a linear combination.

Parameters
a1:double

first factor of the first term

b1:T

second factor of the first term

a2:double

first factor of the second term

b2:T

second factor of the second term

a3:double

first factor of the third term

b3:T

second factor of the third term

a4:double

first factor of the third term

b4:T

second factor of the third term

Returns:T

a1×b1 + a2×b2 + a3×b3 + a4×b4

Since
3.2
See Also
linearCombination(double, Object, double, Object), linearCombination(double, Object, double, Object, double, Object)
logback to summary
public T log()

Natural logarithm.

Returns:T

logarithm of the instance

log1pback to summary
public T log1p()

Shifted natural logarithm.

Returns:T

logarithm of one plus the instance

multiplyback to summary
public T multiply(double a)

Redeclares org.apache.commons.math3.FieldElement.multiply.

'×' operator.

Parameters
a:double

right hand side parameter of the operator

Returns:T

this×a

powback to summary
public T pow(double p)

Power operation.

Parameters
p:double

power to apply

Returns:T

thisp

powback to summary
public T pow(int n)

Integer power operation.

Parameters
n:int

power to apply

Returns:T

thisn

powback to summary
public T pow(T e) throws DimensionMismatchException

Power operation.

Parameters
e:T

exponent

Returns:T

thise

Exceptions
DimensionMismatchException:
if number of free parameters or orders are inconsistent
reciprocalback to summary
public T reciprocal()

Redeclares org.apache.commons.math3.FieldElement.reciprocal.

Doc from org.apache.commons.math3.FieldElement.reciprocal.

Returns the multiplicative inverse of this element.

Returns:T

the inverse of this.

remainderback to summary
public T remainder(double a)

IEEE remainder operator.

Parameters
a:double

right hand side parameter of the operator

Returns:T

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)

remainderback to summary
public T remainder(T a) throws DimensionMismatchException

IEEE remainder operator.

Parameters
a:T

right hand side parameter of the operator

Returns:T

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)

Exceptions
DimensionMismatchException:
if number of free parameters or orders are inconsistent
rintback to summary
public 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.

Returns:T

a double number r such that r is an integer r - 0.5 ≤ this ≤ r + 0.5

rootNback to summary
public T rootN(int n)

Nth root.

Parameters
n:int

order of the root

Returns:T

nth root of the instance

roundback to summary
public long round()

Get the closest long to instance value.

Returns:long

closest long to getReal()

scalbback to summary
public T scalb(int n)

Multiply the instance by a power of 2.

Parameters
n:int

power of 2

Returns:T

this × 2n

signumback to summary
public T signum()

Compute the signum of the instance. The signum is -1 for negative numbers, +1 for positive numbers and 0 otherwise

Returns:T

-1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a

sinback to summary
public T sin()

Sine operation.

Returns:T

sin(this)

sinhback to summary
public T sinh()

Hyperbolic sine operation.

Returns:T

sinh(this)

sqrtback to summary
public T sqrt()

Square root.

Returns:T

square root of the instance

subtractback to summary
public T subtract(double a)

Redeclares org.apache.commons.math3.FieldElement.subtract.

'-' operator.

Parameters
a:double

right hand side parameter of the operator

Returns:T

this-a

tanback to summary
public T tan()

Tangent operation.

Returns:T

tan(this)

tanhback to summary
public T tanh()

Hyperbolic tangent operation.

Returns:T

tanh(this)