# Class DerivativeStructure

java.lang.Object
org.hipparchus.analysis.differentiation.DerivativeStructure
All Implemented Interfaces:
Serializable, Derivative<DerivativeStructure>, DifferentialAlgebra, CalculusFieldElement<DerivativeStructure>, FieldElement<DerivativeStructure>

public class DerivativeStructure extends Object implements Derivative<DerivativeStructure>, Serializable
Class representing both the value and the differentials of a function.

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 Type
Method
Description
DerivativeStructure
abs()
absolute value.
DerivativeStructure
acos()
Arc cosine operation.
DerivativeStructure
acosh()
Inverse hyperbolic cosine operation.
DerivativeStructure
add(DerivativeStructure a)
Compute this + a.
DerivativeStructure
asin()
Arc sine operation.
DerivativeStructure
asinh()
Inverse hyperbolic sine operation.
DerivativeStructure
atan()
Arc tangent operation.
DerivativeStructure
atan2(DerivativeStructure x)
Two arguments arc tangent operation.
static DerivativeStructure
atan2(DerivativeStructure y, DerivativeStructure x)
Two arguments arc tangent operation.
DerivativeStructure
atanh()
Inverse hyperbolic tangent operation.
DerivativeStructure
compose(double... f)
Compute composition of the instance by a univariate function.
DerivativeStructure
copySign(double sign)
Returns the instance with the sign of the argument.
DerivativeStructure
copySign(DerivativeStructure sign)
Returns the instance with the sign of the argument.
DerivativeStructure
cos()
Cosine operation.
DerivativeStructure
cosh()
Hyperbolic cosine operation.
DerivativeStructure
differentiate(int varIndex, int differentiationOrder)
Differentiate w.r.t.
DerivativeStructure
divide(double a)
'÷' operator.
DerivativeStructure
divide(DerivativeStructure a)
Compute this ÷ a.
boolean
equals(Object other)
Test for the equality of two derivative structures.
DerivativeStructure
exp()
Exponential.
DerivativeStructure
expm1()
Exponential minus 1.
double[]
getAllDerivatives()
Get all partial derivatives.
DSFactory
getFactory()
Get the factory that built the instance.
Field<DerivativeStructure>
getField()
Get the Field to which the instance belongs.
int
getFreeParameters()
Get the number of free parameters.
int
getOrder()
Get the maximum derivation order.
double
getPartialDerivative(int... orders)
Get a partial derivative.
DerivativeStructure
getPi()
Get the Archimedes constant π.
double
getValue()
Get the value part of the derivative structure.
int
hashCode()
Get a hashCode for the derivative structure.
DerivativeStructure
hypot(DerivativeStructure y)
Returns the hypotenuse of a triangle with sides this and y - sqrt(this2 +y2) avoiding intermediate overflow or underflow.
static DerivativeStructure
hypot(DerivativeStructure x, DerivativeStructure y)
Returns the hypotenuse of a triangle with sides x and y - sqrt(x2 +y2) avoiding intermediate overflow or underflow.
DerivativeStructure
integrate(int varIndex, int integrationOrder)
Integrate w.r.t.
DerivativeStructure
linearCombination(double[] a, DerivativeStructure[] b)
Compute a linear combination.
DerivativeStructure
linearCombination(double a1, DerivativeStructure b1, double a2, DerivativeStructure b2)
Compute a linear combination.
DerivativeStructure
linearCombination(double a1, DerivativeStructure b1, double a2, DerivativeStructure b2, double a3, DerivativeStructure b3)
Compute a linear combination.
DerivativeStructure
linearCombination(double a1, DerivativeStructure b1, double a2, DerivativeStructure b2, double a3, DerivativeStructure b3, double a4, DerivativeStructure b4)
Compute a linear combination.
DerivativeStructure
linearCombination(DerivativeStructure[] a, DerivativeStructure[] b)
Compute a linear combination.
DerivativeStructure
linearCombination(DerivativeStructure a1, DerivativeStructure b1, DerivativeStructure a2, DerivativeStructure b2)
Compute a linear combination.
DerivativeStructure
linearCombination(DerivativeStructure a1, DerivativeStructure b1, DerivativeStructure a2, DerivativeStructure b2, DerivativeStructure a3, DerivativeStructure b3)
Compute a linear combination.
DerivativeStructure
linearCombination(DerivativeStructure a1, DerivativeStructure b1, DerivativeStructure a2, DerivativeStructure b2, DerivativeStructure a3, DerivativeStructure b3, DerivativeStructure a4, DerivativeStructure b4)
Compute a linear combination.
DerivativeStructure
log()
Natural logarithm.
DerivativeStructure
log10()
Base 10 logarithm.
DerivativeStructure
log1p()
Shifted natural logarithm.
DerivativeStructure
multiply(double a)
'×' operator.
DerivativeStructure
multiply(DerivativeStructure a)
Compute this × a.
DerivativeStructure
negate()
Returns the additive inverse of this element.
DerivativeStructure
newInstance(double value)
Create an instance corresponding to a constant real value.
DerivativeStructure
pow(double p)
Power operation.
static DerivativeStructure
pow(double a, DerivativeStructure x)
Compute ax where a is a double and x a DerivativeStructure
DerivativeStructure
pow(int n)
Integer power operation.
DerivativeStructure
pow(DerivativeStructure e)
Power operation.
DerivativeStructure
rebase(DerivativeStructure... p)
Rebase instance with respect to low level parameter functions.
DerivativeStructure
reciprocal()
Returns the multiplicative inverse of this element.
DerivativeStructure
remainder(DerivativeStructure a)
IEEE remainder operator.
DerivativeStructure
rootN(int n)
Nth root.
DerivativeStructure
scalb(int n)
Multiply the instance by a power of 2.
DerivativeStructure
sin()
Sine operation.
FieldSinCos<DerivativeStructure>
sinCos()
Combined Sine and Cosine operation.
DerivativeStructure
sinh()
Hyperbolic sine operation.
FieldSinhCosh<DerivativeStructure>
sinhCosh()
Combined hyperbolic sine and cosine operation.
DerivativeStructure
sqrt()
Square root.
DerivativeStructure
square()
Compute this × this.
DerivativeStructure
subtract(DerivativeStructure a)
Compute this - a.
DerivativeStructure
tan()
Tangent operation.
DerivativeStructure
tanh()
Hyperbolic tangent operation.
double
taylor(double... delta)
Evaluate Taylor expansion a derivative structure.
DerivativeStructure
toDegrees()
Convert radians to degrees, with error of less than 0.5 ULP
DerivativeStructure
toRadians()
Convert degrees to radians, with error of less than 0.5 ULP
DerivativeStructure
withValue(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

public DerivativeStructure newInstance(double value)
Create an instance corresponding to a constant real value.
Specified by:
newInstance in interface CalculusFieldElement<DerivativeStructure>
Parameters:
value - constant real value
Returns:
instance corresponding to a constant real value
• ### withValue

public DerivativeStructure withValue(double value)
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 interface Derivative<DerivativeStructure>
Parameters:
value - zeroth-order derivative of new represented function
Returns:
new object with changed value
• ### getFactory

public DSFactory 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 interface DifferentialAlgebra
Returns:
number of free parameters
• ### getOrder

public int getOrder()
Get the maximum derivation order.
Specified by:
getOrder in interface DifferentialAlgebra
Returns:
maximum derivation order
• ### getValue

public double getValue()
Get the value part of the derivative structure.
Specified by:
getValue in interface Derivative<DerivativeStructure>
Returns:
value part of the derivative structure
• ### getPartialDerivative

public double getPartialDerivative(int... orders) throws MathIllegalArgumentException
Get a partial derivative.
Specified by:
getPartialDerivative in interface Derivative<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
• ### getAllDerivatives

public double[] getAllDerivatives()
Get all partial derivatives.
Returns:
a fresh copy of partial derivatives, in an array sorted according to DSCompiler.getPartialDerivativeIndex(int...)

Compute this + a.
Specified by:
add in interface FieldElement<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 interface CalculusFieldElement<DerivativeStructure>
Specified by:
subtract in interface FieldElement<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

public DerivativeStructure multiply(double a)
'×' operator.
Specified by:
multiply in interface CalculusFieldElement<DerivativeStructure>
Parameters:
a - right hand side parameter of the operator
Returns:
this×a
• ### multiply

Compute this × a.
Specified by:
multiply in interface FieldElement<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

public DerivativeStructure square()
Compute this × this.
Specified by:
square in interface CalculusFieldElement<DerivativeStructure>
Returns:
a new element representing this × this
• ### divide

public DerivativeStructure divide(double a)
'÷' operator.
Specified by:
divide in interface CalculusFieldElement<DerivativeStructure>
Parameters:
a - right hand side parameter of the operator
Returns:
this÷a
• ### divide

Compute this ÷ a.
Specified by:
divide in interface CalculusFieldElement<DerivativeStructure>
Specified by:
divide in interface FieldElement<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 interface CalculusFieldElement<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

public DerivativeStructure negate()
Returns the additive inverse of this element.
Specified by:
negate in interface FieldElement<DerivativeStructure>
Returns:
the opposite of this.
• ### abs

public DerivativeStructure abs()
absolute value.
Specified by:
abs in interface CalculusFieldElement<DerivativeStructure>
Returns:
abs(this)
• ### copySign

public DerivativeStructure copySign(DerivativeStructure sign)
Returns the instance with the sign of the argument. A NaN sign argument is treated as positive.
Specified by:
copySign in interface CalculusFieldElement<DerivativeStructure>
Parameters:
sign - the sign for the returned value
Returns:
the instance with the same sign as the sign argument
• ### copySign

public DerivativeStructure copySign(double sign)
Returns the instance with the sign of the argument. A NaN sign argument is treated as positive.
Specified by:
copySign in interface CalculusFieldElement<DerivativeStructure>
Parameters:
sign - the sign for the returned value
Returns:
the instance with the same sign as the sign argument
• ### scalb

public DerivativeStructure scalb(int n)
Multiply the instance by a power of 2.
Specified by:
scalb in interface CalculusFieldElement<DerivativeStructure>
Parameters:
n - power of 2
Returns:
this × 2n
• ### hypot

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.
Specified by:
hypot in interface CalculusFieldElement<DerivativeStructure>
Parameters:
y - a value
Returns:
sqrt(this2 +y2)
Throws:
MathIllegalArgumentException - if number of free parameters or orders do not match
• ### hypot

Returns the hypotenuse of a triangle with sides x and y - 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 value
y - a value
Returns:
sqrt(x2 +y2)
Throws:
MathIllegalArgumentException - if number of free parameters or orders do not match
• ### compose

public DerivativeStructure compose(double... f) throws MathIllegalArgumentException
Compute composition of the instance by a univariate function.
Specified by:
compose in interface Derivative<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 to order + 1
• ### reciprocal

public DerivativeStructure reciprocal()
Returns the multiplicative inverse of this element.
Specified by:
reciprocal in interface FieldElement<DerivativeStructure>
Returns:
the inverse of this.
• ### sqrt

public DerivativeStructure sqrt()
Square root.
Specified by:
sqrt in interface CalculusFieldElement<DerivativeStructure>
Returns:
square root of the instance
• ### rootN

public DerivativeStructure rootN(int n)
Nth root.
Specified by:
rootN in interface CalculusFieldElement<DerivativeStructure>
Parameters:
n - order of the root
Returns:
nth root of the instance
• ### getField

public  getField()
Get the Field to which the instance belongs.
Specified by:
getField in interface FieldElement<DerivativeStructure>
Returns:
Field to which the instance belongs
• ### pow

public static DerivativeStructure pow(double a, DerivativeStructure x)
Compute ax where a is a double and x a DerivativeStructure
Parameters:
a - number to exponentiate
x - power to apply
Returns:
ax
• ### pow

public DerivativeStructure pow(double p)
Power operation.
Specified by:
pow in interface CalculusFieldElement<DerivativeStructure>
Parameters:
p - power to apply
Returns:
thisp
• ### pow

public DerivativeStructure pow(int n)
Integer power operation.
Specified by:
pow in interface CalculusFieldElement<DerivativeStructure>
Parameters:
n - power to apply
Returns:
thisn
• ### pow

Power operation.
Specified by:
pow in interface CalculusFieldElement<DerivativeStructure>
Specified by:
pow in interface Derivative<DerivativeStructure>
Parameters:
e - exponent
Returns:
thise
Throws:
MathIllegalArgumentException - if number of free parameters or orders do not match
• ### exp

public DerivativeStructure exp()
Exponential.
Specified by:
exp in interface CalculusFieldElement<DerivativeStructure>
Returns:
exponential of the instance
• ### expm1

public DerivativeStructure expm1()
Exponential minus 1.
Specified by:
expm1 in interface CalculusFieldElement<DerivativeStructure>
Returns:
exponential minus one of the instance
• ### log

public DerivativeStructure log()
Natural logarithm.
Specified by:
log in interface CalculusFieldElement<DerivativeStructure>
Returns:
logarithm of the instance
• ### log1p

public DerivativeStructure log1p()
Shifted natural logarithm.
Specified by:
log1p in interface CalculusFieldElement<DerivativeStructure>
Returns:
logarithm of one plus the instance
• ### log10

public DerivativeStructure log10()
Base 10 logarithm.
Specified by:
log10 in interface CalculusFieldElement<DerivativeStructure>
Specified by:
log10 in interface Derivative<DerivativeStructure>
Returns:
base 10 logarithm of the instance
• ### cos

public DerivativeStructure cos()
Cosine operation.
Specified by:
cos in interface CalculusFieldElement<DerivativeStructure>
Returns:
cos(this)
• ### sin

public DerivativeStructure sin()
Sine operation.
Specified by:
sin in interface CalculusFieldElement<DerivativeStructure>
Returns:
sin(this)
• ### sinCos

public  sinCos()
Combined Sine and Cosine operation.
Specified by:
sinCos in interface CalculusFieldElement<DerivativeStructure>
Returns:
[sin(this), cos(this)]
• ### tan

public DerivativeStructure tan()
Tangent operation.
Specified by:
tan in interface CalculusFieldElement<DerivativeStructure>
Returns:
tan(this)
• ### acos

public DerivativeStructure acos()
Arc cosine operation.
Specified by:
acos in interface CalculusFieldElement<DerivativeStructure>
Specified by:
acos in interface Derivative<DerivativeStructure>
Returns:
acos(this)
• ### asin

public DerivativeStructure asin()
Arc sine operation.
Specified by:
asin in interface CalculusFieldElement<DerivativeStructure>
Returns:
asin(this)
• ### atan

public DerivativeStructure atan()
Arc tangent operation.
Specified by:
atan in interface CalculusFieldElement<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 computes atan2(this, x), i.e. the instance represents the y argument and the x 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 languages atan2 two-arguments arc tangent and puts x as its first argument.

Specified by:
atan2 in interface CalculusFieldElement<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

Two arguments arc tangent operation.
Parameters:
y - first argument of the arc tangent
x - second argument of the arc tangent
Returns:
atan2(y, x)
Throws:
MathIllegalArgumentException - if number of free parameters or orders do not match
• ### cosh

public DerivativeStructure cosh()
Hyperbolic cosine operation.
Specified by:
cosh in interface CalculusFieldElement<DerivativeStructure>
Specified by:
cosh in interface Derivative<DerivativeStructure>
Returns:
cosh(this)
• ### sinh

public DerivativeStructure sinh()
Hyperbolic sine operation.
Specified by:
sinh in interface CalculusFieldElement<DerivativeStructure>
Specified by:
sinh in interface Derivative<DerivativeStructure>
Returns:
sinh(this)
• ### sinhCosh

public  sinhCosh()
Combined hyperbolic sine and cosine operation.
Specified by:
sinhCosh in interface CalculusFieldElement<DerivativeStructure>
Returns:
[sinh(this), cosh(this)]
• ### tanh

public DerivativeStructure tanh()
Hyperbolic tangent operation.
Specified by:
tanh in interface CalculusFieldElement<DerivativeStructure>
Returns:
tanh(this)
• ### acosh

public DerivativeStructure acosh()
Inverse hyperbolic cosine operation.
Specified by:
acosh in interface CalculusFieldElement<DerivativeStructure>
Returns:
acosh(this)
• ### asinh

public DerivativeStructure asinh()
Inverse hyperbolic sine operation.
Specified by:
asinh in interface CalculusFieldElement<DerivativeStructure>
Returns:
asin(this)
• ### atanh

public DerivativeStructure atanh()
Inverse hyperbolic tangent operation.
Specified by:
atanh in interface CalculusFieldElement<DerivativeStructure>
Returns:
atanh(this)
• ### toDegrees

public DerivativeStructure toDegrees()
Convert radians to degrees, with error of less than 0.5 ULP
Specified by:
toDegrees in interface CalculusFieldElement<DerivativeStructure>
Returns:
instance converted into degrees

Convert degrees to radians, with error of less than 0.5 ULP
Specified by:
toRadians in interface CalculusFieldElement<DerivativeStructure>
Returns:
instance converted into radians
• ### integrate

public DerivativeStructure integrate(int varIndex, int integrationOrder)
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

public DerivativeStructure differentiate(int varIndex, int differentiationOrder)
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

public double taylor(double... delta) throws MathRuntimeException
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 n free parameters up to order o $$f(p_0, p_1, \ldots p_{n-1})$$. Its partial 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}$$.

\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}

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

Compute a linear combination.
Specified by:
linearCombination in interface CalculusFieldElement<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 interface CalculusFieldElement<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 throws MathIllegalArgumentException
Compute a linear combination.
Specified by:
linearCombination in interface CalculusFieldElement<DerivativeStructure>
Parameters:
a1 - first factor of the first term
b1 - second factor of the first term
a2 - first factor of the second term
b2 - second factor of the second term
Returns:
a1×b1 + a2×b2
Throws:
MathIllegalArgumentException - if number of free parameters or orders do not match
• ### linearCombination

public DerivativeStructure linearCombination(double a1, DerivativeStructure b1, double a2, DerivativeStructure b2) throws MathIllegalArgumentException
Compute a linear combination.
Specified by:
linearCombination in interface CalculusFieldElement<DerivativeStructure>
Parameters:
a1 - first factor of the first term
b1 - second factor of the first term
a2 - first factor of the second term
b2 - second factor of the second term
Returns:
a1×b1 + a2×b2
Throws:
MathIllegalArgumentException - if number of free parameters or orders do not match
• ### linearCombination

public DerivativeStructure linearCombination throws MathIllegalArgumentException
Compute a linear combination.
Specified by:
linearCombination in interface CalculusFieldElement<DerivativeStructure>
Parameters:
a1 - first factor of the first term
b1 - second factor of the first term
a2 - first factor of the second term
b2 - second factor of the second term
a3 - first factor of the third term
b3 - 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
• ### 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 interface CalculusFieldElement<DerivativeStructure>
Parameters:
a1 - first factor of the first term
b1 - second factor of the first term
a2 - first factor of the second term
b2 - second factor of the second term
a3 - first factor of the third term
b3 - 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
• ### linearCombination

public DerivativeStructure linearCombination throws MathIllegalArgumentException
Compute a linear combination.
Specified by:
linearCombination in interface CalculusFieldElement<DerivativeStructure>
Parameters:
a1 - first factor of the first term
b1 - second factor of the first term
a2 - first factor of the second term
b2 - second factor of the second term
a3 - first factor of the third term
b3 - second factor of the third term
a4 - first factor of the fourth term
b4 - 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
• ### 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 interface CalculusFieldElement<DerivativeStructure>
Parameters:
a1 - first factor of the first term
b1 - second factor of the first term
a2 - first factor of the second term
b2 - second factor of the second term
a3 - first factor of the third term
b3 - second factor of the third term
a4 - first factor of the fourth term
b4 - 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
• ### getPi

public DerivativeStructure getPi()
Get the Archimedes constant π.

Archimedes constant is the ratio of a circle's circumference to its diameter.

Specified by:
getPi in interface CalculusFieldElement<DerivativeStructure>
Returns:
Archimedes constant π
• ### equals

public boolean equals(Object other)
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.

Overrides:
equals in class Object
Parameters:
other - Object to test for equality to this
Returns:
true if two derivative structures are equal
• ### hashCode

public int hashCode()
Get a hashCode for the derivative structure.
Overrides:
hashCode in class Object
Returns:
a hash code value for this object