Nengo.ca

ca.nengo.math.impl
Class NumericallyDifferentiableFunction.NumericalDerivative

java.lang.Object
  extended by 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

Constructor Summary
NumericallyDifferentiableFunction.NumericalDerivative(Function function, int derivativeDimension, float delta)
           
 
Method Summary
 Function clone()
           
 float getDelta()
           
 int getDerivativeDimension()
           
 int getDimension()
           
 Function getFunction()
           
 float map(float[] from)
           
 float[] multiMap(float[][] from)
           
 void setDelta(float delta)
           
 void setDerivativeDimension(int dim)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericallyDifferentiableFunction.NumericalDerivative

public NumericallyDifferentiableFunction.NumericalDerivative(Function function,
                                                             int derivativeDimension,
                                                             float delta)
Parameters:
function - The Function of which the derivative is to be approximated
derivativeDimension - The dimension along which the derivative is to be calculated
delta - Derivative approximation of f(x) is [f(x+delta)-f(x-delta)]/[2*delta]
Method Detail

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

Nengo.ca