public class InterpolatedFunction extends AbstractFunction
DIMENSION_PROPERTY
Constructor and Description |
---|
InterpolatedFunction(float[] x,
float[] y) |
Modifier and Type | Method and Description |
---|---|
Function |
clone() |
Configuration |
getConfiguration() |
int |
getNumPoints() |
float[] |
getX() |
float[] |
getY() |
static float |
interpolate(float[] xs,
float[] ys,
float x) |
float |
map(float[] from) |
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.
|
void |
setX(float[] x) |
void |
setY(float[] y) |
getCode, getDimension, getName, multiMap, setCode, setName
public InterpolatedFunction(float[] x, float[] y)
x
- Known function-argument points to interpolate betweeny
- Known function-output points to interpolate between (must be same length as x)public Configuration getConfiguration()
public int getNumPoints()
public void setNumPoints(int num)
num
- New number of points between which this function interpolatespublic float[] getX()
public void setX(float[] x)
x
- Known function-argument points to interpolate betweenpublic float[] getY()
public void setY(float[] y)
y
- Known function-output points to interpolate betweenpublic float map(float[] from)
map
in interface Function
map
in class AbstractFunction
from
- Must have same length as getDimension()AbstractFunction.map(float[])
public static float interpolate(float[] xs, float[] ys, float x)
xs
- List of x valuesys
- List of y values that x values map ontox
- An x value at which to interpolate this mappingpublic Function clone() throws java.lang.CloneNotSupportedException
clone
in interface Function
clone
in class AbstractFunction
java.lang.CloneNotSupportedException
- is super does not support clone