Class DerivativeStructure
- All Implemented Interfaces:
Serializable
,Derivative<DerivativeStructure>
,DifferentialAlgebra
,CalculusFieldElement<DerivativeStructure>
,FieldElement<DerivativeStructure>
This class is the workhorse of the differentiation package.
This class is an implementation of the extension to Rall's numbers described in Dan Kalman's paper Doubly Recursive Multivariate Automatic Differentiation, Mathematics Magazine, vol. 75, no. 3, June 2002. 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. Dan Kalman's derivative structures hold all partial derivatives up to any specified order, with respect to any number of free parameters. Rall's numbers therefore can be seen as derivative structures for order one derivative and one free parameter, and real numbers can be seen as derivative structures with zero order derivative and no free parameters.
DerivativeStructure
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. Implementing complex expression can also be done by developing computation
code using standard primitive double values and to use differentiators
to create the DerivativeStructure
-based instances. This method is simpler but may be limited in
the accuracy and derivation orders and may be computationally intensive (this is
typically the case for finite differences
differentiator
.
Instances of this class are guaranteed to be immutable.
-
Method Summary
Modifier and TypeMethodDescriptionabs()
absolute value.acos()
Arc cosine operation.acosh()
Inverse hyperbolic cosine operation.Compute this + a.asin()
Arc sine operation.asinh()
Inverse hyperbolic sine operation.atan()
Arc tangent operation.Two arguments arc tangent operation.static DerivativeStructure
Two arguments arc tangent operation.atanh()
Inverse hyperbolic tangent operation.compose
(double... f) Compute composition of the instance by a univariate function.copySign
(double sign) Returns the instance with the sign of the argument.copySign
(DerivativeStructure sign) Returns the instance with the sign of the argument.cos()
Cosine operation.cosh()
Hyperbolic cosine operation.differentiate
(int varIndex, int differentiationOrder) Differentiate w.r.t.divide
(double a) '÷' operator.Compute this ÷ a.boolean
Test for the equality of two derivative structures.exp()
Exponential.expm1()
Exponential minus 1.double[]
Get all partial derivatives.Get the factory that built the instance.getField()
Get theField
to which the instance belongs.int
Get the number of free parameters.int
getOrder()
Get the maximum derivation order.double
getPartialDerivative
(int... orders) Get a partial derivative.getPi()
Get the Archimedes constant π.double
getValue()
Get the value part of the derivative structure.int
hashCode()
Get a hashCode for the derivative structure.Returns the hypotenuse of a triangle with sidesthis
andy
- sqrt(this2 +y2) avoiding intermediate overflow or underflow.static DerivativeStructure
Returns the hypotenuse of a triangle with sidesx
andy
- sqrt(x2 +y2) avoiding intermediate overflow or underflow.integrate
(int varIndex, int integrationOrder) Integrate w.r.t.linearCombination
(double[] a, DerivativeStructure[] b) Compute a linear combination.linearCombination
(double a1, DerivativeStructure b1, double a2, DerivativeStructure b2) Compute a linear combination.linearCombination
(double a1, DerivativeStructure b1, double a2, DerivativeStructure b2, double a3, DerivativeStructure b3) Compute a linear combination.linearCombination
(double a1, DerivativeStructure b1, double a2, DerivativeStructure b2, double a3, DerivativeStructure b3, double a4, DerivativeStructure b4) Compute a linear combination.Compute a linear combination.linearCombination
(DerivativeStructure a1, DerivativeStructure b1, DerivativeStructure a2, DerivativeStructure b2) Compute a linear combination.linearCombination
(DerivativeStructure a1, DerivativeStructure b1, DerivativeStructure a2, DerivativeStructure b2, DerivativeStructure a3, DerivativeStructure b3) Compute a linear combination.linearCombination
(DerivativeStructure a1, DerivativeStructure b1, DerivativeStructure a2, DerivativeStructure b2, DerivativeStructure a3, DerivativeStructure b3, DerivativeStructure a4, DerivativeStructure b4) Compute a linear combination.log()
Natural logarithm.log10()
Base 10 logarithm.log1p()
Shifted natural logarithm.multiply
(double a) '×' operator.Compute this × a.negate()
Returns the additive inverse ofthis
element.newInstance
(double value) Create an instance corresponding to a constant real value.pow
(double p) Power operation.static DerivativeStructure
pow
(double a, DerivativeStructure x) Compute ax where a is a double and x aDerivativeStructure
pow
(int n) Integer power operation.Power operation.rebase
(DerivativeStructure... p) Rebase instance with respect to low level parameter functions.Returns the multiplicative inverse ofthis
element.IEEE remainder operator.rootN
(int n) Nth root.scalb
(int n) Multiply the instance by a power of 2.sin()
Sine operation.sinCos()
Combined Sine and Cosine operation.sinh()
Hyperbolic sine operation.sinhCosh()
Combined hyperbolic sine and cosine operation.sqrt()
Square root.square()
Compute this × this.Compute this - a.tan()
Tangent operation.tanh()
Hyperbolic tangent operation.double
taylor
(double... delta) Evaluate Taylor expansion a derivative structure.Convert radians to degrees, with error of less than 0.5 ULPConvert degrees to radians, with error of less than 0.5 ULPwithValue
(double value) Create a new object with new value (zeroth-order derivative, as passed as input) and same derivatives of order one and above.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hipparchus.CalculusFieldElement
cbrt, ceil, floor, isFinite, isInfinite, isNaN, multiply, norm, rint, round, sign, ulp
Methods inherited from interface org.hipparchus.analysis.differentiation.Derivative
add, getExponent, getReal, remainder, subtract
Methods inherited from interface org.hipparchus.FieldElement
isZero
-
Method Details
-
newInstance
Create an instance corresponding to a constant real value.- Specified by:
newInstance
in interfaceCalculusFieldElement<DerivativeStructure>
- Parameters:
value
- constant real value- Returns:
- instance corresponding to a constant real value
-
withValue
Create a new object with new value (zeroth-order derivative, as passed as input) and same derivatives of order one and above.This default implementation is there so that no API gets broken by the next release, which is not a major one. Custom inheritors should probably overwrite it.
- Specified by:
withValue
in interfaceDerivative<DerivativeStructure>
- Parameters:
value
- zeroth-order derivative of new represented function- Returns:
- new object with changed value
-
getFactory
Get the factory that built the instance.- Returns:
- factory that built the instance
-
getFreeParameters
public int getFreeParameters()Get the number of free parameters.- Specified by:
getFreeParameters
in interfaceDifferentialAlgebra
- Returns:
- number of free parameters
-
getOrder
public int getOrder()Get the maximum derivation order.- Specified by:
getOrder
in interfaceDifferentialAlgebra
- Returns:
- maximum derivation order
-
getValue
public double getValue()Get the value part of the derivative structure.- Specified by:
getValue
in interfaceDerivative<DerivativeStructure>
- Returns:
- value part of the derivative structure
- See Also:
-
getPartialDerivative
Get a partial derivative.- Specified by:
getPartialDerivative
in interfaceDerivative<DerivativeStructure>
- 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:
-
getAllDerivatives
public double[] getAllDerivatives()Get all partial derivatives.- Returns:
- a fresh copy of partial derivatives, in an array sorted according to
DSCompiler.getPartialDerivativeIndex(int...)
-
add
Compute this + a.- Specified by:
add
in interfaceFieldElement<DerivativeStructure>
- Parameters:
a
- element to add- Returns:
- a new element representing this + a
- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match
-
subtract
Compute this - a.- Specified by:
subtract
in interfaceCalculusFieldElement<DerivativeStructure>
- Specified by:
subtract
in interfaceFieldElement<DerivativeStructure>
- Parameters:
a
- element to subtract- Returns:
- a new element representing this - a
- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match
-
multiply
'×' operator.- Specified by:
multiply
in interfaceCalculusFieldElement<DerivativeStructure>
- Parameters:
a
- right hand side parameter of the operator- Returns:
- this×a
-
multiply
Compute this × a.- Specified by:
multiply
in interfaceFieldElement<DerivativeStructure>
- Parameters:
a
- element to multiply- Returns:
- a new element representing this × a
- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match
-
square
Compute this × this.- Specified by:
square
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- a new element representing this × this
-
divide
'÷' operator.- Specified by:
divide
in interfaceCalculusFieldElement<DerivativeStructure>
- Parameters:
a
- right hand side parameter of the operator- Returns:
- this÷a
-
divide
Compute this ÷ a.- Specified by:
divide
in interfaceCalculusFieldElement<DerivativeStructure>
- Specified by:
divide
in interfaceFieldElement<DerivativeStructure>
- Parameters:
a
- element to divide by- Returns:
- a new element representing this ÷ a
- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match
-
remainder
IEEE remainder operator.- Specified by:
remainder
in interfaceCalculusFieldElement<DerivativeStructure>
- Parameters:
a
- right hand side parameter of the operator- Returns:
- this - n × a where n is the closest integer to this/a
- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match
-
negate
Returns the additive inverse ofthis
element.- Specified by:
negate
in interfaceFieldElement<DerivativeStructure>
- Returns:
- the opposite of
this
.
-
abs
absolute value.- Specified by:
abs
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- abs(this)
-
copySign
Returns the instance with the sign of the argument. A NaNsign
argument is treated as positive.- Specified by:
copySign
in interfaceCalculusFieldElement<DerivativeStructure>
- Parameters:
sign
- the sign for the returned value- Returns:
- the instance with the same sign as the
sign
argument
-
copySign
Returns the instance with the sign of the argument. A NaNsign
argument is treated as positive.- Specified by:
copySign
in interfaceCalculusFieldElement<DerivativeStructure>
- Parameters:
sign
- the sign for the returned value- Returns:
- the instance with the same sign as the
sign
argument
-
scalb
Multiply the instance by a power of 2.- Specified by:
scalb
in interfaceCalculusFieldElement<DerivativeStructure>
- Parameters:
n
- power of 2- Returns:
- this × 2n
-
hypot
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<DerivativeStructure>
- Parameters:
y
- a value- Returns:
- sqrt(this2 +y2)
- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match
-
hypot
public static DerivativeStructure hypot(DerivativeStructure x, DerivativeStructure y) throws MathIllegalArgumentException Returns the hypotenuse of a triangle with sidesx
andy
- sqrt(x2 +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:
x
- a valuey
- a value- Returns:
- sqrt(x2 +y2)
- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match
-
compose
Compute composition of the instance by a univariate function.- Specified by:
compose
in interfaceDerivative<DerivativeStructure>
- Parameters:
f
- array of value and derivatives of the function at the current point (i.e. [f(getValue()
), f'(getValue()
), f''(getValue()
)...]).- Returns:
- f(this)
- Throws:
MathIllegalArgumentException
- if the number of derivatives in the array is not equal toorder
+ 1
-
reciprocal
Returns the multiplicative inverse ofthis
element.- Specified by:
reciprocal
in interfaceFieldElement<DerivativeStructure>
- Returns:
- the inverse of
this
.
-
sqrt
Square root.- Specified by:
sqrt
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- square root of the instance
-
rootN
Nth root.- Specified by:
rootN
in interfaceCalculusFieldElement<DerivativeStructure>
- Parameters:
n
- order of the root- Returns:
- nth root of the instance
-
getField
Get theField
to which the instance belongs.- Specified by:
getField
in interfaceFieldElement<DerivativeStructure>
- Returns:
Field
to which the instance belongs
-
pow
Compute ax where a is a double and x aDerivativeStructure
- Parameters:
a
- number to exponentiatex
- power to apply- Returns:
- ax
-
pow
Power operation.- Specified by:
pow
in interfaceCalculusFieldElement<DerivativeStructure>
- Parameters:
p
- power to apply- Returns:
- thisp
-
pow
Integer power operation.- Specified by:
pow
in interfaceCalculusFieldElement<DerivativeStructure>
- Parameters:
n
- power to apply- Returns:
- thisn
-
pow
Power operation.- Specified by:
pow
in interfaceCalculusFieldElement<DerivativeStructure>
- Specified by:
pow
in interfaceDerivative<DerivativeStructure>
- Parameters:
e
- exponent- Returns:
- thise
- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match
-
exp
Exponential.- Specified by:
exp
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- exponential of the instance
-
expm1
Exponential minus 1.- Specified by:
expm1
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- exponential minus one of the instance
-
log
Natural logarithm.- Specified by:
log
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- logarithm of the instance
-
log1p
Shifted natural logarithm.- Specified by:
log1p
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- logarithm of one plus the instance
-
log10
Base 10 logarithm.- Specified by:
log10
in interfaceCalculusFieldElement<DerivativeStructure>
- Specified by:
log10
in interfaceDerivative<DerivativeStructure>
- Returns:
- base 10 logarithm of the instance
-
cos
Cosine operation.- Specified by:
cos
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- cos(this)
-
sin
Sine operation.- Specified by:
sin
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- sin(this)
-
sinCos
Combined Sine and Cosine operation.- Specified by:
sinCos
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- [sin(this), cos(this)]
-
tan
Tangent operation.- Specified by:
tan
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- tan(this)
-
acos
Arc cosine operation.- Specified by:
acos
in interfaceCalculusFieldElement<DerivativeStructure>
- Specified by:
acos
in interfaceDerivative<DerivativeStructure>
- Returns:
- acos(this)
-
asin
Arc sine operation.- Specified by:
asin
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- asin(this)
-
atan
Arc tangent operation.- Specified by:
atan
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- atan(this)
-
atan2
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<DerivativeStructure>
- Parameters:
x
- second argument of the arc tangent- Returns:
- atan2(this, x)
- Throws:
MathIllegalArgumentException
- if number of free parameters or orders are inconsistent
-
atan2
public static DerivativeStructure atan2(DerivativeStructure y, DerivativeStructure x) throws MathIllegalArgumentException Two arguments arc tangent operation.- Parameters:
y
- first argument of the arc tangentx
- second argument of the arc tangent- Returns:
- atan2(y, x)
- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match
-
cosh
Hyperbolic cosine operation.- Specified by:
cosh
in interfaceCalculusFieldElement<DerivativeStructure>
- Specified by:
cosh
in interfaceDerivative<DerivativeStructure>
- Returns:
- cosh(this)
-
sinh
Hyperbolic sine operation.- Specified by:
sinh
in interfaceCalculusFieldElement<DerivativeStructure>
- Specified by:
sinh
in interfaceDerivative<DerivativeStructure>
- Returns:
- sinh(this)
-
sinhCosh
Combined hyperbolic sine and cosine operation.- Specified by:
sinhCosh
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- [sinh(this), cosh(this)]
-
tanh
Hyperbolic tangent operation.- Specified by:
tanh
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- tanh(this)
-
acosh
Inverse hyperbolic cosine operation.- Specified by:
acosh
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- acosh(this)
-
asinh
Inverse hyperbolic sine operation.- Specified by:
asinh
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- asin(this)
-
atanh
Inverse hyperbolic tangent operation.- Specified by:
atanh
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- atanh(this)
-
toDegrees
Convert radians to degrees, with error of less than 0.5 ULP- Specified by:
toDegrees
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- instance converted into degrees
-
toRadians
Convert degrees to radians, with error of less than 0.5 ULP- Specified by:
toRadians
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- instance converted into radians
-
integrate
Integrate w.r.t. one independent variable.Rigorously, if the derivatives of a function are known up to order N, the ones of its M-th integral w.r.t. a given variable (seen as a function itself) are actually known up to order N+M. However, this method still casts the output as a DerivativeStructure of order N. The integration constants are systematically set to zero.
- Parameters:
varIndex
- Index of independent variable w.r.t. which integration is done.integrationOrder
- Number of times the integration operator must be applied. If non-positive, call the differentiation operator.- Returns:
- DerivativeStructure on which integration operator has been applied a certain number of times.
- Since:
- 2.2
-
differentiate
Differentiate w.r.t. one independent variable.Rigorously, if the derivatives of a function are known up to order N, the ones of its M-th derivative w.r.t. a given variable (seen as a function itself) are only known up to order N-M. However, this method still casts the output as a DerivativeStructure of order N with zeroes for the higher order terms.
- Parameters:
varIndex
- Index of independent variable w.r.t. which differentiation is done.differentiationOrder
- Number of times the differentiation operator must be applied. If non-positive, call the integration operator instead.- Returns:
- DerivativeStructure on which differentiation operator has been applied a certain number of times
- Since:
- 2.2
-
taylor
Evaluate Taylor expansion a derivative structure.- Parameters:
delta
- parameters offsets (Δx, Δy, ...)- Returns:
- value of the Taylor expansion at x + Δx, y + Δy, ...
- Throws:
MathRuntimeException
- if factorials becomes too large
-
rebase
Rebase instance with respect to low level parameter functions.The instance is considered to be a function of
\( \begin{align} p_0 & = p_0(q_0, q_1, \ldots q_{m-1})\\ p_1 & = p_1(q_0, q_1, \ldots q_{m-1})\\ p_{n-1} & = p_{n-1}(q_0, q_1, \ldots q_{m-1}) \end{align}\)n free parameters
up to ordero
\(f(p_0, p_1, \ldots p_{n-1})\). Itspartial derivatives
are therefore \(f, \frac{\partial f}{\partial p_0}, \frac{\partial f}{\partial p_1}, \ldots \frac{\partial^2 f}{\partial p_0^2}, \frac{\partial^2 f}{\partial p_0 p_1}, \ldots \frac{\partial^o f}{\partial p_{n-1}^o}\). The free parameters \(p_0, p_1, \ldots p_{n-1}\) are considered to be functions of \(m\) lower level other parameters \(q_0, q_1, \ldots q_{m-1}\).This method compute the composition of the partial derivatives of \(f\) and the partial derivatives of \(p_0, p_1, \ldots p_{n-1}\), i.e. the
partial derivatives
of the value returned will be \(f, \frac{\partial f}{\partial q_0}, \frac{\partial f}{\partial q_1}, \ldots \frac{\partial^2 f}{\partial q_0^2}, \frac{\partial^2 f}{\partial q_0 q_1}, \ldots \frac{\partial^o f}{\partial q_{m-1}^o}\).The number of parameters must match
getFreeParameters()
and the derivation orders of the instance and parameters must also match.- Parameters:
p
- base parameters with respect to which partial derivatives were computed in the instance- Returns:
- derivative structure with partial derivatives computed with respect to the lower level parameters used in the \(p_i\)
- Since:
- 2.2
-
linearCombination
public DerivativeStructure linearCombination(DerivativeStructure[] a, DerivativeStructure[] b) throws MathIllegalArgumentException Compute a linear combination.- Specified by:
linearCombination
in interfaceCalculusFieldElement<DerivativeStructure>
- Parameters:
a
- Factors.b
- Factors.- Returns:
Σi ai bi
.- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match
-
linearCombination
public DerivativeStructure linearCombination(double[] a, DerivativeStructure[] b) throws MathIllegalArgumentException Compute a linear combination.- Specified by:
linearCombination
in interfaceCalculusFieldElement<DerivativeStructure>
- Parameters:
a
- Factors.b
- Factors.- Returns:
Σi ai bi
.- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match
-
linearCombination
public DerivativeStructure linearCombination(DerivativeStructure a1, DerivativeStructure b1, DerivativeStructure a2, DerivativeStructure b2) throws MathIllegalArgumentException Compute a linear combination.- Specified by:
linearCombination
in interfaceCalculusFieldElement<DerivativeStructure>
- 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
- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match- See Also:
-
linearCombination
public DerivativeStructure linearCombination(double a1, DerivativeStructure b1, double a2, DerivativeStructure b2) throws MathIllegalArgumentException Compute a linear combination.- Specified by:
linearCombination
in interfaceCalculusFieldElement<DerivativeStructure>
- 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
- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match- See Also:
-
linearCombination
public DerivativeStructure linearCombination(DerivativeStructure a1, DerivativeStructure b1, DerivativeStructure a2, DerivativeStructure b2, DerivativeStructure a3, DerivativeStructure b3) throws MathIllegalArgumentException Compute a linear combination.- Specified by:
linearCombination
in interfaceCalculusFieldElement<DerivativeStructure>
- 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
- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match- See Also:
-
linearCombination
public DerivativeStructure linearCombination(double a1, DerivativeStructure b1, double a2, DerivativeStructure b2, double a3, DerivativeStructure b3) throws MathIllegalArgumentException Compute a linear combination.- Specified by:
linearCombination
in interfaceCalculusFieldElement<DerivativeStructure>
- 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
- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match- See Also:
-
linearCombination
public DerivativeStructure linearCombination(DerivativeStructure a1, DerivativeStructure b1, DerivativeStructure a2, DerivativeStructure b2, DerivativeStructure a3, DerivativeStructure b3, DerivativeStructure a4, DerivativeStructure b4) throws MathIllegalArgumentException Compute a linear combination.- Specified by:
linearCombination
in interfaceCalculusFieldElement<DerivativeStructure>
- 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
- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match- See Also:
-
linearCombination
public DerivativeStructure linearCombination(double a1, DerivativeStructure b1, double a2, DerivativeStructure b2, double a3, DerivativeStructure b3, double a4, DerivativeStructure b4) throws MathIllegalArgumentException Compute a linear combination.- Specified by:
linearCombination
in interfaceCalculusFieldElement<DerivativeStructure>
- 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
- Throws:
MathIllegalArgumentException
- if number of free parameters or orders do not match- See Also:
-
getPi
Get the Archimedes constant π.Archimedes constant is the ratio of a circle's circumference to its diameter.
- Specified by:
getPi
in interfaceCalculusFieldElement<DerivativeStructure>
- Returns:
- Archimedes constant π
-
equals
Test for the equality of two derivative structures.Derivative structures are considered equal if they have the same number of free parameters, the same derivation order, and the same derivatives.
-
hashCode
public int hashCode()Get a hashCode for the derivative structure.
-