public interface DoubleFunction1D extends DoubleUnaryOperator
Function is extended; this class allows arithmetic
operations on functions and defines a derivative function.| Modifier and Type | Method and Description |
|---|---|
default DoubleFunction1D |
add(double a)
For a DoubleFunction1D $g(x)$, adding a constant $a$ returns the function
$h(x) = g(x) + a$.
|
default DoubleFunction1D |
add(DoubleFunction1D f)
For a DoubleFunction1D $g(x)$, adding a function $f(x)$ returns the
function $h(x) = f(x) + g(x)$.
|
default DoubleFunction1D |
derivative()
Returns a function that calculates the first derivative.
|
default DoubleFunction1D |
derivative(FiniteDifferenceType differenceType,
double eps)
Returns a function that calculates the first derivative.
|
default DoubleFunction1D |
divide(double a)
For a DoubleFunction1D $g(x)$, dividing by a constant $a$ returns the
function $h(x) = \frac{g(x)}{a}$.
|
default DoubleFunction1D |
divide(DoubleFunction1D f)
For a DoubleFunction1D $g(x)$, dividing by a function $f(x)$ returns the
function $h(x) = \frac{g(x)}{f(x)}$.
|
static DoubleFunction1D |
from(Function<Double,Double> f)
Converts a Function<Double, Double> into a DoubleFunction1D.
|
default DoubleFunction1D |
multiply(double a)
For a DoubleFunction1D $g(x)$, multiplying by a constant $a$ returns the
function $h(x) = a g(x)$.
|
default DoubleFunction1D |
multiply(DoubleFunction1D f)
For a DoubleFunction1D $g(x)$, multiplying by a function $f(x)$ returns
the function $h(x) = f(x) g(x)$.
|
default DoubleFunction1D |
subtract(double a)
For a DoubleFunction1D $g(x)$, subtracting a constant $a$ returns the
function $h(x) = g(x) - a$.
|
default DoubleFunction1D |
subtract(DoubleFunction1D f)
For a DoubleFunction1D $g(x)$, subtracting a function $f(x)$ returns the
function $h(x) = f(x) - g(x)$.
|
andThen, applyAsDouble, compose, identitydefault DoubleFunction1D derivative()
The method used is central finite difference, with $\epsilon = 10^{-5}$. Implementing classes can override this method to return a function that is the exact functional representation of the first derivative.
default DoubleFunction1D derivative(FiniteDifferenceType differenceType, double eps)
differenceType - the differencing type to useeps - the $\epsilon$ to usedefault DoubleFunction1D add(DoubleFunction1D f)
f - the function to adddefault DoubleFunction1D add(double a)
a - the constant to adddefault DoubleFunction1D divide(DoubleFunction1D f)
f - the function to divide bydefault DoubleFunction1D divide(double a)
a - the constant to adddefault DoubleFunction1D multiply(DoubleFunction1D f)
f - the function to multiply bydefault DoubleFunction1D multiply(double a)
a - the constant to adddefault DoubleFunction1D subtract(DoubleFunction1D f)
f - the function to subtractdefault DoubleFunction1D subtract(double a)
a - the constant to addstatic DoubleFunction1D from(Function<Double,Double> f)
f - the function to convertCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.