public class LinearInterpolator
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
LinearInterpolator.Extrapolation
The method used to extrapolate samples when interpolating.
|
| Constructor and Description |
|---|
LinearInterpolator() |
| Modifier and Type | Method and Description |
|---|---|
LinearInterpolator.Extrapolation |
getExtrapolation()
Gets the extrapolation method for this interpolator.
|
float |
interpolate(double x)
Interpolates the current uniform samples as real numbers.
|
float |
interpolate(double x1,
double x2)
Interpolates the current uniform samples as real numbers.
|
float |
interpolate(double x1,
double x2,
double x3)
Interpolates the current uniform samples as real numbers.
|
void |
interpolate(int nx,
double dx,
double fx,
float[] y)
Interpolates the current uniform samples as real numbers.
|
void |
interpolate(int nx,
float[] x,
float[] y)
Interpolates the current uniform samples as real numbers.
|
void |
setExtrapolation(LinearInterpolator.Extrapolation extrap)
Sets the extrapolation method for this interpolator.
|
void |
setUniform(int nxu,
double dxu,
double fxu,
float[] yu)
Sets the current sampling and samples for a function y(x).
|
void |
setUniform(int nx1u,
double dx1u,
double fx1u,
int nx2u,
double dx2u,
double fx2u,
float[][] yu)
Sets the current sampling and samples for a function y(x1,x2).
|
void |
setUniform(int nx1u,
double dx1u,
double fx1u,
int nx2u,
double dx2u,
double fx2u,
int nx3u,
double dx3u,
double fx3u,
float[][][] yu)
Sets the current sampling and samples for a function y(x1,x2,x3).
|
void |
setUniformSamples(float[] yu)
Sets the current samples for a uniformly-sampled function y(x).
|
void |
setUniformSamples(float[][] yu)
Sets the current samples for a uniformly-sampled function y(x1,x2).
|
void |
setUniformSamples(float[][][] yu)
Sets the current samples for a uniformly-sampled function y(x1,x2,x3).
|
void |
setUniformSampling(int nxu,
double dxu,
double fxu)
Sets the current sampling for a uniformly-sampled function y(x).
|
void |
setUniformSampling(int nx1u,
double dx1u,
double fx1u,
int nx2u,
double dx2u,
double fx2u)
Sets the current sampling for a uniformly-sampled function y(x1,x2).
|
void |
setUniformSampling(int nx1u,
double dx1u,
double fx1u,
int nx2u,
double dx2u,
double fx2u,
int nx3u,
double dx3u,
double fx3u)
Sets the current sampling for a uniformly-sampled function y(x1,x2,x3).
|
public LinearInterpolator.Extrapolation getExtrapolation()
public void setExtrapolation(LinearInterpolator.Extrapolation extrap)
extrap - the extrapolation method.public void setUniformSampling(int nxu,
double dxu,
double fxu)
nxu - the number of uniform samples.dxu - the uniform sampling interval.fxu - the value x corresponding to the first uniform sample yu[0].public void setUniformSamples(float[] yu)
Sample values are passed by reference, not by copy. Changes to sample values in the specified array will yield changes in interpolated values.
yu - array[nxu] of uniform samples of y(x);
by reference, not by copy.public void setUniform(int nxu,
double dxu,
double fxu,
float[] yu)
setUniformSampling(int,double,double) and
setUniformSamples(float[])
with the specified parameters.nxu - the number of uniform samples.dxu - the uniform sampling interval.fxu - the value x corresponding to the first uniform sample yu[0].yu - array[nxu] of uniform samples of y(x);
by reference, not by copy.public float interpolate(double x)
x - the value x at which to interpolate y(x).public void interpolate(int nx,
float[] x,
float[] y)
nx - the number of output samples.x - array[nx] of values x at which to interpolate y(x).y - array[nx] of interpolated output y(x).public void interpolate(int nx,
double dx,
double fx,
float[] y)
This method does not perform any anti-alias filtering, which may or may not be necessary to avoid aliasing when the specified output sampling interval exceeds the current uniform sampling interval.
nx - the number of output samples.dx - the output sampling interval.fx - the value x corresponding to the first output sample y[0].y - array[nx] of interpolated output y(x).public void setUniformSampling(int nx1u,
double dx1u,
double fx1u,
int nx2u,
double dx2u,
double fx2u)
nx1u - the number of uniform samples in 1st dimension.dx1u - the uniform sampling interval in 1st dimension.fx1u - the value x1 correponding to the first sample yu[0][0].nx2u - the number of uniform samples in 2nd dimension.dx2u - the uniform sampling interval in 2nd dimension.fx2u - the value x2 correponding to the first sample yu[0][0].public void setUniformSamples(float[][] yu)
Sample values are passed by reference, not by copy. Changes to sample values in the specified array will yield changes in interpolated values.
yu - array[nx2u][nx1u] of samples of y(x1,x2);
by reference, not by copy.public void setUniform(int nx1u,
double dx1u,
double fx1u,
int nx2u,
double dx2u,
double fx2u,
float[][] yu)
setUniformSampling(int,double,double,int,double,double) and
setUniformSamples(float[][])
with the specified parameters.nx1u - the number of uniform samples in 1st dimension.dx1u - the uniform sampling interval in 1st dimension.fx1u - the value x1 correponding to the first sample yu[0][0].nx2u - the number of uniform samples in 2nd dimension.dx2u - the uniform sampling interval in 2nd dimension.fx2u - the value x2 correponding to the first sample yu[0][0].yu - array[nx2u][nx1u] of samples of y(x1,x2);
by reference, not by copy.public float interpolate(double x1,
double x2)
x1 - the value x1 at which to interpolate y(x1,x2).x2 - the value x2 at which to interpolate y(x1,x2).public void setUniformSampling(int nx1u,
double dx1u,
double fx1u,
int nx2u,
double dx2u,
double fx2u,
int nx3u,
double dx3u,
double fx3u)
nx1u - the number of uniform samples in 1st dimension.dx1u - the uniform sampling interval in 1st dimension.fx1u - the value x1 correponding to the first sample yu[0][0][0].nx2u - the number of uniform samples in 2nd dimension.dx2u - the uniform sampling interval in 2nd dimension.fx2u - the value x2 correponding to the first sample yu[0][0][0].nx3u - the number of uniform samples in 3rd dimension.dx3u - the uniform sampling interval in 3rd dimension.fx3u - the value x3 correponding to the first sample yu[0][0][0].public void setUniformSamples(float[][][] yu)
Sample values are passed by reference, not by copy. Changes to sample values in the specified array will yield changes in interpolated values.
yu - array[nx3u][nx2u][nx1u] of samples of y(x1,x2,x3);
by reference, not by copy.public void setUniform(int nx1u,
double dx1u,
double fx1u,
int nx2u,
double dx2u,
double fx2u,
int nx3u,
double dx3u,
double fx3u,
float[][][] yu)
setUniformSampling(
int,double,double,int,double,double,int,double,double) and
setUniformSamples(float[][][])
with the specified parameters.nx1u - the number of uniform samples in 1st dimension.dx1u - the uniform sampling interval in 1st dimension.fx1u - the value x1 correponding to the first sample yu[0][0][0].nx2u - the number of uniform samples in 2nd dimension.dx2u - the uniform sampling interval in 2nd dimension.fx2u - the value x2 correponding to the first sample yu[0][0][0].nx3u - the number of uniform samples in 3rd dimension.dx3u - the uniform sampling interval in 3rd dimension.fx3u - the value x3 correponding to the first sample yu[0][0][0].yu - array[nx3u][nx2u][nx1u] of samples of y(x1,x2,x3);
by reference, not by copy.public float interpolate(double x1,
double x2,
double x3)
x1 - the value x1 at which to interpolate y(x1,x2,x3).x2 - the value x2 at which to interpolate y(x1,x2,x3).x3 - the value x3 at which to interpolate y(x1,x2,x3).