T
- the type of the function parameters and valuepublic class FieldUnivariateDerivative1<T extends RealFieldElement<T>> extends FieldUnivariateDerivative<T,FieldUnivariateDerivative1<T>>
This class is a stripped-down version of FieldDerivativeStructure
with only one free parameter
and derivation order
also limited to one.
It should have less overhead than FieldDerivativeStructure
in its domain.
This class is an implementation of Rall's numbers. Rall's numbers are an extension to the real numbers used throughout mathematical expressions; they hold the derivative together with the value of a function.
FieldUnivariateDerivative1
instances can be used directly thanks to
the arithmetic operators to the mathematical functions provided as
methods by this class (+, -, *, /, %, sin, cos ...).
Implementing complex expressions by hand using these classes is a tedious and error-prone task but has the advantage of having no limitation on the derivation order despite not requiring users to compute the derivatives by themselves.
Instances of this class are guaranteed to be immutable.
DerivativeStructure
,
UnivariateDerivative1
,
UnivariateDerivative2
,
Gradient
,
FieldDerivativeStructure
,
FieldUnivariateDerivative2
,
FieldGradient
DEG_TO_RAD, RAD_TO_DEG
Constructor and Description |
---|
FieldUnivariateDerivative1(FieldDerivativeStructure<T> ds)
Build an instance from a
DerivativeStructure . |
FieldUnivariateDerivative1(T f0,
T f1)
Build an instance with values and derivative.
|
getFreeParameters, getPartialDerivative
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
round
isInfinite, isNaN
isZero
public FieldUnivariateDerivative1(T f0, T f1)
f0
- value of the functionf1
- first derivative of the functionpublic FieldUnivariateDerivative1(FieldDerivativeStructure<T> ds) throws MathIllegalArgumentException
DerivativeStructure
.ds
- derivative structureMathIllegalArgumentException
- if either ds
parameters
is not 1 or ds
order is not 1public FieldUnivariateDerivative1<T> newInstance(double value)
The default implementation creates the instance by adding
the value to getField().getZero()
. This is not optimal
and does not work when called with a negative zero as the
sign of zero is lost with the addition. The default implementation
should therefore be overridden in concrete classes. The default
implementation will be removed at the next major version.
value
- constant real valuepublic double getReal()
public T getValue()
public T getDerivative(int n)
getDerivative
in class FieldUnivariateDerivative<T extends RealFieldElement<T>,FieldUnivariateDerivative1<T extends RealFieldElement<T>>>
n
- derivation order (must be between 0 and getOrder()
, both inclusive)NaN
if n is
either negative or strictly larger than getOrder()
public int getOrder()
public T getFirstDerivative()
getValue()
public Field<T> getValueField()
Field
the value and parameters of the function belongs to.Field
the value and parameters of the function belongs topublic FieldDerivativeStructure<T> toDerivativeStructure()
FieldDerivativeStructure
.toDerivativeStructure
in class FieldUnivariateDerivative<T extends RealFieldElement<T>,FieldUnivariateDerivative1<T extends RealFieldElement<T>>>
public FieldUnivariateDerivative1<T> add(T a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative1<T> add(double a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative1<T> add(FieldUnivariateDerivative1<T> a)
a
- element to addpublic FieldUnivariateDerivative1<T> subtract(T a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative1<T> subtract(double a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative1<T> subtract(FieldUnivariateDerivative1<T> a)
a
- element to subtractpublic FieldUnivariateDerivative1<T> multiply(T a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative1<T> multiply(int n)
n
- Number of times this
must be added to itself.public FieldUnivariateDerivative1<T> multiply(double a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative1<T> multiply(FieldUnivariateDerivative1<T> a)
a
- element to multiplypublic FieldUnivariateDerivative1<T> divide(T a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative1<T> divide(double a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative1<T> divide(FieldUnivariateDerivative1<T> a)
a
- element to divide bypublic FieldUnivariateDerivative1<T> remainder(T a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative1<T> remainder(double a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative1<T> remainder(FieldUnivariateDerivative1<T> a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative1<T> negate()
this
element.this
.public FieldUnivariateDerivative1<T> abs()
public FieldUnivariateDerivative1<T> ceil()
public FieldUnivariateDerivative1<T> floor()
public FieldUnivariateDerivative1<T> rint()
public FieldUnivariateDerivative1<T> signum()
public FieldUnivariateDerivative1<T> copySign(T sign)
sign
argument is treated as positive.sign
- the sign for the returned valuesign
argumentpublic FieldUnivariateDerivative1<T> copySign(FieldUnivariateDerivative1<T> sign)
sign
argument is treated as positive.sign
- the sign for the returned valuesign
argumentpublic FieldUnivariateDerivative1<T> copySign(double sign)
sign
argument is treated as positive.sign
- the sign for the returned valuesign
argumentpublic int getExponent()
For double numbers of the form 2x, the unbiased exponent is exactly x.
public FieldUnivariateDerivative1<T> scalb(int n)
n
- power of 2public FieldUnivariateDerivative1<T> hypot(FieldUnivariateDerivative1<T> y)
this
and y
- sqrt(this2 +y2)
avoiding intermediate overflow or underflow.
y
- a valuepublic FieldUnivariateDerivative1<T> reciprocal()
this
element.this
.public FieldUnivariateDerivative1<T> compose(T g0, T g1)
g0
- value of the function at the current point (i.e. at g(getValue())
)g1
- first derivative of the function at the current point (i.e. at g'(getValue())
)public FieldUnivariateDerivative1<T> sqrt()
public FieldUnivariateDerivative1<T> cbrt()
public FieldUnivariateDerivative1<T> rootN(int n)
n
- order of the rootpublic FieldUnivariateDerivative1Field<T> getField()
Field
to which the instance belongs.Field
to which the instance belongspublic static <T extends RealFieldElement<T>> FieldUnivariateDerivative1<T> pow(double a, FieldUnivariateDerivative1<T> x)
FieldUnivariateDerivative1
T
- the type of the function parameters and valuea
- number to exponentiatex
- power to applypublic FieldUnivariateDerivative1<T> pow(double p)
p
- power to applypublic FieldUnivariateDerivative1<T> pow(int n)
n
- power to applypublic FieldUnivariateDerivative1<T> pow(FieldUnivariateDerivative1<T> e)
e
- exponentpublic FieldUnivariateDerivative1<T> exp()
public FieldUnivariateDerivative1<T> expm1()
public FieldUnivariateDerivative1<T> log()
public FieldUnivariateDerivative1<T> log1p()
public FieldUnivariateDerivative1<T> log10()
public FieldUnivariateDerivative1<T> cos()
public FieldUnivariateDerivative1<T> sin()
public FieldSinCos<FieldUnivariateDerivative1<T>> sinCos()
public FieldUnivariateDerivative1<T> tan()
public FieldUnivariateDerivative1<T> acos()
public FieldUnivariateDerivative1<T> asin()
public FieldUnivariateDerivative1<T> atan()
public FieldUnivariateDerivative1<T> atan2(FieldUnivariateDerivative1<T> x)
x
- second argument of the arc tangentpublic FieldUnivariateDerivative1<T> cosh()
public FieldUnivariateDerivative1<T> sinh()
public FieldUnivariateDerivative1<T> tanh()
public FieldUnivariateDerivative1<T> acosh()
public FieldUnivariateDerivative1<T> asinh()
public FieldUnivariateDerivative1<T> atanh()
public FieldUnivariateDerivative1<T> toDegrees()
public FieldUnivariateDerivative1<T> toRadians()
public T taylor(double delta)
delta
- parameter offset Δxpublic T taylor(T delta)
delta
- parameter offset Δxpublic FieldUnivariateDerivative1<T> linearCombination(T[] a, FieldUnivariateDerivative1<T>[] b)
a
- Factors.b
- Factors.Σi ai bi
.MathIllegalArgumentException
- if arrays dimensions don't matchpublic FieldUnivariateDerivative1<T> linearCombination(FieldUnivariateDerivative1<T>[] a, FieldUnivariateDerivative1<T>[] b)
a
- Factors.b
- Factors.Σi ai bi
.public FieldUnivariateDerivative1<T> linearCombination(double[] a, FieldUnivariateDerivative1<T>[] b)
a
- Factors.b
- Factors.Σi ai bi
.public FieldUnivariateDerivative1<T> linearCombination(FieldUnivariateDerivative1<T> a1, FieldUnivariateDerivative1<T> b1, FieldUnivariateDerivative1<T> a2, FieldUnivariateDerivative1<T> b2)
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second termCalculusFieldElement.linearCombination(Object, Object, Object, Object, Object, Object)
,
CalculusFieldElement.linearCombination(Object, Object, Object, Object, Object, Object, Object, Object)
public FieldUnivariateDerivative1<T> linearCombination(double a1, FieldUnivariateDerivative1<T> b1, double a2, FieldUnivariateDerivative1<T> b2)
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second termCalculusFieldElement.linearCombination(double, Object, double, Object, double, Object)
,
CalculusFieldElement.linearCombination(double, Object, double, Object, double, Object, double, Object)
public FieldUnivariateDerivative1<T> linearCombination(FieldUnivariateDerivative1<T> a1, FieldUnivariateDerivative1<T> b1, FieldUnivariateDerivative1<T> a2, FieldUnivariateDerivative1<T> b2, FieldUnivariateDerivative1<T> a3, FieldUnivariateDerivative1<T> b3)
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 termCalculusFieldElement.linearCombination(Object, Object, Object, Object)
,
CalculusFieldElement.linearCombination(Object, Object, Object, Object, Object, Object, Object, Object)
public FieldUnivariateDerivative1<T> linearCombination(T a1, FieldUnivariateDerivative1<T> b1, T a2, FieldUnivariateDerivative1<T> b2, T a3, FieldUnivariateDerivative1<T> b3)
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 termMathIllegalArgumentException
- if number of free parameters or orders are inconsistentCalculusFieldElement.linearCombination(double, Object, double, Object)
,
CalculusFieldElement.linearCombination(double, Object, double, Object, double, Object, double, Object)
public FieldUnivariateDerivative1<T> linearCombination(double a1, FieldUnivariateDerivative1<T> b1, double a2, FieldUnivariateDerivative1<T> b2, double a3, FieldUnivariateDerivative1<T> b3)
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 termCalculusFieldElement.linearCombination(double, Object, double, Object)
,
CalculusFieldElement.linearCombination(double, Object, double, Object, double, Object, double, Object)
public FieldUnivariateDerivative1<T> linearCombination(FieldUnivariateDerivative1<T> a1, FieldUnivariateDerivative1<T> b1, FieldUnivariateDerivative1<T> a2, FieldUnivariateDerivative1<T> b2, FieldUnivariateDerivative1<T> a3, FieldUnivariateDerivative1<T> b3, FieldUnivariateDerivative1<T> a4, FieldUnivariateDerivative1<T> b4)
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 termCalculusFieldElement.linearCombination(Object, Object, Object, Object)
,
CalculusFieldElement.linearCombination(Object, Object, Object, Object, Object, Object)
public FieldUnivariateDerivative1<T> linearCombination(double a1, FieldUnivariateDerivative1<T> b1, double a2, FieldUnivariateDerivative1<T> b2, double a3, FieldUnivariateDerivative1<T> b3, double a4, FieldUnivariateDerivative1<T> b4)
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 termCalculusFieldElement.linearCombination(double, Object, double, Object)
,
CalculusFieldElement.linearCombination(double, Object, double, Object, double, Object)
public boolean equals(Object other)
univariate derivatives are considered equal if they have the same derivatives.
Copyright © 2016–2020 Hipparchus.org. All rights reserved.