ca.nengo.math.impl
Class AbstractFunction
java.lang.Object
ca.nengo.math.impl.AbstractFunction
- All Implemented Interfaces:
- Function, java.io.Serializable, java.lang.Cloneable
- Direct Known Subclasses:
- Convolution, ExponentialPDF, FixedSignalFunction, FunctionBasisImpl, InterpolatedFunction, LinearFunction, PDFFunction, PiecewiseConstantFunction, PoissonPDF, Polynomial, RateFunctionSpikeGenerator.PoiraziDendriteSigmoid, RateFunctionSpikeGenerator.PoiraziSomaSigmoid, SigmoidFunction, SimpleFunctions.Acos, SimpleFunctions.Asin, SimpleFunctions.Atan, SimpleFunctions.Cos, SimpleFunctions.Exp, SimpleFunctions.Fold, SimpleFunctions.InverseNormal, SimpleFunctions.Ln, SimpleFunctions.Log10, SimpleFunctions.Log2, SimpleFunctions.Max, SimpleFunctions.Min, SimpleFunctions.Normal, SimpleFunctions.Pow, SimpleFunctions.Sin, SimpleFunctions.Sqrt, SimpleFunctions.Tan, TimeSeriesFunction
public abstract class AbstractFunction
- extends java.lang.Object
- implements Function
Base class for Function implementations. The default implementation of
multiMap() calls map(). This will be a little slower than if both methods
were to call a static function, so if multiMap speed is an issue this
method could be overridden, or it might be better not to use this abstract class.
- See Also:
- Serialized Form
Field Summary |
static java.lang.String |
DIMENSION_PROPERTY
How should we refer to the dimension? |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DIMENSION_PROPERTY
public static final java.lang.String DIMENSION_PROPERTY
- How should we refer to the dimension?
- See Also:
- Constant Field Values
AbstractFunction
public AbstractFunction(int dim)
- Parameters:
dim
- Input dimension of the function
getDimension
public int getDimension()
- Specified by:
getDimension
in interface Function
- Returns:
- Dimension of the space that the Function maps from
- See Also:
Function.getDimension()
getCode
public java.lang.String getCode()
setCode
public void setCode(java.lang.String code)
getName
public java.lang.String getName()
setName
public void setName(java.lang.String name)
map
public abstract float map(float[] from)
- Specified by:
map
in interface Function
- Parameters:
from
- Must have same length as getDimension()
- Returns:
- result of function operation on arg
- 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:
- Array of results of function operation on each arg
- 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
- is super does not support clone