public class FiniteDifference extends UnivariateRealFunction
| Modifier and Type | Class and Description |
|---|---|
static class |
FiniteDifference.Type
the types of finite difference available
|
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.
|
dimensionOfDomain, dimensionOfRange, evaluatepublic 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.Typepublic double evaluate(double x)
UnivariateRealFunctionevaluate in class UnivariateRealFunctionx - 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 increment