Class FieldDerivativeStructure<T extends CalculusFieldElement<T>>
- java.lang.Object
-
- org.hipparchus.analysis.differentiation.FieldDerivativeStructure<T>
-
- Type Parameters:
T- the type of the field elements
- All Implemented Interfaces:
DifferentialAlgebra,FieldDerivative<T,FieldDerivativeStructure<T>>,CalculusFieldElement<FieldDerivativeStructure<T>>,FieldElement<FieldDerivativeStructure<T>>
public class FieldDerivativeStructure<T extends CalculusFieldElement<T>> extends Object implements FieldDerivative<T,FieldDerivativeStructure<T>>
Class representing both the value and the differentials of a function.This class is similar to
DerivativeStructureexcept function parameters and value can be anyCalculusFieldElement.Instances of this class are guaranteed to be immutable.
- See Also:
DerivativeStructure,FDSFactory,DSCompiler
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldDerivativeStructure<T>abs()absolute value.FieldDerivativeStructure<T>acos()Arc cosine operation.FieldDerivativeStructure<T>acosh()Inverse hyperbolic cosine operation.FieldDerivativeStructure<T>add(double a)'+' operator.FieldDerivativeStructure<T>add(FieldDerivativeStructure<T> a)Compute this + a.FieldDerivativeStructure<T>asin()Arc sine operation.FieldDerivativeStructure<T>asinh()Inverse hyperbolic sine operation.FieldDerivativeStructure<T>atan()Arc tangent operation.FieldDerivativeStructure<T>atan2(FieldDerivativeStructure<T> x)Two arguments arc tangent operation.static <T extends CalculusFieldElement<T>>
FieldDerivativeStructure<T>atan2(FieldDerivativeStructure<T> y, FieldDerivativeStructure<T> x)Two arguments arc tangent operation.FieldDerivativeStructure<T>atanh()Inverse hyperbolic tangent operation.FieldDerivativeStructure<T>compose(double... f)Compute composition of the instance by a univariate function.FieldDerivativeStructure<T>compose(T... f)Compute composition of the instance by a univariate function.FieldDerivativeStructure<T>copySign(double sign)Returns the instance with the sign of the argument.FieldDerivativeStructure<T>copySign(FieldDerivativeStructure<T> sign)Returns the instance with the sign of the argument.FieldDerivativeStructure<T>copySign(T sign)Returns the instance with the sign of the argument.FieldDerivativeStructure<T>cos()Cosine operation.FieldDerivativeStructure<T>cosh()Hyperbolic cosine operation.FieldDerivativeStructure<T>differentiate(int varIndex, int differentiationOrder)Differentiate w.r.t. one independent variable.FieldDerivativeStructure<T>divide(double a)'÷' operator.FieldDerivativeStructure<T>divide(FieldDerivativeStructure<T> a)Compute this ÷ a.FieldDerivativeStructure<T>divide(T a)'÷' operator.booleanequals(Object other)Test for the equality of two derivative structures.FieldDerivativeStructure<T>exp()Exponential.FieldDerivativeStructure<T>expm1()Exponential minus 1.FieldDerivativeStructure<T>getAddendum()Get the addendum to the real value of the number.T[]getAllDerivatives()Get all partial derivatives.FDSFactory<T>getFactory()Get the factory that built the instance.Field<FieldDerivativeStructure<T>>getField()Get theFieldto which the instance belongs.intgetFreeParameters()Get the number of free parameters.intgetOrder()Get the maximum derivation order.TgetPartialDerivative(int... orders)Get a partial derivative.FieldDerivativeStructure<T>getPi()Get the Archimedes constant π.TgetValue()Get the value part of the derivative structure.inthashCode()Get a hashCode for the derivative structure.FieldDerivativeStructure<T>hypot(FieldDerivativeStructure<T> y)Returns the hypotenuse of a triangle with sidesthisandy- sqrt(this2 +y2) avoiding intermediate overflow or underflow.static <T extends CalculusFieldElement<T>>
FieldDerivativeStructure<T>hypot(FieldDerivativeStructure<T> x, FieldDerivativeStructure<T> y)Returns the hypotenuse of a triangle with sidesxandy- sqrt(x2 +y2) avoiding intermediate overflow or underflow.FieldDerivativeStructure<T>integrate(int varIndex, int integrationOrder)Integrate w.r.t. one independent variable.FieldDerivativeStructure<T>linearCombination(double[] a, FieldDerivativeStructure<T>[] b)Compute a linear combination.FieldDerivativeStructure<T>linearCombination(double a1, FieldDerivativeStructure<T> b1, double a2, FieldDerivativeStructure<T> b2)Compute a linear combination.FieldDerivativeStructure<T>linearCombination(double a1, FieldDerivativeStructure<T> b1, double a2, FieldDerivativeStructure<T> b2, double a3, FieldDerivativeStructure<T> b3)Compute a linear combination.FieldDerivativeStructure<T>linearCombination(double a1, FieldDerivativeStructure<T> b1, double a2, FieldDerivativeStructure<T> b2, double a3, FieldDerivativeStructure<T> b3, double a4, FieldDerivativeStructure<T> b4)Compute a linear combination.FieldDerivativeStructure<T>linearCombination(FieldDerivativeStructure<T>[] a, FieldDerivativeStructure<T>[] b)Compute a linear combination.FieldDerivativeStructure<T>linearCombination(FieldDerivativeStructure<T> a1, FieldDerivativeStructure<T> b1, FieldDerivativeStructure<T> a2, FieldDerivativeStructure<T> b2)Compute a linear combination.FieldDerivativeStructure<T>linearCombination(FieldDerivativeStructure<T> a1, FieldDerivativeStructure<T> b1, FieldDerivativeStructure<T> a2, FieldDerivativeStructure<T> b2, FieldDerivativeStructure<T> a3, FieldDerivativeStructure<T> b3)Compute a linear combination.FieldDerivativeStructure<T>linearCombination(FieldDerivativeStructure<T> a1, FieldDerivativeStructure<T> b1, FieldDerivativeStructure<T> a2, FieldDerivativeStructure<T> b2, FieldDerivativeStructure<T> a3, FieldDerivativeStructure<T> b3, FieldDerivativeStructure<T> a4, FieldDerivativeStructure<T> b4)Compute a linear combination.FieldDerivativeStructure<T>linearCombination(T[] a, FieldDerivativeStructure<T>[] b)Compute a linear combination.FieldDerivativeStructure<T>linearCombination(T a1, FieldDerivativeStructure<T> b1, T a2, FieldDerivativeStructure<T> b2)Compute a linear combination.FieldDerivativeStructure<T>linearCombination(T a1, FieldDerivativeStructure<T> b1, T a2, FieldDerivativeStructure<T> b2, T a3, FieldDerivativeStructure<T> b3)Compute a linear combination.FieldDerivativeStructure<T>linearCombination(T a1, FieldDerivativeStructure<T> b1, T a2, FieldDerivativeStructure<T> b2, T a3, FieldDerivativeStructure<T> b3, T a4, FieldDerivativeStructure<T> b4)Compute a linear combination.FieldDerivativeStructure<T>log()Natural logarithm.FieldDerivativeStructure<T>log10()Base 10 logarithm.FieldDerivativeStructure<T>log1p()Shifted natural logarithm.FieldDerivativeStructure<T>multiply(double a)'×' operator.FieldDerivativeStructure<T>multiply(FieldDerivativeStructure<T> a)Compute this × a.FieldDerivativeStructure<T>multiply(T a)'×' operator.FieldDerivativeStructure<T>negate()Returns the additive inverse ofthiselement.FieldDerivativeStructure<T>newInstance(double value)Create an instance corresponding to a constant real value.FieldDerivativeStructure<T>newInstance(T value)Create an instance corresponding to a constant Field value.FieldDerivativeStructure<T>pow(double p)Power operation.static <T extends CalculusFieldElement<T>>
FieldDerivativeStructure<T>pow(double a, FieldDerivativeStructure<T> x)Compute ax where a is a double and x aFieldDerivativeStructureFieldDerivativeStructure<T>pow(int n)Integer power operation.FieldDerivativeStructure<T>pow(FieldDerivativeStructure<T> e)Power operation.FieldDerivativeStructure<T>rebase(FieldDerivativeStructure<T>... p)Rebase instance with respect to low level parameter functions.FieldDerivativeStructure<T>reciprocal()Returns the multiplicative inverse ofthiselement.FieldDerivativeStructure<T>remainder(double a)IEEE remainder operator.FieldDerivativeStructure<T>remainder(FieldDerivativeStructure<T> a)IEEE remainder operator.FieldDerivativeStructure<T>remainder(T a)IEEE remainder operator.FieldDerivativeStructure<T>rootN(int n)Nth root.FieldDerivativeStructure<T>scalb(int n)Multiply the instance by a power of 2.FieldDerivativeStructure<T>sin()Sine operation.FieldSinCos<FieldDerivativeStructure<T>>sinCos()Combined Sine and Cosine operation.FieldDerivativeStructure<T>sinh()Hyperbolic sine operation.FieldSinhCosh<FieldDerivativeStructure<T>>sinhCosh()Combined hyperbolic sine and cosine operation.FieldDerivativeStructure<T>sqrt()Square root.FieldDerivativeStructure<T>square()Compute this × this.FieldDerivativeStructure<T>subtract(double a)'-' operator.FieldDerivativeStructure<T>subtract(FieldDerivativeStructure<T> a)Compute this - a.FieldDerivativeStructure<T>tan()Tangent operation.FieldDerivativeStructure<T>tanh()Hyperbolic tangent operation.Ttaylor(double... delta)Evaluate Taylor expansion of a derivative structure.Ttaylor(T... delta)Evaluate Taylor expansion of a derivative structure.FieldDerivativeStructure<T>toDegrees()Convert radians to degrees, with error of less than 0.5 ULPFieldDerivativeStructure<T>toRadians()Convert degrees to radians, with error of less than 0.5 ULPFieldDerivativeStructure<T>withValue(T 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, isFinite, isInfinite, isNaN, multiply, norm, round
-
Methods inherited from interface org.hipparchus.analysis.differentiation.FieldDerivative
add, ceil, floor, getExponent, getReal, rint, sign, subtract, ulp
-
Methods inherited from interface org.hipparchus.FieldElement
isZero
-
-
-
-
Method Detail
-
newInstance
public FieldDerivativeStructure<T> newInstance(double value)
Create an instance corresponding to a constant real value.- Specified by:
newInstancein interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
value- constant real value- Returns:
- instance corresponding to a constant real value
-
newInstance
public FieldDerivativeStructure<T> newInstance(T value)
Create an instance corresponding to a constant Field value.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:
newInstancein interfaceFieldDerivative<T extends CalculusFieldElement<T>,FieldDerivativeStructure<T extends CalculusFieldElement<T>>>- Parameters:
value- constant value- Returns:
- instance corresponding to a constant Field value
-
withValue
public FieldDerivativeStructure<T> withValue(T 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:
withValuein interfaceFieldDerivative<T extends CalculusFieldElement<T>,FieldDerivativeStructure<T extends CalculusFieldElement<T>>>- Parameters:
value- zeroth-order derivative of new represented function- Returns:
- new object with changed value
-
getFactory
public FDSFactory<T> 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:
getFreeParametersin interfaceDifferentialAlgebra- Returns:
- number of free parameters
-
getOrder
public int getOrder()
Get the maximum derivation order.- Specified by:
getOrderin interfaceDifferentialAlgebra- Returns:
- maximum derivation order
-
getAddendum
public FieldDerivativeStructure<T> getAddendum()
Get the addendum to the real value of the number.The addendum is considered to be the part that when added back to the
real partrecovers the instance. This means that whene.getReal()is finite (i.e. neither infinite nor NaN), thene.getAddendum().add(e.getReal())iseande.subtract(e.getReal())ise.getAddendum(). Beware that for non-finite numbers, these two equalities may not hold. The first equality (with the addition), always holds even for infinity and NaNs if the real part is independent of the addendum (this is the case for all derivatives types, as well as for complex and Dfp, but it is not the case for Tuple and FieldTuple). The second equality (with the subtraction), generally doesn't hold for non-finite numbers, because the subtraction generates NaNs.- Specified by:
getAddendumin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- real value
-
getValue
public T getValue()
Get the value part of the derivative structure.- Specified by:
getValuein interfaceFieldDerivative<T extends CalculusFieldElement<T>,FieldDerivativeStructure<T extends CalculusFieldElement<T>>>- Returns:
- value part of the derivative structure
- See Also:
getPartialDerivative(int...)
-
getPartialDerivative
public T getPartialDerivative(int... orders) throws MathIllegalArgumentException
Get a partial derivative.- Specified by:
getPartialDerivativein interfaceFieldDerivative<T extends CalculusFieldElement<T>,FieldDerivativeStructure<T extends CalculusFieldElement<T>>>- 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:
FieldDerivative.getValue()
-
getAllDerivatives
public T[] getAllDerivatives()
Get all partial derivatives.- Returns:
- a fresh copy of partial derivatives, in an array sorted according to
DSCompiler.getPartialDerivativeIndex(int...)
-
add
public FieldDerivativeStructure<T> add(double a)
'+' operator.- Specified by:
addin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
a- right hand side parameter of the operator- Returns:
- this+a
-
add
public FieldDerivativeStructure<T> add(FieldDerivativeStructure<T> a) throws MathIllegalArgumentException
Compute this + a.- Specified by:
addin interfaceFieldElement<T extends CalculusFieldElement<T>>- 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
public FieldDerivativeStructure<T> subtract(double a)
'-' operator.- Specified by:
subtractin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
a- right hand side parameter of the operator- Returns:
- this-a
-
subtract
public FieldDerivativeStructure<T> subtract(FieldDerivativeStructure<T> a) throws MathIllegalArgumentException
Compute this - a.- Specified by:
subtractin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Specified by:
subtractin interfaceFieldElement<T extends CalculusFieldElement<T>>- 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 FieldDerivativeStructure<T> multiply(T a)
'×' operator.- Parameters:
a- right hand side parameter of the operator- Returns:
- this×a
-
multiply
public FieldDerivativeStructure<T> multiply(double a)
'×' operator.- Specified by:
multiplyin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
a- right hand side parameter of the operator- Returns:
- this×a
-
multiply
public FieldDerivativeStructure<T> multiply(FieldDerivativeStructure<T> a) throws MathIllegalArgumentException
Compute this × a.- Specified by:
multiplyin interfaceFieldElement<T extends CalculusFieldElement<T>>- 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 FieldDerivativeStructure<T> square()
Compute this × this.- Specified by:
squarein interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- a new element representing this × this
-
divide
public FieldDerivativeStructure<T> divide(T a)
'÷' operator.- Parameters:
a- right hand side parameter of the operator- Returns:
- this÷a
-
divide
public FieldDerivativeStructure<T> divide(double a)
'÷' operator.- Specified by:
dividein interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
a- right hand side parameter of the operator- Returns:
- this÷a
-
divide
public FieldDerivativeStructure<T> divide(FieldDerivativeStructure<T> a) throws MathIllegalArgumentException
Compute this ÷ a.- Specified by:
dividein interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Specified by:
dividein interfaceFieldElement<T extends CalculusFieldElement<T>>- 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
public FieldDerivativeStructure<T> remainder(T a)
IEEE remainder operator.- Parameters:
a- right hand side parameter of the operator- 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
public FieldDerivativeStructure<T> remainder(double a)
IEEE remainder operator.- Specified by:
remainderin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
a- right hand side parameter of the operator- Returns:
- this - n × a where n is the closest integer to this/a
-
remainder
public FieldDerivativeStructure<T> remainder(FieldDerivativeStructure<T> a) throws MathIllegalArgumentException
IEEE remainder operator.- Specified by:
remainderin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- 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 FieldDerivativeStructure<T> negate()
Returns the additive inverse ofthiselement.- Specified by:
negatein interfaceFieldElement<T extends CalculusFieldElement<T>>- Returns:
- the opposite of
this.
-
abs
public FieldDerivativeStructure<T> abs()
absolute value.- Specified by:
absin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- abs(this)
-
copySign
public FieldDerivativeStructure<T> copySign(T sign)
Returns the instance with the sign of the argument. A NaNsignargument is treated as positive.- Parameters:
sign- the sign for the returned value- Returns:
- the instance with the same sign as the
signargument
-
copySign
public FieldDerivativeStructure<T> copySign(double sign)
Returns the instance with the sign of the argument. A NaNsignargument is treated as positive.- Specified by:
copySignin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
sign- the sign for the returned value- Returns:
- the instance with the same sign as the
signargument
-
copySign
public FieldDerivativeStructure<T> copySign(FieldDerivativeStructure<T> sign)
Returns the instance with the sign of the argument. A NaNsignargument is treated as positive.- Specified by:
copySignin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
sign- the sign for the returned value- Returns:
- the instance with the same sign as the
signargument
-
scalb
public FieldDerivativeStructure<T> scalb(int n)
Multiply the instance by a power of 2.- Specified by:
scalbin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
n- power of 2- Returns:
- this × 2n
-
hypot
public FieldDerivativeStructure<T> hypot(FieldDerivativeStructure<T> y) throws MathIllegalArgumentException
Returns the hypotenuse of a triangle with sidesthisandy- 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:
hypotin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
y- a value- Returns:
- sqrt(this2 +y2)
- Throws:
MathIllegalArgumentException- if number of free parameters or orders do not match
-
hypot
public static <T extends CalculusFieldElement<T>> FieldDerivativeStructure<T> hypot(FieldDerivativeStructure<T> x, FieldDerivativeStructure<T> y) throws MathIllegalArgumentException
Returns the hypotenuse of a triangle with sidesxandy- 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.
- Type Parameters:
T- the type of the field elements- Parameters:
x- a valuey- a value- Returns:
- sqrt(x2 +y2)
- Throws:
MathIllegalArgumentException- if number of free parameters or orders do not match
-
compose
@SafeVarargs public final FieldDerivativeStructure<T> compose(T... f) throws MathIllegalArgumentException
Compute composition of the instance by a univariate function.- 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
-
compose
public FieldDerivativeStructure<T> compose(double... f) throws MathIllegalArgumentException
Compute composition of the instance by a univariate function.- 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
public FieldDerivativeStructure<T> reciprocal()
Returns the multiplicative inverse ofthiselement.- Specified by:
reciprocalin interfaceFieldElement<T extends CalculusFieldElement<T>>- Returns:
- the inverse of
this.
-
sqrt
public FieldDerivativeStructure<T> sqrt()
Square root.- Specified by:
sqrtin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- square root of the instance
-
rootN
public FieldDerivativeStructure<T> rootN(int n)
Nth root.- Specified by:
rootNin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
n- order of the root- Returns:
- nth root of the instance
-
getField
public Field<FieldDerivativeStructure<T>> getField()
Get theFieldto which the instance belongs.- Specified by:
getFieldin interfaceFieldElement<T extends CalculusFieldElement<T>>- Returns:
Fieldto which the instance belongs
-
pow
public static <T extends CalculusFieldElement<T>> FieldDerivativeStructure<T> pow(double a, FieldDerivativeStructure<T> x)
Compute ax where a is a double and x aFieldDerivativeStructure- Type Parameters:
T- the type of the field elements- Parameters:
a- number to exponentiatex- power to apply- Returns:
- ax
-
pow
public FieldDerivativeStructure<T> pow(double p)
Power operation.- Specified by:
powin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
p- power to apply- Returns:
- thisp
-
pow
public FieldDerivativeStructure<T> pow(int n)
Integer power operation.- Specified by:
powin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
n- power to apply- Returns:
- thisn
-
pow
public FieldDerivativeStructure<T> pow(FieldDerivativeStructure<T> e) throws MathIllegalArgumentException
Power operation.- Specified by:
powin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Specified by:
powin interfaceFieldDerivative<T extends CalculusFieldElement<T>,FieldDerivativeStructure<T extends CalculusFieldElement<T>>>- Parameters:
e- exponent- Returns:
- thise
- Throws:
MathIllegalArgumentException- if number of free parameters or orders do not match
-
exp
public FieldDerivativeStructure<T> exp()
Exponential.- Specified by:
expin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- exponential of the instance
-
expm1
public FieldDerivativeStructure<T> expm1()
Exponential minus 1.- Specified by:
expm1in interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- exponential minus one of the instance
-
log
public FieldDerivativeStructure<T> log()
Natural logarithm.- Specified by:
login interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- logarithm of the instance
-
log1p
public FieldDerivativeStructure<T> log1p()
Shifted natural logarithm.- Specified by:
log1pin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- logarithm of one plus the instance
-
log10
public FieldDerivativeStructure<T> log10()
Base 10 logarithm.- Specified by:
log10in interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Specified by:
log10in interfaceFieldDerivative<T extends CalculusFieldElement<T>,FieldDerivativeStructure<T extends CalculusFieldElement<T>>>- Returns:
- base 10 logarithm of the instance
-
cos
public FieldDerivativeStructure<T> cos()
Cosine operation.- Specified by:
cosin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- cos(this)
-
sin
public FieldDerivativeStructure<T> sin()
Sine operation.- Specified by:
sinin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- sin(this)
-
sinCos
public FieldSinCos<FieldDerivativeStructure<T>> sinCos()
Combined Sine and Cosine operation.- Specified by:
sinCosin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- [sin(this), cos(this)]
-
tan
public FieldDerivativeStructure<T> tan()
Tangent operation.- Specified by:
tanin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- tan(this)
-
acos
public FieldDerivativeStructure<T> acos()
Arc cosine operation.- Specified by:
acosin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Specified by:
acosin interfaceFieldDerivative<T extends CalculusFieldElement<T>,FieldDerivativeStructure<T extends CalculusFieldElement<T>>>- Returns:
- acos(this)
-
asin
public FieldDerivativeStructure<T> asin()
Arc sine operation.- Specified by:
asinin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- asin(this)
-
atan
public FieldDerivativeStructure<T> atan()
Arc tangent operation.- Specified by:
atanin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- atan(this)
-
atan2
public FieldDerivativeStructure<T> atan2(FieldDerivativeStructure<T> x) throws MathIllegalArgumentException
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 theyargument and thexargument 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 languagesatan2two-arguments arc tangent and putsxas its first argument.- Specified by:
atan2in interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- 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 <T extends CalculusFieldElement<T>> FieldDerivativeStructure<T> atan2(FieldDerivativeStructure<T> y, FieldDerivativeStructure<T> x) throws MathIllegalArgumentException
Two arguments arc tangent operation.- Type Parameters:
T- the type of the field elements- 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
public FieldDerivativeStructure<T> cosh()
Hyperbolic cosine operation.- Specified by:
coshin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Specified by:
coshin interfaceFieldDerivative<T extends CalculusFieldElement<T>,FieldDerivativeStructure<T extends CalculusFieldElement<T>>>- Returns:
- cosh(this)
-
sinh
public FieldDerivativeStructure<T> sinh()
Hyperbolic sine operation.- Specified by:
sinhin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Specified by:
sinhin interfaceFieldDerivative<T extends CalculusFieldElement<T>,FieldDerivativeStructure<T extends CalculusFieldElement<T>>>- Returns:
- sinh(this)
-
sinhCosh
public FieldSinhCosh<FieldDerivativeStructure<T>> sinhCosh()
Combined hyperbolic sine and cosine operation.- Specified by:
sinhCoshin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- [sinh(this), cosh(this)]
-
tanh
public FieldDerivativeStructure<T> tanh()
Hyperbolic tangent operation.- Specified by:
tanhin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- tanh(this)
-
acosh
public FieldDerivativeStructure<T> acosh()
Inverse hyperbolic cosine operation.- Specified by:
acoshin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- acosh(this)
-
asinh
public FieldDerivativeStructure<T> asinh()
Inverse hyperbolic sine operation.- Specified by:
asinhin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- asin(this)
-
atanh
public FieldDerivativeStructure<T> atanh()
Inverse hyperbolic tangent operation.- Specified by:
atanhin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- atanh(this)
-
toDegrees
public FieldDerivativeStructure<T> toDegrees()
Convert radians to degrees, with error of less than 0.5 ULP- Specified by:
toDegreesin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- instance converted into degrees
-
toRadians
public FieldDerivativeStructure<T> toRadians()
Convert degrees to radians, with error of less than 0.5 ULP- Specified by:
toRadiansin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- instance converted into radians
-
integrate
public FieldDerivativeStructure<T> 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 FieldDerivativeStructure<T> 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
@SafeVarargs public final T taylor(T... delta) throws MathRuntimeException
Evaluate Taylor expansion of 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
-
taylor
public T taylor(double... delta) throws MathRuntimeException
Evaluate Taylor expansion of 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
public FieldDerivativeStructure<T> rebase(FieldDerivativeStructure<T>... p)
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 parametersup to ordero\(f(p_0, p_1, \ldots p_{n-1})\). Itspartial derivativesare 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 derivativesof 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 FieldDerivativeStructure<T> linearCombination(FieldDerivativeStructure<T>[] a, FieldDerivativeStructure<T>[] b) throws MathIllegalArgumentException
Compute a linear combination.- Specified by:
linearCombinationin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
a- Factors.b- Factors.- Returns:
Σi ai bi.- Throws:
MathIllegalArgumentException- if number of free parameters or orders do not match
-
linearCombination
public FieldDerivativeStructure<T> linearCombination(T[] a, FieldDerivativeStructure<T>[] b) throws MathIllegalArgumentException
Compute a linear combination.- Parameters:
a- Factors.b- Factors.- Returns:
Σi ai bi.- Throws:
MathIllegalArgumentException- if arrays dimensions don't match
-
linearCombination
public FieldDerivativeStructure<T> linearCombination(double[] a, FieldDerivativeStructure<T>[] b) throws MathIllegalArgumentException
Compute a linear combination.- Specified by:
linearCombinationin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
a- Factors.b- Factors.- Returns:
Σi ai bi.- Throws:
MathIllegalArgumentException- if number of free parameters or orders do not match
-
linearCombination
public FieldDerivativeStructure<T> linearCombination(FieldDerivativeStructure<T> a1, FieldDerivativeStructure<T> b1, FieldDerivativeStructure<T> a2, FieldDerivativeStructure<T> b2) throws MathIllegalArgumentException
Compute a linear combination.- Specified by:
linearCombinationin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- 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:
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement),CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
-
linearCombination
public FieldDerivativeStructure<T> linearCombination(T a1, FieldDerivativeStructure<T> b1, T a2, FieldDerivativeStructure<T> b2) throws MathIllegalArgumentException
Compute a linear combination.- 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 are inconsistent- See Also:
linearCombination(double, FieldDerivativeStructure, double, FieldDerivativeStructure),linearCombination(double, FieldDerivativeStructure, double, FieldDerivativeStructure, double, FieldDerivativeStructure, double, FieldDerivativeStructure)
-
linearCombination
public FieldDerivativeStructure<T> linearCombination(double a1, FieldDerivativeStructure<T> b1, double a2, FieldDerivativeStructure<T> b2) throws MathIllegalArgumentException
Compute a linear combination.- Specified by:
linearCombinationin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- 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:
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement),CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement, double, FieldElement)
-
linearCombination
public FieldDerivativeStructure<T> linearCombination(FieldDerivativeStructure<T> a1, FieldDerivativeStructure<T> b1, FieldDerivativeStructure<T> a2, FieldDerivativeStructure<T> b2, FieldDerivativeStructure<T> a3, FieldDerivativeStructure<T> b3) throws MathIllegalArgumentException
Compute a linear combination.- Specified by:
linearCombinationin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- 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:
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement),CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
-
linearCombination
public FieldDerivativeStructure<T> linearCombination(T a1, FieldDerivativeStructure<T> b1, T a2, FieldDerivativeStructure<T> b2, T a3, FieldDerivativeStructure<T> b3) throws MathIllegalArgumentException
Compute a linear combination.- 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 are inconsistent- See Also:
linearCombination(double, FieldDerivativeStructure, double, FieldDerivativeStructure),linearCombination(double, FieldDerivativeStructure, double, FieldDerivativeStructure, double, FieldDerivativeStructure, double, FieldDerivativeStructure)
-
linearCombination
public FieldDerivativeStructure<T> linearCombination(double a1, FieldDerivativeStructure<T> b1, double a2, FieldDerivativeStructure<T> b2, double a3, FieldDerivativeStructure<T> b3) throws MathIllegalArgumentException
Compute a linear combination.- Specified by:
linearCombinationin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- 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:
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement),CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement, double, FieldElement)
-
linearCombination
public FieldDerivativeStructure<T> linearCombination(FieldDerivativeStructure<T> a1, FieldDerivativeStructure<T> b1, FieldDerivativeStructure<T> a2, FieldDerivativeStructure<T> b2, FieldDerivativeStructure<T> a3, FieldDerivativeStructure<T> b3, FieldDerivativeStructure<T> a4, FieldDerivativeStructure<T> b4) throws MathIllegalArgumentException
Compute a linear combination.- Specified by:
linearCombinationin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- 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:
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement),CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
-
linearCombination
public FieldDerivativeStructure<T> linearCombination(T a1, FieldDerivativeStructure<T> b1, T a2, FieldDerivativeStructure<T> b2, T a3, FieldDerivativeStructure<T> b3, T a4, FieldDerivativeStructure<T> b4) throws MathIllegalArgumentException
Compute a linear combination.- 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 third termb4- second factor of the third term- Returns:
- a1×b1 + a2×b2 + a3×b3 + a4×b4
- Throws:
MathIllegalArgumentException- if number of free parameters or orders are inconsistent- See Also:
linearCombination(double, FieldDerivativeStructure, double, FieldDerivativeStructure),linearCombination(double, FieldDerivativeStructure, double, FieldDerivativeStructure, double, FieldDerivativeStructure)
-
linearCombination
public FieldDerivativeStructure<T> linearCombination(double a1, FieldDerivativeStructure<T> b1, double a2, FieldDerivativeStructure<T> b2, double a3, FieldDerivativeStructure<T> b3, double a4, FieldDerivativeStructure<T> b4) throws MathIllegalArgumentException
Compute a linear combination.- Specified by:
linearCombinationin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- 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:
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement),CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement)
-
getPi
public FieldDerivativeStructure<T> getPi()
Get the Archimedes constant π.Archimedes constant is the ratio of a circle's circumference to its diameter.
- Specified by:
getPiin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- 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.
-
-