public class FiniteDifference extends AbstractUnivariateRealFunction
Modifier and Type | Class and Description |
---|---|
static class |
FiniteDifference.Type
the available types of finite difference
|
Function.EvaluationException
Constructor and Description |
---|
FiniteDifference(UnivariateRealFunction f,
int order,
FiniteDifference.Type type)
Construct an approximate derivative function for f using finite
difference.
|
Modifier and Type | Method and Description |
---|---|
double |
df(double x,
double h)
Compute the finite difference for f at x with an increment
h for the n-th order using either forward, backward, or
central difference.
|
double |
evaluate(double x)
Evaluate y = f(x).
|
double |
evaluate(double x,
double h)
Evaluate numerically the derivative of f at point x,
f'(x), with step size h.
|
evaluate
dimensionOfDomain, dimensionOfRange
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dimensionOfDomain, dimensionOfRange
public FiniteDifference(UnivariateRealFunction f, int order, FiniteDifference.Type type)
f
- a univariate functionorder
- the order of the derivativetype
- the type of finite difference to use, c.f., FiniteDifference.Type
public double evaluate(double x)
UnivariateRealFunction
x
- xpublic double evaluate(double x, double h)
x
- the point to evaluate the derivative of f ath
- step sizepublic double df(double x, double h)
x
- the point to evaluate the function ath
- the incrementCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.