Class Gradient
- java.lang.Object
-
- org.hipparchus.analysis.differentiation.Gradient
-
- All Implemented Interfaces:
Serializable
,Derivative<Gradient>
,CalculusFieldElement<Gradient>
,FieldElement<Gradient>
public class Gradient extends Object implements Derivative<Gradient>, CalculusFieldElement<Gradient>, Serializable
Class representing both the value and the differentials of a function.This class is a stripped-down version of
DerivativeStructure
withderivation order
limited to one. It should have less overhead thanDerivativeStructure
in its domain.This class is an implementation of Rall's numbers. Rall's numbers are an extension to the real numbers used throughout mathematical expressions; they hold the derivative together with the value of a function.
Gradient
instances can be used directly thanks to the arithmetic operators to the mathematical functions provided as methods by this class (+, -, *, /, %, sin, cos ...).Implementing complex expressions by hand using these classes is a tedious and error-prone task but has the advantage of having no limitation on the derivation order despite not requiring users to compute the derivatives by themselves.
Instances of this class are guaranteed to be immutable.
-
-
Constructor Summary
Constructors Constructor Description Gradient(double value, double... gradient)
Build an instance with values and derivative.Gradient(DerivativeStructure ds)
Build an instance from aDerivativeStructure
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Gradient
abs()
absolute value.Gradient
acos()
Arc cosine operation.Gradient
acosh()
Inverse hyperbolic cosine operation.Gradient
add(double a)
'+' operator.Gradient
add(Gradient a)
Compute this + a.Gradient
asin()
Arc sine operation.Gradient
asinh()
Inverse hyperbolic sine operation.Gradient
atan()
Arc tangent operation.Gradient
atan2(Gradient x)
Two arguments arc tangent operation.Gradient
atanh()
Inverse hyperbolic tangent operation.Gradient
cbrt()
Cubic root.Gradient
ceil()
Get the smallest whole number larger than instance.Gradient
compose(double... f)
Compute composition of the instance by a univariate function.static Gradient
constant(int freeParameters, double value)
Build an instance corresponding to a constant value.Gradient
copySign(double sign)
Returns the instance with the sign of the argument.Gradient
copySign(Gradient sign)
Returns the instance with the sign of the argument.Gradient
cos()
Cosine operation.Gradient
cosh()
Hyperbolic cosine operation.Gradient
divide(double a)
'÷' operator.Gradient
divide(Gradient a)
Compute this ÷ a.boolean
equals(Object other)
Test for the equality of two univariate derivatives.Gradient
exp()
Exponential.Gradient
expm1()
Exponential minus 1.Gradient
floor()
Get the largest whole number smaller than instance.int
getExponent()
Return the exponent of the instance, removing the bias.GradientField
getField()
Get theField
to which the instance belongs.int
getFreeParameters()
Get the number of free parameters.double[]
getGradient()
Get the gradient part of the function.int
getOrder()
Get the derivation order.double
getPartialDerivative(int n)
Get the partial derivative with respect to one parameter.double
getPartialDerivative(int... orders)
Get a partial derivative.Gradient
getPi()
Get the Archimedes constant π.double
getReal()
Get the real value of the number.double
getValue()
Get the value part of the function.int
hashCode()
Get a hashCode for the univariate derivative.Gradient
hypot(Gradient y)
Returns the hypotenuse of a triangle with sidesthis
andy
- sqrt(this2 +y2) avoiding intermediate overflow or underflow.Gradient
linearCombination(double[] a, Gradient[] b)
Compute a linear combination.Gradient
linearCombination(double a1, Gradient b1, double a2, Gradient b2)
Compute a linear combination.Gradient
linearCombination(double a1, Gradient b1, double a2, Gradient b2, double a3, Gradient b3)
Compute a linear combination.Gradient
linearCombination(double a1, Gradient b1, double a2, Gradient b2, double a3, Gradient b3, double a4, Gradient b4)
Compute a linear combination.Gradient
linearCombination(Gradient[] a, Gradient[] b)
Compute a linear combination.Gradient
linearCombination(Gradient a1, Gradient b1, Gradient a2, Gradient b2)
Compute a linear combination.Gradient
linearCombination(Gradient a1, Gradient b1, Gradient a2, Gradient b2, Gradient a3, Gradient b3)
Compute a linear combination.Gradient
linearCombination(Gradient a1, Gradient b1, Gradient a2, Gradient b2, Gradient a3, Gradient b3, Gradient a4, Gradient b4)
Compute a linear combination.Gradient
log()
Natural logarithm.Gradient
log10()
Base 10 logarithm.Gradient
log1p()
Shifted natural logarithm.Gradient
multiply(double a)
'×' operator.Gradient
multiply(int n)
Compute n × this.Gradient
multiply(Gradient a)
Compute this × a.Gradient
negate()
Returns the additive inverse ofthis
element.Gradient
newInstance(double c)
Create an instance corresponding to a constant real value.Gradient
pow(double p)
Power operation.static Gradient
pow(double a, Gradient x)
Compute ax where a is a double and x aGradient
Gradient
pow(int n)
Integer power operation.Gradient
pow(Gradient e)
Power operation.Gradient
reciprocal()
Returns the multiplicative inverse ofthis
element.Gradient
remainder(double a)
IEEE remainder operator.Gradient
remainder(Gradient a)
IEEE remainder operator.Gradient
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.Gradient
rootN(int n)
Nth root.Gradient
scalb(int n)
Multiply the instance by a power of 2.Gradient
sign()
Compute the sign of the instance.Gradient
sin()
Sine operation.FieldSinCos<Gradient>
sinCos()
Combined Sine and Cosine operation.Gradient
sinh()
Hyperbolic sine operation.FieldSinhCosh<Gradient>
sinhCosh()
Combined hyperbolic sine and sosine operation.Gradient
sqrt()
Square root.Gradient
subtract(double a)
'-' operator.Gradient
subtract(Gradient a)
Compute this - a.Gradient
tan()
Tangent operation.Gradient
tanh()
Hyperbolic tangent operation.double
taylor(double... delta)
Evaluate Taylor expansion a derivative structure.Gradient
toDegrees()
Convert radians to degrees, with error of less than 0.5 ULPDerivativeStructure
toDerivativeStructure()
Convert the instance to aDerivativeStructure
.Gradient
toRadians()
Convert degrees to radians, with error of less than 0.5 ULPGradient
ulp()
Compute least significant bit (Unit in Last Position) for a number.static Gradient
variable(int freeParameters, int index, double value)
Build aGradient
representing a variable.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hipparchus.CalculusFieldElement
isFinite, isInfinite, isNaN, norm, round
-
Methods inherited from interface org.hipparchus.FieldElement
isZero
-
-
-
-
Constructor Detail
-
Gradient
public Gradient(double value, double... gradient)
Build an instance with values and derivative.- Parameters:
value
- value of the functiongradient
- gradient of the function
-
Gradient
public Gradient(DerivativeStructure ds) throws MathIllegalArgumentException
Build an instance from aDerivativeStructure
.- Parameters:
ds
- derivative structure- Throws:
MathIllegalArgumentException
- ifds
order is not 1
-
-
Method Detail
-
constant
public static Gradient constant(int freeParameters, double value)
Build an instance corresponding to a constant value.- Parameters:
freeParameters
- number of free parameters (i.e. dimension of the gradient)value
- constant value of the function- Returns:
- a
Gradient
with a constant value and all derivatives set to 0.0
-
variable
public static Gradient variable(int freeParameters, int index, double value)
Build aGradient
representing a variable.Instances built using this method are considered to be the free variables with respect to which differentials are computed. As such, their differential with respect to themselves is +1.
- Parameters:
freeParameters
- number of free parameters (i.e. dimension of the gradient)index
- index of the variable (from 0 togetFreeParameters()
- 1)value
- value of the variable- Returns:
- a
Gradient
with a constant value and all derivatives set to 0.0 except the one atindex
which will be set to 1.0
-
newInstance
public Gradient newInstance(double c)
Create an instance corresponding to a constant real value.- Specified by:
newInstance
in interfaceCalculusFieldElement<Gradient>
- Parameters:
c
- constant real value- Returns:
- instance corresponding to a constant real value
-
getReal
public double getReal()
Get the real value of the number.- Specified by:
getReal
in interfaceFieldElement<Gradient>
- Returns:
- real value
-
getValue
public double getValue()
Get the value part of the function.- Specified by:
getValue
in interfaceDerivative<Gradient>
- Returns:
- value part of the value of the function
-
getGradient
public double[] getGradient()
Get the gradient part of the function.- Returns:
- gradient part of the value of the function
- See Also:
getPartialDerivative(int)
-
getFreeParameters
public int getFreeParameters()
Get the number of free parameters.- Specified by:
getFreeParameters
in interfaceDerivative<Gradient>
- Returns:
- number of free parameters
-
getOrder
public int getOrder()
Get the derivation order.- Specified by:
getOrder
in interfaceDerivative<Gradient>
- Returns:
- derivation order
-
getPartialDerivative
public double getPartialDerivative(int... orders) throws MathIllegalArgumentException
Get a partial derivative.- Specified by:
getPartialDerivative
in interfaceDerivative<Gradient>
- Parameters:
orders
- derivation orders with respect to each variable (if all orders are 0, the value is returned)- Returns:
- partial derivative
- Throws:
MathIllegalArgumentException
- if the numbers of variables does not match the instance- See Also:
Derivative.getValue()
-
getPartialDerivative
public double getPartialDerivative(int n) throws MathIllegalArgumentException
Get the partial derivative with respect to one parameter.- Parameters:
n
- index of the parameter (counting from 0)- Returns:
- partial derivative with respect to the nth parameter
- Throws:
MathIllegalArgumentException
- if n is either negative or larger or equal togetFreeParameters()
-
toDerivativeStructure
public DerivativeStructure toDerivativeStructure()
Convert the instance to aDerivativeStructure
.- Returns:
- derivative structure with same value and derivative as the instance
-
add
public Gradient add(double a)
'+' operator.- Specified by:
add
in interfaceCalculusFieldElement<Gradient>
- Parameters:
a
- right hand side parameter of the operator- Returns:
- this+a
-
add
public Gradient add(Gradient a)
Compute this + a.- Specified by:
add
in interfaceFieldElement<Gradient>
- Parameters:
a
- element to add- Returns:
- a new element representing this + a
-
subtract
public Gradient subtract(double a)
'-' operator.- Specified by:
subtract
in interfaceCalculusFieldElement<Gradient>
- Parameters:
a
- right hand side parameter of the operator- Returns:
- this-a
-
subtract
public Gradient subtract(Gradient a)
Compute this - a.- Specified by:
subtract
in interfaceFieldElement<Gradient>
- Parameters:
a
- element to subtract- Returns:
- a new element representing this - a
-
multiply
public Gradient multiply(int n)
Compute n × this. Multiplication by an integer number is defined as the following sum \[ n \times \mathrm{this} = \sum_{i=1}^n \mathrm{this} \]- Specified by:
multiply
in interfaceFieldElement<Gradient>
- Parameters:
n
- Number of timesthis
must be added to itself.- Returns:
- A new element representing n × this.
-
multiply
public Gradient multiply(double a)
'×' operator.- Specified by:
multiply
in interfaceCalculusFieldElement<Gradient>
- Parameters:
a
- right hand side parameter of the operator- Returns:
- this×a
-
multiply
public Gradient multiply(Gradient a)
Compute this × a.- Specified by:
multiply
in interfaceFieldElement<Gradient>
- Parameters:
a
- element to multiply- Returns:
- a new element representing this × a
-
divide
public Gradient divide(double a)
'÷' operator.- Specified by:
divide
in interfaceCalculusFieldElement<Gradient>
- Parameters:
a
- right hand side parameter of the operator- Returns:
- this÷a
-
divide
public Gradient divide(Gradient a)
Compute this ÷ a.- Specified by:
divide
in interfaceFieldElement<Gradient>
- Parameters:
a
- element to divide by- Returns:
- a new element representing this ÷ a
-
remainder
public Gradient remainder(double a)
IEEE remainder operator.- Specified by:
remainder
in interfaceCalculusFieldElement<Gradient>
- Parameters:
a
- right hand side parameter of the operator- Returns:
- this - n × a where n is the closest integer to this/a
-
remainder
public Gradient remainder(Gradient a)
IEEE remainder operator.- Specified by:
remainder
in interfaceCalculusFieldElement<Gradient>
- Parameters:
a
- right hand side parameter of the operator- Returns:
- this - n × a where n is the closest integer to this/a
-
negate
public Gradient negate()
Returns the additive inverse ofthis
element.- Specified by:
negate
in interfaceFieldElement<Gradient>
- Returns:
- the opposite of
this
.
-
abs
public Gradient abs()
absolute value.Just another name for
CalculusFieldElement.norm()
- Specified by:
abs
in interfaceCalculusFieldElement<Gradient>
- Returns:
- abs(this)
-
ceil
public Gradient ceil()
Get the smallest whole number larger than instance.- Specified by:
ceil
in interfaceCalculusFieldElement<Gradient>
- Returns:
- ceil(this)
-
floor
public Gradient floor()
Get the largest whole number smaller than instance.- Specified by:
floor
in interfaceCalculusFieldElement<Gradient>
- Returns:
- floor(this)
-
rint
public Gradient 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.- Specified by:
rint
in interfaceCalculusFieldElement<Gradient>
- Returns:
- a double number r such that r is an integer r - 0.5 ≤ this ≤ r + 0.5
-
sign
public Gradient sign()
Compute the sign of the instance. The sign is -1 for negative numbers, +1 for positive numbers and 0 otherwise, for Complex number, it is extended on the unit circle (equivalent to z/|z|, with special handling for 0 and NaN)- Specified by:
sign
in interfaceCalculusFieldElement<Gradient>
- Returns:
- -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a
-
copySign
public Gradient copySign(Gradient sign)
Returns the instance with the sign of the argument. A NaNsign
argument is treated as positive.- Specified by:
copySign
in interfaceCalculusFieldElement<Gradient>
- Parameters:
sign
- the sign for the returned value- Returns:
- the instance with the same sign as the
sign
argument
-
copySign
public Gradient copySign(double sign)
Returns the instance with the sign of the argument. A NaNsign
argument is treated as positive.- Specified by:
copySign
in interfaceCalculusFieldElement<Gradient>
- Parameters:
sign
- the sign for the returned value- Returns:
- the instance with the same sign as the
sign
argument
-
getExponent
public int getExponent()
Return the exponent of the instance, removing the bias.For double numbers of the form 2x, the unbiased exponent is exactly x.
- Specified by:
getExponent
in interfaceCalculusFieldElement<Gradient>
- Returns:
- exponent for the instance, without bias
-
scalb
public Gradient scalb(int n)
Multiply the instance by a power of 2.- Specified by:
scalb
in interfaceCalculusFieldElement<Gradient>
- Parameters:
n
- power of 2- Returns:
- this × 2n
-
ulp
public Gradient ulp()
Compute least significant bit (Unit in Last Position) for a number.The
ulp
function is a step function, hence all its derivatives are 0.- Specified by:
ulp
in interfaceCalculusFieldElement<Gradient>
- Returns:
- ulp(this)
- Since:
- 2.0
-
hypot
public Gradient hypot(Gradient y)
Returns the hypotenuse of a triangle with sidesthis
andy
- 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.
- Specified by:
hypot
in interfaceCalculusFieldElement<Gradient>
- Parameters:
y
- a value- Returns:
- sqrt(this2 +y2)
-
reciprocal
public Gradient reciprocal()
Returns the multiplicative inverse ofthis
element.- Specified by:
reciprocal
in interfaceCalculusFieldElement<Gradient>
- Specified by:
reciprocal
in interfaceFieldElement<Gradient>
- Returns:
- the inverse of
this
.
-
compose
public Gradient compose(double... f)
Compute composition of the instance by a univariate function.- Specified by:
compose
in interfaceDerivative<Gradient>
- Parameters:
f
- array of value and derivatives of the function at the current point (i.e. [f(Derivative.getValue()
), f'(Derivative.getValue()
), f''(Derivative.getValue()
)...]).- Returns:
- f(this)
-
sqrt
public Gradient sqrt()
Square root.- Specified by:
sqrt
in interfaceCalculusFieldElement<Gradient>
- Returns:
- square root of the instance
-
cbrt
public Gradient cbrt()
Cubic root.- Specified by:
cbrt
in interfaceCalculusFieldElement<Gradient>
- Returns:
- cubic root of the instance
-
rootN
public Gradient rootN(int n)
Nth root.- Specified by:
rootN
in interfaceCalculusFieldElement<Gradient>
- Parameters:
n
- order of the root- Returns:
- nth root of the instance
-
getField
public GradientField getField()
Get theField
to which the instance belongs.- Specified by:
getField
in interfaceFieldElement<Gradient>
- Returns:
Field
to which the instance belongs
-
pow
public static Gradient pow(double a, Gradient x)
Compute ax where a is a double and x aGradient
- Parameters:
a
- number to exponentiatex
- power to apply- Returns:
- ax
-
pow
public Gradient pow(double p)
Power operation.- Specified by:
pow
in interfaceCalculusFieldElement<Gradient>
- Parameters:
p
- power to apply- Returns:
- thisp
-
pow
public Gradient pow(int n)
Integer power operation.- Specified by:
pow
in interfaceCalculusFieldElement<Gradient>
- Parameters:
n
- power to apply- Returns:
- thisn
-
pow
public Gradient pow(Gradient e)
Power operation.- Specified by:
pow
in interfaceCalculusFieldElement<Gradient>
- Parameters:
e
- exponent- Returns:
- thise
-
exp
public Gradient exp()
Exponential.- Specified by:
exp
in interfaceCalculusFieldElement<Gradient>
- Returns:
- exponential of the instance
-
expm1
public Gradient expm1()
Exponential minus 1.- Specified by:
expm1
in interfaceCalculusFieldElement<Gradient>
- Returns:
- exponential minus one of the instance
-
log
public Gradient log()
Natural logarithm.- Specified by:
log
in interfaceCalculusFieldElement<Gradient>
- Returns:
- logarithm of the instance
-
log1p
public Gradient log1p()
Shifted natural logarithm.- Specified by:
log1p
in interfaceCalculusFieldElement<Gradient>
- Returns:
- logarithm of one plus the instance
-
log10
public Gradient log10()
Base 10 logarithm.- Specified by:
log10
in interfaceCalculusFieldElement<Gradient>
- Returns:
- base 10 logarithm of the instance
-
cos
public Gradient cos()
Cosine operation.- Specified by:
cos
in interfaceCalculusFieldElement<Gradient>
- Returns:
- cos(this)
-
sin
public Gradient sin()
Sine operation.- Specified by:
sin
in interfaceCalculusFieldElement<Gradient>
- Returns:
- sin(this)
-
sinCos
public FieldSinCos<Gradient> sinCos()
Combined Sine and Cosine operation.- Specified by:
sinCos
in interfaceCalculusFieldElement<Gradient>
- Returns:
- [sin(this), cos(this)]
-
tan
public Gradient tan()
Tangent operation.- Specified by:
tan
in interfaceCalculusFieldElement<Gradient>
- Returns:
- tan(this)
-
acos
public Gradient acos()
Arc cosine operation.- Specified by:
acos
in interfaceCalculusFieldElement<Gradient>
- Returns:
- acos(this)
-
asin
public Gradient asin()
Arc sine operation.- Specified by:
asin
in interfaceCalculusFieldElement<Gradient>
- Returns:
- asin(this)
-
atan
public Gradient atan()
Arc tangent operation.- Specified by:
atan
in interfaceCalculusFieldElement<Gradient>
- Returns:
- atan(this)
-
atan2
public Gradient atan2(Gradient x)
Two arguments arc tangent operation.Beware of the order or arguments! As this is based on a two-arguments functions, in order to be consistent with arguments order, the instance is the first argument and the single provided argument is the second argument. In order to be consistent with programming languages
atan2
, this method computesatan2(this, x)
, i.e. the instance represents they
argument and thex
argument is the one passed as a single argument. This may seem confusing especially for users of Wolfram alpha, as this site is not consistent with programming languagesatan2
two-arguments arc tangent and putsx
as its first argument.- Specified by:
atan2
in interfaceCalculusFieldElement<Gradient>
- Parameters:
x
- second argument of the arc tangent- Returns:
- atan2(this, x)
-
cosh
public Gradient cosh()
Hyperbolic cosine operation.- Specified by:
cosh
in interfaceCalculusFieldElement<Gradient>
- Returns:
- cosh(this)
-
sinh
public Gradient sinh()
Hyperbolic sine operation.- Specified by:
sinh
in interfaceCalculusFieldElement<Gradient>
- Returns:
- sinh(this)
-
sinhCosh
public FieldSinhCosh<Gradient> sinhCosh()
Combined hyperbolic sine and sosine operation.- Specified by:
sinhCosh
in interfaceCalculusFieldElement<Gradient>
- Returns:
- [sinh(this), cosh(this)]
-
tanh
public Gradient tanh()
Hyperbolic tangent operation.- Specified by:
tanh
in interfaceCalculusFieldElement<Gradient>
- Returns:
- tanh(this)
-
acosh
public Gradient acosh()
Inverse hyperbolic cosine operation.- Specified by:
acosh
in interfaceCalculusFieldElement<Gradient>
- Returns:
- acosh(this)
-
asinh
public Gradient asinh()
Inverse hyperbolic sine operation.- Specified by:
asinh
in interfaceCalculusFieldElement<Gradient>
- Returns:
- asin(this)
-
atanh
public Gradient atanh()
Inverse hyperbolic tangent operation.- Specified by:
atanh
in interfaceCalculusFieldElement<Gradient>
- Returns:
- atanh(this)
-
toDegrees
public Gradient toDegrees()
Convert radians to degrees, with error of less than 0.5 ULP- Specified by:
toDegrees
in interfaceCalculusFieldElement<Gradient>
- Returns:
- instance converted into degrees
-
toRadians
public Gradient toRadians()
Convert degrees to radians, with error of less than 0.5 ULP- Specified by:
toRadians
in interfaceCalculusFieldElement<Gradient>
- Returns:
- instance converted into radians
-
taylor
public double taylor(double... delta)
Evaluate Taylor expansion a derivative structure.- Parameters:
delta
- parameters offsets (Δx, Δy, ...)- Returns:
- value of the Taylor expansion at x + Δx, y + Δy, ...
-
linearCombination
public Gradient linearCombination(Gradient[] a, Gradient[] b)
Compute a linear combination.- Specified by:
linearCombination
in interfaceCalculusFieldElement<Gradient>
- Parameters:
a
- Factors.b
- Factors.- Returns:
Σi ai bi
.
-
linearCombination
public Gradient linearCombination(double[] a, Gradient[] b)
Compute a linear combination.- Specified by:
linearCombination
in interfaceCalculusFieldElement<Gradient>
- Parameters:
a
- Factors.b
- Factors.- Returns:
Σi ai bi
.
-
linearCombination
public Gradient linearCombination(Gradient a1, Gradient b1, Gradient a2, Gradient b2)
Compute a linear combination.- Specified by:
linearCombination
in interfaceCalculusFieldElement<Gradient>
- Parameters:
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second term- Returns:
- a1×b1 + a2×b2
- See Also:
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
,CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
-
linearCombination
public Gradient linearCombination(double a1, Gradient b1, double a2, Gradient b2)
Compute a linear combination.- Specified by:
linearCombination
in interfaceCalculusFieldElement<Gradient>
- Parameters:
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second term- Returns:
- a1×b1 + a2×b2
- See Also:
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement)
,CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement, double, FieldElement)
-
linearCombination
public Gradient linearCombination(Gradient a1, Gradient b1, Gradient a2, Gradient b2, Gradient a3, Gradient b3)
Compute a linear combination.- Specified by:
linearCombination
in interfaceCalculusFieldElement<Gradient>
- Parameters:
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second terma3
- first factor of the third termb3
- second factor of the third term- Returns:
- a1×b1 + a2×b2 + a3×b3
- See Also:
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement)
,CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
-
linearCombination
public Gradient linearCombination(double a1, Gradient b1, double a2, Gradient b2, double a3, Gradient b3)
Compute a linear combination.- Specified by:
linearCombination
in interfaceCalculusFieldElement<Gradient>
- Parameters:
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second terma3
- first factor of the third termb3
- second factor of the third term- Returns:
- a1×b1 + a2×b2 + a3×b3
- See Also:
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement)
,CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement, double, FieldElement)
-
linearCombination
public Gradient linearCombination(Gradient a1, Gradient b1, Gradient a2, Gradient b2, Gradient a3, Gradient b3, Gradient a4, Gradient b4)
Compute a linear combination.- Specified by:
linearCombination
in interfaceCalculusFieldElement<Gradient>
- Parameters:
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second terma3
- first factor of the third termb3
- second factor of the third terma4
- first factor of the fourth termb4
- second factor of the fourth term- Returns:
- a1×b1 + a2×b2 + a3×b3 + a4×b4
- See Also:
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement)
,CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
-
linearCombination
public Gradient linearCombination(double a1, Gradient b1, double a2, Gradient b2, double a3, Gradient b3, double a4, Gradient b4)
Compute a linear combination.- Specified by:
linearCombination
in interfaceCalculusFieldElement<Gradient>
- Parameters:
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second terma3
- first factor of the third termb3
- second factor of the third terma4
- first factor of the fourth termb4
- second factor of the fourth term- Returns:
- a1×b1 + a2×b2 + a3×b3 + a4×b4
- See Also:
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement)
,CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement)
-
getPi
public Gradient getPi()
Get the Archimedes constant π.Archimedes constant is the ratio of a circle's circumference to its diameter.
- Specified by:
getPi
in interfaceCalculusFieldElement<Gradient>
- Returns:
- Archimedes constant π
-
equals
public boolean equals(Object other)
Test for the equality of two univariate derivatives.univariate derivatives are considered equal if they have the same derivatives.
-
-