ca.nengo.math.impl
Class LinearFunction
java.lang.Object
ca.nengo.math.impl.AbstractFunction
ca.nengo.math.impl.LinearFunction
- All Implemented Interfaces:
- Function, java.io.Serializable, java.lang.Cloneable
public class LinearFunction
- extends AbstractFunction
A linear map into one dimension. Optionally, the result can be biased and/or
rectified.
- See Also:
- Serialized Form
Constructor Summary |
LinearFunction(float[] map,
float bias,
boolean rectified)
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LinearFunction
public LinearFunction(float[] map,
float bias,
boolean rectified)
- Parameters:
map
- A 1Xn matrix that defines a map from input onto one dimension
(i.e. f(x) = m'x, where m is the map)bias
- Bias to add to resultrectified
- If true, result is rectified (set to 0 if less than 0)
getMap
public float[] getMap()
- Returns:
- map A 1Xn matrix that defines a map from input onto one dimension
(i.e. f(x) = m'x, where m is the map)
setMap
public void setMap(float[] map)
- Parameters:
map
- map A 1Xn matrix that defines a map from input onto one dimension
(i.e. f(x) = m'x, where m is the map)
getBias
public float getBias()
- Returns:
- Bias to add to result
setBias
public void setBias(float bias)
- Parameters:
bias
- Bias to add to result
getRectified
public boolean getRectified()
- Returns:
- If true, result is rectified (set to 0 if less than 0)
setRectified
public void setRectified(boolean rectified)
- Parameters:
rectified
- If true, result is rectified (set to 0 if less than 0)
map
public float map(float[] from)
- Specified by:
map
in interface Function
- Specified by:
map
in class AbstractFunction
- Parameters:
from
- Must have same length as getDimension()
- Returns:
- result of function operation on arg
- See Also:
Function.map(float[])
clone
public Function clone()
throws java.lang.CloneNotSupportedException
- Specified by:
clone
in interface Function
- Overrides:
clone
in class AbstractFunction
- Returns:
- Valid clone
- Throws:
java.lang.CloneNotSupportedException
- is super does not support clone