T
- the type of the function parameters and valuepublic class FieldUnivariateDerivative2<T extends CalculusFieldElement<T>> extends FieldUnivariateDerivative<T,FieldUnivariateDerivative2<T>>
This class is a stripped-down version of FieldDerivativeStructure
with only one free parameter
and derivation order
limited to two.
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.
FieldUnivariateDerivative2
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
,
FieldUnivariateDerivative1
,
FieldGradient
Constructor and Description |
---|
FieldUnivariateDerivative2(FieldDerivativeStructure<T> ds)
Build an instance from a
DerivativeStructure . |
FieldUnivariateDerivative2(T f0,
T f1,
T f2)
Build an instance with values and derivative.
|
Modifier and Type | Method and Description |
---|---|
FieldUnivariateDerivative2<T> |
abs()
absolute value.
|
FieldUnivariateDerivative2<T> |
acos()
Arc cosine operation.
|
FieldUnivariateDerivative2<T> |
acosh()
Inverse hyperbolic cosine operation.
|
FieldUnivariateDerivative2<T> |
add(double a)
'+' operator.
|
FieldUnivariateDerivative2<T> |
add(FieldUnivariateDerivative2<T> a)
Compute this + a.
|
FieldUnivariateDerivative2<T> |
add(T a)
'+' operator.
|
FieldUnivariateDerivative2<T> |
asin()
Arc sine operation.
|
FieldUnivariateDerivative2<T> |
asinh()
Inverse hyperbolic sine operation.
|
FieldUnivariateDerivative2<T> |
atan()
Arc tangent operation.
|
FieldUnivariateDerivative2<T> |
atan2(FieldUnivariateDerivative2<T> x)
Two arguments arc tangent operation.
|
FieldUnivariateDerivative2<T> |
atanh()
Inverse hyperbolic tangent operation.
|
FieldUnivariateDerivative2<T> |
cbrt()
Cubic root.
|
FieldUnivariateDerivative2<T> |
ceil()
Get the smallest whole number larger than instance.
|
FieldUnivariateDerivative2<T> |
compose(T g0,
T g1,
T g2)
Compute composition of the instance by a function.
|
FieldUnivariateDerivative2<T> |
copySign(double sign)
Returns the instance with the sign of the argument.
|
FieldUnivariateDerivative2<T> |
copySign(FieldUnivariateDerivative2<T> sign)
Returns the instance with the sign of the argument.
|
FieldUnivariateDerivative2<T> |
copySign(T sign)
Returns the instance with the sign of the argument.
|
FieldUnivariateDerivative2<T> |
cos()
Cosine operation.
|
FieldUnivariateDerivative2<T> |
cosh()
Hyperbolic cosine operation.
|
FieldUnivariateDerivative2<T> |
divide(double a)
'÷' operator.
|
FieldUnivariateDerivative2<T> |
divide(FieldUnivariateDerivative2<T> a)
Compute this ÷ a.
|
FieldUnivariateDerivative2<T> |
divide(T a)
'÷' operator.
|
boolean |
equals(Object other)
Test for the equality of two univariate derivatives.
|
FieldUnivariateDerivative2<T> |
exp()
Exponential.
|
FieldUnivariateDerivative2<T> |
expm1()
Exponential minus 1.
|
FieldUnivariateDerivative2<T> |
floor()
Get the largest whole number smaller than instance.
|
T |
getDerivative(int n)
Get a derivative from the univariate derivative.
|
int |
getExponent()
Return the exponent of the instance, removing the bias.
|
FieldUnivariateDerivative2Field<T> |
getField()
Get the
Field to which the instance belongs. |
T |
getFirstDerivative()
Get the first derivative.
|
int |
getOrder()
Get the derivation order.
|
FieldUnivariateDerivative2<T> |
getPi()
Get the Archimedes constant π.
|
double |
getReal()
Get the real value of the number.
|
T |
getSecondDerivative()
Get the second derivative.
|
T |
getValue()
Get the value part of the univariate derivative.
|
Field<T> |
getValueField()
Get the
Field the value and parameters of the function belongs to. |
int |
hashCode()
Get a hashCode for the univariate derivative.
|
FieldUnivariateDerivative2<T> |
hypot(FieldUnivariateDerivative2<T> y)
Returns the hypotenuse of a triangle with sides
this and y
- sqrt(this2 +y2)
avoiding intermediate overflow or underflow. |
FieldUnivariateDerivative2<T> |
linearCombination(double[] a,
FieldUnivariateDerivative2<T>[] b)
Compute a linear combination.
|
FieldUnivariateDerivative2<T> |
linearCombination(double a1,
FieldUnivariateDerivative2<T> b1,
double a2,
FieldUnivariateDerivative2<T> b2)
Compute a linear combination.
|
FieldUnivariateDerivative2<T> |
linearCombination(double a1,
FieldUnivariateDerivative2<T> b1,
double a2,
FieldUnivariateDerivative2<T> b2,
double a3,
FieldUnivariateDerivative2<T> b3)
Compute a linear combination.
|
FieldUnivariateDerivative2<T> |
linearCombination(double a1,
FieldUnivariateDerivative2<T> b1,
double a2,
FieldUnivariateDerivative2<T> b2,
double a3,
FieldUnivariateDerivative2<T> b3,
double a4,
FieldUnivariateDerivative2<T> b4)
Compute a linear combination.
|
FieldUnivariateDerivative2<T> |
linearCombination(FieldUnivariateDerivative2<T>[] a,
FieldUnivariateDerivative2<T>[] b)
Compute a linear combination.
|
FieldUnivariateDerivative2<T> |
linearCombination(FieldUnivariateDerivative2<T> a1,
FieldUnivariateDerivative2<T> b1,
FieldUnivariateDerivative2<T> a2,
FieldUnivariateDerivative2<T> b2)
Compute a linear combination.
|
FieldUnivariateDerivative2<T> |
linearCombination(FieldUnivariateDerivative2<T> a1,
FieldUnivariateDerivative2<T> b1,
FieldUnivariateDerivative2<T> a2,
FieldUnivariateDerivative2<T> b2,
FieldUnivariateDerivative2<T> a3,
FieldUnivariateDerivative2<T> b3)
Compute a linear combination.
|
FieldUnivariateDerivative2<T> |
linearCombination(FieldUnivariateDerivative2<T> a1,
FieldUnivariateDerivative2<T> b1,
FieldUnivariateDerivative2<T> a2,
FieldUnivariateDerivative2<T> b2,
FieldUnivariateDerivative2<T> a3,
FieldUnivariateDerivative2<T> b3,
FieldUnivariateDerivative2<T> a4,
FieldUnivariateDerivative2<T> b4)
Compute a linear combination.
|
FieldUnivariateDerivative2<T> |
linearCombination(T[] a,
FieldUnivariateDerivative2<T>[] b)
Compute a linear combination.
|
FieldUnivariateDerivative2<T> |
linearCombination(T a1,
FieldUnivariateDerivative2<T> b1,
T a2,
FieldUnivariateDerivative2<T> b2,
T a3,
FieldUnivariateDerivative2<T> b3)
Compute a linear combination.
|
FieldUnivariateDerivative2<T> |
log()
Natural logarithm.
|
FieldUnivariateDerivative2<T> |
log10()
Base 10 logarithm.
|
FieldUnivariateDerivative2<T> |
log1p()
Shifted natural logarithm.
|
FieldUnivariateDerivative2<T> |
multiply(double a)
'×' operator.
|
FieldUnivariateDerivative2<T> |
multiply(FieldUnivariateDerivative2<T> a)
Compute this × a.
|
FieldUnivariateDerivative2<T> |
multiply(int n)
Compute n × this.
|
FieldUnivariateDerivative2<T> |
multiply(T a)
'×' operator.
|
FieldUnivariateDerivative2<T> |
negate()
Returns the additive inverse of
this element. |
FieldUnivariateDerivative2<T> |
newInstance(double value)
Create an instance corresponding to a constant real value.
|
FieldUnivariateDerivative2<T> |
pow(double p)
Power operation.
|
static <T extends CalculusFieldElement<T>> |
pow(double a,
FieldUnivariateDerivative2<T> x)
Compute ax where a is a double and x a
FieldUnivariateDerivative2 |
FieldUnivariateDerivative2<T> |
pow(FieldUnivariateDerivative2<T> e)
Power operation.
|
FieldUnivariateDerivative2<T> |
pow(int n)
Integer power operation.
|
FieldUnivariateDerivative2<T> |
reciprocal()
Returns the multiplicative inverse of
this element. |
FieldUnivariateDerivative2<T> |
remainder(double a)
IEEE remainder operator.
|
FieldUnivariateDerivative2<T> |
remainder(FieldUnivariateDerivative2<T> a)
IEEE remainder operator.
|
FieldUnivariateDerivative2<T> |
remainder(T a)
IEEE remainder operator.
|
FieldUnivariateDerivative2<T> |
rint()
Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers.
|
FieldUnivariateDerivative2<T> |
rootN(int n)
Nth root.
|
FieldUnivariateDerivative2<T> |
scalb(int n)
Multiply the instance by a power of 2.
|
FieldUnivariateDerivative2<T> |
sign()
Compute the sign of the instance.
|
FieldUnivariateDerivative2<T> |
sin()
Sine operation.
|
FieldSinCos<FieldUnivariateDerivative2<T>> |
sinCos()
Combined Sine and Cosine operation.
|
FieldUnivariateDerivative2<T> |
sinh()
Hyperbolic sine operation.
|
FieldSinhCosh<FieldUnivariateDerivative2<T>> |
sinhCosh()
Combined hyperbolic sine and sosine operation.
|
FieldUnivariateDerivative2<T> |
sqrt()
Square root.
|
FieldUnivariateDerivative2<T> |
subtract(double a)
'-' operator.
|
FieldUnivariateDerivative2<T> |
subtract(FieldUnivariateDerivative2<T> a)
Compute this - a.
|
FieldUnivariateDerivative2<T> |
subtract(T a)
'-' operator.
|
FieldUnivariateDerivative2<T> |
tan()
Tangent operation.
|
FieldUnivariateDerivative2<T> |
tanh()
Hyperbolic tangent operation.
|
T |
taylor(double delta)
Evaluate Taylor expansion a univariate derivative.
|
T |
taylor(T delta)
Evaluate Taylor expansion a univariate derivative.
|
FieldUnivariateDerivative2<T> |
toDegrees()
Convert radians to degrees, with error of less than 0.5 ULP
|
FieldDerivativeStructure<T> |
toDerivativeStructure()
Convert the instance to a
FieldDerivativeStructure . |
FieldUnivariateDerivative2<T> |
toRadians()
Convert degrees to radians, with error of less than 0.5 ULP
|
FieldUnivariateDerivative2<T> |
ulp()
Compute least significant bit (Unit in Last Position) for a number.
|
getFreeParameters, getPartialDerivative
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
isFinite, isInfinite, isNaN, norm, round
isZero
public FieldUnivariateDerivative2(T f0, T f1, T f2)
f0
- value of the functionf1
- first derivative of the functionf2
- second derivative of the functionpublic FieldUnivariateDerivative2(FieldDerivativeStructure<T> ds) throws MathIllegalArgumentException
DerivativeStructure
.ds
- derivative structureMathIllegalArgumentException
- if either ds
parameters
is not 1 or ds
order is not 2public FieldUnivariateDerivative2<T> newInstance(double value)
value
- constant real valuepublic double getReal()
public T getValue()
public T getDerivative(int n)
getDerivative
in class FieldUnivariateDerivative<T extends CalculusFieldElement<T>,FieldUnivariateDerivative2<T extends CalculusFieldElement<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 T getSecondDerivative()
getValue()
,
getFirstDerivative()
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 CalculusFieldElement<T>,FieldUnivariateDerivative2<T extends CalculusFieldElement<T>>>
public FieldUnivariateDerivative2<T> add(T a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative2<T> add(double a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative2<T> add(FieldUnivariateDerivative2<T> a)
a
- element to addpublic FieldUnivariateDerivative2<T> subtract(T a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative2<T> subtract(double a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative2<T> subtract(FieldUnivariateDerivative2<T> a)
a
- element to subtractpublic FieldUnivariateDerivative2<T> multiply(T a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative2<T> multiply(int n)
n
- Number of times this
must be added to itself.public FieldUnivariateDerivative2<T> multiply(double a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative2<T> multiply(FieldUnivariateDerivative2<T> a)
a
- element to multiplypublic FieldUnivariateDerivative2<T> divide(T a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative2<T> divide(double a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative2<T> divide(FieldUnivariateDerivative2<T> a)
a
- element to divide bypublic FieldUnivariateDerivative2<T> remainder(T a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative2<T> remainder(double a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative2<T> remainder(FieldUnivariateDerivative2<T> a)
a
- right hand side parameter of the operatorpublic FieldUnivariateDerivative2<T> negate()
this
element.this
.public FieldUnivariateDerivative2<T> abs()
Just another name for CalculusFieldElement.norm()
public FieldUnivariateDerivative2<T> ceil()
public FieldUnivariateDerivative2<T> floor()
public FieldUnivariateDerivative2<T> rint()
public FieldUnivariateDerivative2<T> sign()
public FieldUnivariateDerivative2<T> copySign(T sign)
sign
argument is treated as positive.sign
- the sign for the returned valuesign
argumentpublic FieldUnivariateDerivative2<T> copySign(FieldUnivariateDerivative2<T> sign)
sign
argument is treated as positive.sign
- the sign for the returned valuesign
argumentpublic FieldUnivariateDerivative2<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 FieldUnivariateDerivative2<T> scalb(int n)
n
- power of 2public FieldUnivariateDerivative2<T> ulp()
The ulp
function is a step function, hence all its derivatives are 0.
public FieldUnivariateDerivative2<T> hypot(FieldUnivariateDerivative2<T> y)
this
and y
- sqrt(this2 +y2)
avoiding intermediate overflow or underflow.
y
- a valuepublic FieldUnivariateDerivative2<T> reciprocal()
this
element.this
.public FieldUnivariateDerivative2<T> compose(T g0, T g1, T g2)
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())
)g2
- second derivative of the function at the current point (i.e. at g''(getValue())
)public FieldUnivariateDerivative2<T> sqrt()
public FieldUnivariateDerivative2<T> cbrt()
public FieldUnivariateDerivative2<T> rootN(int n)
n
- order of the rootpublic FieldUnivariateDerivative2Field<T> getField()
Field
to which the instance belongs.Field
to which the instance belongspublic static <T extends CalculusFieldElement<T>> FieldUnivariateDerivative2<T> pow(double a, FieldUnivariateDerivative2<T> x)
FieldUnivariateDerivative2
T
- the type of the function parameters and valuea
- number to exponentiatex
- power to applypublic FieldUnivariateDerivative2<T> pow(double p)
p
- power to applypublic FieldUnivariateDerivative2<T> pow(int n)
n
- power to applypublic FieldUnivariateDerivative2<T> pow(FieldUnivariateDerivative2<T> e)
e
- exponentpublic FieldUnivariateDerivative2<T> exp()
public FieldUnivariateDerivative2<T> expm1()
public FieldUnivariateDerivative2<T> log()
public FieldUnivariateDerivative2<T> log1p()
public FieldUnivariateDerivative2<T> log10()
public FieldUnivariateDerivative2<T> cos()
public FieldUnivariateDerivative2<T> sin()
public FieldSinCos<FieldUnivariateDerivative2<T>> sinCos()
public FieldUnivariateDerivative2<T> tan()
public FieldUnivariateDerivative2<T> acos()
public FieldUnivariateDerivative2<T> asin()
public FieldUnivariateDerivative2<T> atan()
public FieldUnivariateDerivative2<T> atan2(FieldUnivariateDerivative2<T> x)
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.
x
- second argument of the arc tangentpublic FieldUnivariateDerivative2<T> cosh()
public FieldUnivariateDerivative2<T> sinh()
public FieldSinhCosh<FieldUnivariateDerivative2<T>> sinhCosh()
public FieldUnivariateDerivative2<T> tanh()
public FieldUnivariateDerivative2<T> acosh()
public FieldUnivariateDerivative2<T> asinh()
public FieldUnivariateDerivative2<T> atanh()
public FieldUnivariateDerivative2<T> toDegrees()
public FieldUnivariateDerivative2<T> toRadians()
public T taylor(double delta)
delta
- parameter offset Δxpublic T taylor(T delta)
delta
- parameter offset Δxpublic FieldUnivariateDerivative2<T> linearCombination(T[] a, FieldUnivariateDerivative2<T>[] b)
a
- Factors.b
- Factors.Σi ai bi
.MathIllegalArgumentException
- if arrays dimensions don't matchpublic FieldUnivariateDerivative2<T> linearCombination(FieldUnivariateDerivative2<T>[] a, FieldUnivariateDerivative2<T>[] b)
a
- Factors.b
- Factors.Σi ai bi
.public FieldUnivariateDerivative2<T> linearCombination(double[] a, FieldUnivariateDerivative2<T>[] b)
a
- Factors.b
- Factors.Σi ai bi
.public FieldUnivariateDerivative2<T> linearCombination(FieldUnivariateDerivative2<T> a1, FieldUnivariateDerivative2<T> b1, FieldUnivariateDerivative2<T> a2, FieldUnivariateDerivative2<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(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
,
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
public FieldUnivariateDerivative2<T> linearCombination(double a1, FieldUnivariateDerivative2<T> b1, double a2, FieldUnivariateDerivative2<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, FieldElement, double, FieldElement, double, FieldElement)
,
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement, double, FieldElement)
public FieldUnivariateDerivative2<T> linearCombination(FieldUnivariateDerivative2<T> a1, FieldUnivariateDerivative2<T> b1, FieldUnivariateDerivative2<T> a2, FieldUnivariateDerivative2<T> b2, FieldUnivariateDerivative2<T> a3, FieldUnivariateDerivative2<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(FieldElement, FieldElement, FieldElement, FieldElement)
,
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
public FieldUnivariateDerivative2<T> linearCombination(T a1, FieldUnivariateDerivative2<T> b1, T a2, FieldUnivariateDerivative2<T> b2, T a3, FieldUnivariateDerivative2<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 inconsistentlinearCombination(double, FieldUnivariateDerivative2, double, FieldUnivariateDerivative2)
,
linearCombination(double, FieldUnivariateDerivative2, double, FieldUnivariateDerivative2, double, FieldUnivariateDerivative2, double, FieldUnivariateDerivative2)
public FieldUnivariateDerivative2<T> linearCombination(double a1, FieldUnivariateDerivative2<T> b1, double a2, FieldUnivariateDerivative2<T> b2, double a3, FieldUnivariateDerivative2<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, FieldElement, double, FieldElement)
,
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement, double, FieldElement)
public FieldUnivariateDerivative2<T> linearCombination(FieldUnivariateDerivative2<T> a1, FieldUnivariateDerivative2<T> b1, FieldUnivariateDerivative2<T> a2, FieldUnivariateDerivative2<T> b2, FieldUnivariateDerivative2<T> a3, FieldUnivariateDerivative2<T> b3, FieldUnivariateDerivative2<T> a4, FieldUnivariateDerivative2<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(FieldElement, FieldElement, FieldElement, FieldElement)
,
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
public FieldUnivariateDerivative2<T> linearCombination(double a1, FieldUnivariateDerivative2<T> b1, double a2, FieldUnivariateDerivative2<T> b2, double a3, FieldUnivariateDerivative2<T> b3, double a4, FieldUnivariateDerivative2<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, FieldElement, double, FieldElement)
,
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement)
public FieldUnivariateDerivative2<T> getPi()
Archimedes constant is the ratio of a circle's circumference to its diameter.
public boolean equals(Object other)
univariate derivatives are considered equal if they have the same derivatives.
Copyright © 2016-2021 CS GROUP. All rights reserved.