ca.nengo.math.impl
Class LinearCurveFitter.InterpolatedFunction
java.lang.Object
ca.nengo.math.impl.AbstractFunction
ca.nengo.math.impl.LinearCurveFitter.InterpolatedFunction
- All Implemented Interfaces:
- Function, java.io.Serializable, java.lang.Cloneable
- Enclosing class:
- LinearCurveFitter
public static class LinearCurveFitter.InterpolatedFunction
- extends AbstractFunction
A 1-D Function based on interpolation between known points.
- Author:
- Bryan Tripp
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LinearCurveFitter.InterpolatedFunction
public LinearCurveFitter.InterpolatedFunction(float[] x,
float[] y)
- Parameters:
x - Known function-argument points to interpolate betweeny - Known function-output points to interpolate between (must be same length as x)
getConfiguration
public Configuration getConfiguration()
- Returns:
- Custom configuration
getNumPoints
public int getNumPoints()
- Returns:
- Number of points between which this function interpolates
setNumPoints
public void setNumPoints(int num)
- If this method is used to increase the number of interpolation points, new points
are set to equal what was previously the last point.
- Parameters:
num - New number of points between which this function interpolates
getX
public float[] getX()
- Returns:
- Known function-argument points to interpolate between
setX
public void setX(float[] x)
- Parameters:
x - Known function-argument points to interpolate between
getY
public float[] getY()
- Returns:
- Known function-output points to interpolate between
setY
public void setY(float[] y)
- Parameters:
y - Known function-output points to interpolate between
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:
AbstractFunction.map(float[])
interpolate
public static float interpolate(float[] xs,
float[] ys,
float x)
- Parameters:
xs - List of x valuesys - List of y values that x values map ontox - An x value at which to interpolate this mapping
- Returns:
- The interpolated y value
clone
public Function clone()
throws java.lang.CloneNotSupportedException
- Specified by:
clone in interface Function- Overrides:
clone in class AbstractFunction
- Throws:
java.lang.CloneNotSupportedException- See Also:
Object.clone()