public class NumericallyDifferentiableFunction extends java.lang.Object implements DifferentiableFunction
Modifier and Type | Class and Description |
---|---|
static class |
NumericallyDifferentiableFunction.NumericalDerivative |
Constructor and Description |
---|
NumericallyDifferentiableFunction()
Uses dummy parameters to allow setting after construction.
|
NumericallyDifferentiableFunction(Function function,
int derivativeDimension,
float delta) |
Modifier and Type | Method and Description |
---|---|
Function |
clone() |
float |
getDelta() |
Function |
getDerivative() |
int |
getDerivativeDimension() |
int |
getDimension()
Passed through to underlying Function.
|
Function |
getFunction() |
float |
map(float[] from)
Passed through to underlying Function.
|
float[] |
multiMap(float[][] from)
Passed through to underlying Function.
|
void |
setFunction(Function function) |
public NumericallyDifferentiableFunction(Function function, int derivativeDimension, float delta)
function
- An underlying FunctionderivativeDimension
- The dimension along which the derivative is to be calculated
(note that the gradient of a multi-dimensional Function consists of multiple DifferentiableFunctions)delta
- Derivative approximation of f(x) is [f(x+delta)-f(x-delta)]/[2*delta]public NumericallyDifferentiableFunction()
public Function getDerivative()
getDerivative
in interface DifferentiableFunction
DifferentiableFunction.getDerivative()
public int getDimension()
getDimension
in interface Function
Function.getDimension()
public Function getFunction()
public void setFunction(Function function)
function
- A new underlying Functionpublic int getDerivativeDimension()
public float getDelta()
public float map(float[] from)
map
in interface Function
from
- Must have same length as getDimension()Function.map(float[])
public float[] multiMap(float[][] from)
multiMap
in interface Function
from
- An array of arguments; each element must have length getDimension().Function.multiMap(float[][])