|
Nengo.ca | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.nengo.math.impl.NumericallyDifferentiableFunction
public class NumericallyDifferentiableFunction
A wrapper around any Function that provides a numerical approximation of its derivative, so that it can be used as a DifferentiableFunction. A Function should provide its exact derivative if available, rather than forcing callers to rely on this wrapper. TODO: test
Nested Class Summary | |
---|---|
static class |
NumericallyDifferentiableFunction.NumericalDerivative
|
Constructor Summary | |
---|---|
NumericallyDifferentiableFunction()
Uses dummy parameters to allow setting after construction. |
|
NumericallyDifferentiableFunction(Function function,
int derivativeDimension,
float delta)
|
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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()
Method Detail |
---|
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[][])
public Function clone() throws java.lang.CloneNotSupportedException
clone
in interface Function
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if clone can't be made
|
Nengo.ca | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |