Class FieldGradient<T extends CalculusFieldElement<T>>
- java.lang.Object
-
- org.hipparchus.analysis.differentiation.FieldGradient<T>
-
- Type Parameters:
T- the type of the function parameters and value
- All Implemented Interfaces:
DifferentialAlgebra,FieldDerivative<T,FieldGradient<T>>,FieldDerivative1<T,FieldGradient<T>>,CalculusFieldElement<FieldGradient<T>>,FieldElement<FieldGradient<T>>
public class FieldGradient<T extends CalculusFieldElement<T>> extends Object implements FieldDerivative1<T,FieldGradient<T>>
Class representing both the value and the differentials of a function.This class is a stripped-down version of
FieldDerivativeStructurewithderivation orderlimited to one. It should have less overhead thanFieldDerivativeStructurein its domain.This class is an implementation of Rall's numbers. Rall's numbers are an extension to the real numbers used throughout mathematical expressions; they hold the derivative together with the value of a function.
FieldGradientinstances 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
Derivative-based classes (or in fact anyCalculusFieldElementclass) is a tedious and error-prone task but has the advantage of not requiring users to compute the derivatives by themselves and allowing to switch for one derivative implementation to another as they all share the same filed API.Instances of this class are guaranteed to be immutable.
-
-
Constructor Summary
Constructors Constructor Description FieldGradient(FieldDerivativeStructure<T> ds)Build an instance from aFieldDerivativeStructure.FieldGradient(T value, T... gradient)Build an instance with values and derivative.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldGradient<T>abs()absolute value.FieldGradient<T>add(double a)'+' operator.FieldGradient<T>add(FieldGradient<T> a)Compute this + a.FieldGradient<T>atan2(FieldGradient<T> x)Two arguments arc tangent operation.FieldGradient<T>compose(T g0, T g1)Compute composition of the instance by a function.static <T extends CalculusFieldElement<T>>
FieldGradient<T>constant(int freeParameters, T value)Build an instance corresponding to a constant value.FieldGradient<T>copySign(double sign)Returns the instance with the sign of the argument.FieldGradient<T>copySign(FieldGradient<T> sign)Returns the instance with the sign of the argument.FieldGradient<T>copySign(T sign)Returns the instance with the sign of the argument.FieldGradient<T>divide(double a)'÷' operator.FieldGradient<T>divide(FieldGradient<T> a)Compute this ÷ a.FieldGradient<T>divide(T a)'÷' operator.booleanequals(Object other)Test for the equality of two univariate derivatives.FieldGradient<T>getAddendum()Get the addendum to the real value of the number.FieldGradientField<T>getField()Get theFieldto which the instance belongs.intgetFreeParameters()Get the number of free parameters.T[]getGradient()Get the gradient part of the function.TgetPartialDerivative(int n)Get the partial derivative with respect to one parameter.TgetPartialDerivative(int... orders)Get a partial derivative.FieldGradient<T>getPi()Get the Archimedes constant π.TgetValue()Get the value part of the function.Field<T>getValueField()Get theFieldthe value and parameters of the function belongs to.inthashCode()Get a hashCode for the univariate derivative.FieldGradient<T>hypot(FieldGradient<T> y)Returns the hypotenuse of a triangle with sidesthisandy- sqrt(this2 +y2) avoiding intermediate overflow or underflow.FieldGradient<T>linearCombination(double[] a, FieldGradient<T>[] b)Compute a linear combination.FieldGradient<T>linearCombination(double a1, FieldGradient<T> b1, double a2, FieldGradient<T> b2)Compute a linear combination.FieldGradient<T>linearCombination(double a1, FieldGradient<T> b1, double a2, FieldGradient<T> b2, double a3, FieldGradient<T> b3)Compute a linear combination.FieldGradient<T>linearCombination(double a1, FieldGradient<T> b1, double a2, FieldGradient<T> b2, double a3, FieldGradient<T> b3, double a4, FieldGradient<T> b4)Compute a linear combination.FieldGradient<T>linearCombination(FieldGradient<T>[] a, FieldGradient<T>[] b)Compute a linear combination.FieldGradient<T>linearCombination(FieldGradient<T> a1, FieldGradient<T> b1, FieldGradient<T> a2, FieldGradient<T> b2)Compute a linear combination.FieldGradient<T>linearCombination(FieldGradient<T> a1, FieldGradient<T> b1, FieldGradient<T> a2, FieldGradient<T> b2, FieldGradient<T> a3, FieldGradient<T> b3)Compute a linear combination.FieldGradient<T>linearCombination(FieldGradient<T> a1, FieldGradient<T> b1, FieldGradient<T> a2, FieldGradient<T> b2, FieldGradient<T> a3, FieldGradient<T> b3, FieldGradient<T> a4, FieldGradient<T> b4)Compute a linear combination.FieldGradient<T>linearCombination(T[] a, FieldGradient<T>[] b)Compute a linear combination.FieldGradient<T>linearCombination(T a1, FieldGradient<T> b1, T a2, FieldGradient<T> b2, T a3, FieldGradient<T> b3)Compute a linear combination.FieldGradient<T>multiply(double a)'×' operator.FieldGradient<T>multiply(int n)Compute n × this.FieldGradient<T>multiply(FieldGradient<T> a)Compute this × a.FieldGradient<T>multiply(T n)'×' operator.FieldGradient<T>negate()Returns the additive inverse ofthiselement.FieldGradient<T>newInstance(double c)Create an instance corresponding to a constant real value.FieldGradient<T>newInstance(T c)Create an instance corresponding to a constant Field value.FieldGradient<T>pow(double p)Power operation.static <T extends CalculusFieldElement<T>>
FieldGradient<T>pow(double a, FieldGradient<T> x)Compute ax where a is a double and x aFieldGradientFieldGradient<T>pow(int n)Integer power operation.FieldGradient<T>remainder(double a)IEEE remainder operator.FieldGradient<T>remainder(FieldGradient<T> a)IEEE remainder operator.FieldGradient<T>remainder(T a)IEEE remainder operator.FieldGradient<T>rootN(int n)Nth root.FieldGradient<T>scalb(int n)Multiply the instance by a power of 2.FieldSinCos<FieldGradient<T>>sinCos()Combined Sine and Cosine operation.FieldSinhCosh<FieldGradient<T>>sinhCosh()Combined hyperbolic sine and cosine operation.FieldGradient<T>stackVariable()Add an independent variable to the Taylor expansion.FieldGradient<T>subtract(double a)'-' operator.FieldGradient<T>subtract(FieldGradient<T> a)Compute this - a.Ttaylor(double... delta)Evaluate Taylor expansion of a gradient.Ttaylor(T... delta)Evaluate Taylor expansion of a gradient.FieldGradient<T>toDegrees()Convert radians to degrees, with error of less than 0.5 ULPFieldDerivativeStructure<T>toDerivativeStructure()Convert the instance to aFieldDerivativeStructure.FieldGradient<T>toRadians()Convert degrees to radians, with error of less than 0.5 ULPstatic <T extends CalculusFieldElement<T>>
FieldGradient<T>variable(int freeParameters, int index, T value)Build aGradientrepresenting a variable.FieldGradient<T>withValue(T v)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
isFinite, isInfinite, isNaN, norm, round
-
Methods inherited from interface org.hipparchus.analysis.differentiation.FieldDerivative
add, ceil, floor, getExponent, getReal, pow, rint, sign, subtract, ulp
-
Methods inherited from interface org.hipparchus.analysis.differentiation.FieldDerivative1
acos, acosh, asin, asinh, atan, atanh, cbrt, cos, cosh, exp, expm1, getOrder, log, log10, log1p, reciprocal, sin, sinh, sqrt, square, tan, tanh
-
Methods inherited from interface org.hipparchus.FieldElement
isZero
-
-
-
-
Constructor Detail
-
FieldGradient
@SafeVarargs public FieldGradient(T value, T... gradient)
Build an instance with values and derivative.- Parameters:
value- value of the functiongradient- gradient of the function
-
FieldGradient
public FieldGradient(FieldDerivativeStructure<T> ds) throws MathIllegalArgumentException
Build an instance from aFieldDerivativeStructure.- Parameters:
ds- derivative structure- Throws:
MathIllegalArgumentException- ifdsorder is not 1
-
-
Method Detail
-
constant
public static <T extends CalculusFieldElement<T>> FieldGradient<T> constant(int freeParameters, T value)
Build an instance corresponding to a constant value.- Type Parameters:
T- the type of the function parameters and value- Parameters:
freeParameters- number of free parameters (i.e. dimension of the gradient)value- constant value of the function- Returns:
- a
FieldGradientwith a constant value and all derivatives set to 0.0
-
variable
public static <T extends CalculusFieldElement<T>> FieldGradient<T> variable(int freeParameters, int index, T value)
Build aGradientrepresenting a variable.Instances built using this method are considered to be the free variables with respect to which differentials are computed. As such, their differential with respect to themselves is +1.
- Type Parameters:
T- the type of the function parameters and value- Parameters:
freeParameters- number of free parameters (i.e. dimension of the gradient)index- index of the variable (from 0 togetFreeParameters()- 1)value- value of the variable- Returns:
- a
FieldGradientwith a constant value and all derivatives set to 0.0 except the one atindexwhich will be set to 1.0
-
getValueField
public Field<T> getValueField()
Get theFieldthe value and parameters of the function belongs to.- Returns:
Fieldthe value and parameters of the function belongs to
-
newInstance
public FieldGradient<T> newInstance(double c)
Create an instance corresponding to a constant real value.- Specified by:
newInstancein interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
c- constant real value- Returns:
- instance corresponding to a constant real value
-
newInstance
public FieldGradient<T> newInstance(T c)
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>,FieldGradient<T extends CalculusFieldElement<T>>>- Parameters:
c- constant value- Returns:
- instance corresponding to a constant Field value
-
withValue
public FieldGradient<T> withValue(T v)
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>,FieldGradient<T extends CalculusFieldElement<T>>>- Parameters:
v- zeroth-order derivative of new represented function- Returns:
- new object with changed value
-
getAddendum
public FieldGradient<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 function.- Specified by:
getValuein interfaceFieldDerivative<T extends CalculusFieldElement<T>,FieldGradient<T extends CalculusFieldElement<T>>>- Returns:
- value part of the value of the function
-
getGradient
public T[] getGradient()
Get the gradient part of the function.- Returns:
- gradient part of the value of the function
-
getFreeParameters
public int getFreeParameters()
Get the number of free parameters.- Specified by:
getFreeParametersin interfaceDifferentialAlgebra- Returns:
- number of free parameters
-
getPartialDerivative
public T getPartialDerivative(int... orders) throws MathIllegalArgumentException
Get a partial derivative.- Specified by:
getPartialDerivativein interfaceFieldDerivative<T extends CalculusFieldElement<T>,FieldGradient<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()
-
getPartialDerivative
public T getPartialDerivative(int n) throws MathIllegalArgumentException
Get the partial derivative with respect to one parameter.- Parameters:
n- index of the parameter (counting from 0)- Returns:
- partial derivative with respect to the nth parameter
- Throws:
MathIllegalArgumentException- if n is either negative or larger or equal togetFreeParameters()
-
toDerivativeStructure
public FieldDerivativeStructure<T> toDerivativeStructure()
Convert the instance to aFieldDerivativeStructure.- Returns:
- derivative structure with same value and derivative as the instance
-
add
public FieldGradient<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 FieldGradient<T> add(FieldGradient<T> a)
Compute this + a.- Specified by:
addin interfaceFieldElement<T extends CalculusFieldElement<T>>- Parameters:
a- element to add- Returns:
- a new element representing this + a
-
subtract
public FieldGradient<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 FieldGradient<T> subtract(FieldGradient<T> a)
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
-
multiply
public FieldGradient<T> multiply(T n)
'×' operator.- Parameters:
n- right hand side parameter of the operator- Returns:
- this×n
-
multiply
public FieldGradient<T> multiply(int n)
Compute n × this. Multiplication by an integer number is defined as the following sum \[ n \times \mathrm{this} = \sum_{i=1}^n \mathrm{this} \]- Specified by:
multiplyin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Specified by:
multiplyin interfaceFieldElement<T extends CalculusFieldElement<T>>- Parameters:
n- Number of timesthismust be added to itself.- Returns:
- A new element representing n × this.
-
multiply
public FieldGradient<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 FieldGradient<T> multiply(FieldGradient<T> a)
Compute this × a.- Specified by:
multiplyin interfaceFieldElement<T extends CalculusFieldElement<T>>- Parameters:
a- element to multiply- Returns:
- a new element representing this × a
-
divide
public FieldGradient<T> divide(T a)
'÷' operator.- Parameters:
a- right hand side parameter of the operator- Returns:
- this÷a
-
divide
public FieldGradient<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 FieldGradient<T> divide(FieldGradient<T> a)
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
-
remainder
public FieldGradient<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 FieldGradient<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 FieldGradient<T> remainder(FieldGradient<T> 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
-
negate
public FieldGradient<T> negate()
Returns the additive inverse ofthiselement.- Specified by:
negatein interfaceFieldElement<T extends CalculusFieldElement<T>>- Returns:
- the opposite of
this.
-
abs
public FieldGradient<T> abs()
absolute value.- Specified by:
absin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Returns:
- abs(this)
-
copySign
public FieldGradient<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 FieldGradient<T> copySign(FieldGradient<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
-
copySign
public FieldGradient<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
-
scalb
public FieldGradient<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 FieldGradient<T> hypot(FieldGradient<T> y)
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)
-
compose
public FieldGradient<T> compose(T g0, T g1)
Compute composition of the instance by a function.- Specified by:
composein interfaceFieldDerivative1<T extends CalculusFieldElement<T>,FieldGradient<T extends CalculusFieldElement<T>>>- Parameters:
g0- value of the function at the current point (i.e. atg(getValue()))g1- first derivative of the function at the current point (i.e. atg'(getValue()))- Returns:
- g(this)
-
rootN
public FieldGradient<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 FieldGradientField<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>> FieldGradient<T> pow(double a, FieldGradient<T> x)
Compute ax where a is a double and x aFieldGradient- Type Parameters:
T- the type of the function parameters and value- Parameters:
a- number to exponentiatex- power to apply- Returns:
- ax
-
pow
public FieldGradient<T> pow(double p)
Power operation.- Specified by:
powin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
p- power to apply- Returns:
- thisp
-
pow
public FieldGradient<T> pow(int n)
Integer power operation.- Specified by:
powin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
n- power to apply- Returns:
- thisn
-
sinCos
public FieldSinCos<FieldGradient<T>> sinCos()
Combined Sine and Cosine operation.- Specified by:
sinCosin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Specified by:
sinCosin interfaceFieldDerivative1<T extends CalculusFieldElement<T>,FieldGradient<T extends CalculusFieldElement<T>>>- Returns:
- [sin(this), cos(this)]
-
atan2
public FieldGradient<T> atan2(FieldGradient<T> x)
Two arguments arc tangent operation.Beware of the order or arguments! As this is based on a two-arguments functions, in order to be consistent with arguments order, the instance is the first argument and the single provided argument is the second argument. In order to be consistent with programming languages
atan2, this method computesatan2(this, x), i.e. the instance represents 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)
-
sinhCosh
public FieldSinhCosh<FieldGradient<T>> sinhCosh()
Combined hyperbolic sine and cosine operation.- Specified by:
sinhCoshin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Specified by:
sinhCoshin interfaceFieldDerivative1<T extends CalculusFieldElement<T>,FieldGradient<T extends CalculusFieldElement<T>>>- Returns:
- [sinh(this), cosh(this)]
-
toDegrees
public FieldGradient<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 FieldGradient<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
-
taylor
public T taylor(double... delta)
Evaluate Taylor expansion of a gradient.- Parameters:
delta- parameters offsets (Δx, Δy, ...)- Returns:
- value of the Taylor expansion at x + Δx, y + Δy, ...
-
taylor
public T taylor(T... delta)
Evaluate Taylor expansion of a gradient.- Parameters:
delta- parameters offsets (Δx, Δy, ...)- Returns:
- value of the Taylor expansion at x + Δx, y + Δy, ...
-
linearCombination
public FieldGradient<T> linearCombination(FieldGradient<T>[] a, FieldGradient<T>[] b)
Compute a linear combination.- Specified by:
linearCombinationin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
a- Factors.b- Factors.- Returns:
Σi ai bi.
-
linearCombination
public FieldGradient<T> linearCombination(T[] a, FieldGradient<T>[] b)
Compute a linear combination.- Parameters:
a- Factors.b- Factors.- Returns:
Σi ai bi.- Throws:
MathIllegalArgumentException- if arrays dimensions don't match
-
linearCombination
public FieldGradient<T> linearCombination(double[] a, FieldGradient<T>[] b)
Compute a linear combination.- Specified by:
linearCombinationin interfaceCalculusFieldElement<T extends CalculusFieldElement<T>>- Parameters:
a- Factors.b- Factors.- Returns:
Σi ai bi.
-
linearCombination
public FieldGradient<T> linearCombination(FieldGradient<T> a1, FieldGradient<T> b1, FieldGradient<T> a2, FieldGradient<T> b2)
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
- See Also:
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement),CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
-
linearCombination
public FieldGradient<T> linearCombination(double a1, FieldGradient<T> b1, double a2, FieldGradient<T> b2)
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
- See Also:
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement),CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement, double, FieldElement)
-
linearCombination
public FieldGradient<T> linearCombination(FieldGradient<T> a1, FieldGradient<T> b1, FieldGradient<T> a2, FieldGradient<T> b2, FieldGradient<T> a3, FieldGradient<T> b3)
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
- See Also:
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement),CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
-
linearCombination
public FieldGradient<T> linearCombination(T a1, FieldGradient<T> b1, T a2, FieldGradient<T> b2, T a3, FieldGradient<T> b3)
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, FieldGradient, double, FieldGradient),linearCombination(double, FieldGradient, double, FieldGradient, double, FieldGradient, double, FieldGradient)
-
linearCombination
public FieldGradient<T> linearCombination(double a1, FieldGradient<T> b1, double a2, FieldGradient<T> b2, double a3, FieldGradient<T> b3)
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
- See Also:
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement),CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement, double, FieldElement)
-
linearCombination
public FieldGradient<T> linearCombination(FieldGradient<T> a1, FieldGradient<T> b1, FieldGradient<T> a2, FieldGradient<T> b2, FieldGradient<T> a3, FieldGradient<T> b3, FieldGradient<T> a4, FieldGradient<T> b4)
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
- See Also:
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement),CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
-
linearCombination
public FieldGradient<T> linearCombination(double a1, FieldGradient<T> b1, double a2, FieldGradient<T> b2, double a3, FieldGradient<T> b3, double a4, FieldGradient<T> b4)
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
- See Also:
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement),CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement)
-
stackVariable
public FieldGradient<T> stackVariable()
Add an independent variable to the Taylor expansion.- Returns:
- object with one more variable
- Since:
- 4.0
-
getPi
public FieldGradient<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 univariate derivatives.univariate derivatives are considered equal if they have the same derivatives.
-
-