T
- the type of the function parameters and valuepublic class FieldUnivariateDerivative1<T extends CalculusFieldElement<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
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
isFinite, isInfinite, isNaN, norm, round
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)
value
- constant real valuepublic double getReal()
public T getValue()
public T getDerivative(int n)
getDerivative
in class FieldUnivariateDerivative<T extends CalculusFieldElement<T>,FieldUnivariateDerivative1<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 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>,FieldUnivariateDerivative1<T extends CalculusFieldElement<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()
Just another name for CalculusFieldElement.norm()
public FieldUnivariateDerivative1<T> ceil()
public FieldUnivariateDerivative1<T> floor()
public FieldUnivariateDerivative1<T> rint()
public FieldUnivariateDerivative1<T> sign()
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> ulp()
The ulp
function is a step function, hence all its derivatives are 0.
public 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 CalculusFieldElement<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)
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 FieldUnivariateDerivative1<T> cosh()
public FieldUnivariateDerivative1<T> sinh()
public FieldSinhCosh<FieldUnivariateDerivative1<T>> sinhCosh()
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(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
,
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
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, FieldElement, double, FieldElement, double, FieldElement)
,
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement, double, FieldElement)
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(FieldElement, FieldElement, FieldElement, FieldElement)
,
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
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 inconsistentlinearCombination(double, FieldUnivariateDerivative1, double, FieldUnivariateDerivative1)
,
linearCombination(double, FieldUnivariateDerivative1, double, FieldUnivariateDerivative1, double, FieldUnivariateDerivative1, double, FieldUnivariateDerivative1)
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, FieldElement, double, FieldElement)
,
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement, double, FieldElement)
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(FieldElement, FieldElement, FieldElement, FieldElement)
,
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
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, FieldElement, double, FieldElement)
,
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement)
public FieldUnivariateDerivative1<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-2022 CS GROUP. All rights reserved.