ca.nengo.math.impl
Class NumericallyDifferentiableFunction.NumericalDerivative
java.lang.Object
ca.nengo.math.impl.NumericallyDifferentiableFunction.NumericalDerivative
- All Implemented Interfaces:
- Function, java.io.Serializable, java.lang.Cloneable
- Enclosing class:
- NumericallyDifferentiableFunction
public static class NumericallyDifferentiableFunction.NumericalDerivative
- extends java.lang.Object
- implements Function
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NumericallyDifferentiableFunction.NumericalDerivative
public NumericallyDifferentiableFunction.NumericalDerivative(Function function,
int derivativeDimension,
float delta)
- Parameters:
function
- The Function of which the derivative is to be approximatedderivativeDimension
- The dimension along which the derivative is to be calculateddelta
- Derivative approximation of f(x) is [f(x+delta)-f(x-delta)]/[2*delta]
getDimension
public int getDimension()
- Specified by:
getDimension
in interface Function
- Returns:
- Dimension of the space that the Function maps from
- See Also:
Function.getDimension()
getFunction
public Function getFunction()
- Returns:
- The Function of which the derivative is to be approximated
getDerivativeDimension
public int getDerivativeDimension()
- Returns:
- The dimension along which the derivative is to be calculated
setDerivativeDimension
public void setDerivativeDimension(int dim)
- Parameters:
dim
- The dimension along which the derivative is to be calculated
getDelta
public float getDelta()
- Returns:
- The variable delta in derivative approximation [f(x+delta)-f(x-delta)]/[2*delta]
setDelta
public void setDelta(float delta)
- Parameters:
delta
- The variable delta in derivative approximation [f(x+delta)-f(x-delta)]/[2*delta]
map
public float map(float[] from)
- Specified by:
map
in interface Function
- Parameters:
from
- Must have same length as getDimension()
- Returns:
- An approximation of the derivative of the underlying Function
- See Also:
Function.map(float[])
multiMap
public float[] multiMap(float[][] from)
- Specified by:
multiMap
in interface Function
- Parameters:
from
- An array of arguments; each element must have length getDimension().
- Returns:
- Approximations of the derivative of the underlying Function at multiple points
- See Also:
Function.multiMap(float[][])
clone
public Function clone()
throws java.lang.CloneNotSupportedException
- Specified by:
clone
in interface Function
- Overrides:
clone
in class java.lang.Object
- Returns:
- Valid clone
- Throws:
java.lang.CloneNotSupportedException
- if clone can't be made