public abstract class Interpolate1D_F32
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
ascend |
protected int |
index0 |
protected int |
M |
protected int |
size |
protected float[] |
x |
protected float[] |
y |
| Constructor and Description |
|---|
Interpolate1D_F32(int degree) |
Interpolate1D_F32(int degree,
float[] x,
float[] y,
int size) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
bisectionSearch(float val,
int lowerLimit,
int upperLimit)
Searches the x array by bisecting it.
|
void |
changeDegree(int degree)
Changes the number of points used in the interpolation.
|
protected abstract float |
compute(float testX)
This is where the specific implementation of the interpolation is done.
|
protected void |
hunt(float val)
To speed up finding the appropriate indexes to use in the interpolation it can use its
previous results to search a smaller region than it would otherwise.
|
float |
process(float testX)
Performs interpolation at the sample point.
|
float |
process(int index0,
float testX)
Performs an interpolation using sample data starting at index0.
|
void |
setInput(float[] x,
float[] y,
int size)
Sets the data that is being interpolated.
|
protected int size
protected float[] x
protected float[] y
protected int M
protected int index0
protected boolean ascend
public Interpolate1D_F32(int degree)
degree - The number of points used in the interpolation minus onepublic Interpolate1D_F32(int degree,
float[] x,
float[] y,
int size)
degree - The number of points used in the interpolation minus onex - Where the points are sample at. Not modifed. Reference saved.y - The value at the sample points. Not modifed. Reference saved.size - The number of points used.public void setInput(float[] x,
float[] y,
int size)
x - Where the points are sample at. Not modifed. Reference saved.y - The value at the sample points. Not modifed. Reference saved.size - The number of points used.public float process(float testX)
testX - Where the interpolated value is done at.public float process(int index0,
float testX)
index0 - first sample point used in the interpolation.testX - Where the interpolated value is done at.protected abstract float compute(float testX)
testX - Where the interpolated value is done at.public void changeDegree(int degree)
degree - Number of points used minus one.protected void hunt(float val)
val - The value that is to be interpolated.protected void bisectionSearch(float val,
int lowerLimit,
int upperLimit)
val - The value that is to be interpolated.lowerLimit - Lower limit for x index.upperLimit - The largest possible index of x