ca.nengo.math.impl
Class LinearCurveFitter
java.lang.Object
ca.nengo.math.impl.LinearCurveFitter
- All Implemented Interfaces:
- CurveFitter, java.lang.Cloneable
public class LinearCurveFitter
- extends java.lang.Object
- implements CurveFitter
Interpolates linearly between example points. Outside the range of examples,
the last interval is extrapolated.
Inputs x must be sorted from lowest to highest.
TODO: sort inputs
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LinearCurveFitter
public LinearCurveFitter()
fit
public Function fit(float[] x,
float[] y)
- Note that inputs x must be sorted from lowest to highest.
- Specified by:
fit
in interface CurveFitter
- Parameters:
x
- Example x pointsy
- Example y points (must be same length as x)
- Returns:
- A Function that approximates the mapping Y=f(X) exemplified by x and y.
- See Also:
CurveFitter.fit(float[], float[])
clone
public CurveFitter clone()
throws java.lang.CloneNotSupportedException
- Specified by:
clone
in interface CurveFitter
- Overrides:
clone
in class java.lang.Object
- Returns:
- Valid clone
- Throws:
java.lang.CloneNotSupportedException
- is clone can't be made