public class PolyTrend2
extends java.lang.Object
Constructor and Description |
---|
PolyTrend2(int order,
float[] f,
float[] x1,
float[] x2)
Constructs a trend with specified scattered samples.
|
Modifier and Type | Method and Description |
---|---|
void |
detrend()
Removes this trend from its referenced scattered sample values.
|
void |
detrend(float[][] f,
Sampling s1,
Sampling s2)
Removes this trend from the specified samples.
|
void |
detrend(float[] f,
float[] x1,
float[] x2)
Removes this trend from the specified samples.
|
float |
detrend(float f,
float x1,
float x2)
Removes this trend from the specified sample.
|
void |
restore()
Restores this trend to its referenced scattered sample valuess.
|
void |
restore(float[][] f,
Sampling s1,
Sampling s2)
Restores this trend to the specified samples.
|
void |
restore(float[] f,
float[] x1,
float[] x2)
Restores this trend to the specified samples.
|
float |
restore(float f,
float x1,
float x2)
Restores this trend to the specified sample.
|
void |
setSamples(float[] f,
float[] x1,
float[] x2)
Sets the known (scattered) samples to be fit.
|
public PolyTrend2(int order, float[] f, float[] x1, float[] x2)
If insufficient samples are available for the specified order, then a fit is performed with a polynomial of lower order than that specified. Note that an order zero (constant) polynomial fit is always possible when at least one sample is specified.
order
- order of polynomial; must be 0, 1, or 2.f
- array of sample values f(x1,x2).x1
- array of sample x1 coordinates.x2
- array of sample x2 coordinates.public void setSamples(float[] f, float[] x1, float[] x2)
f
- array of sample values f(x1,x2).x1
- array of sample x1 coordinates.x2
- array of sample x2 coordinates.public void detrend()
java.lang.IllegalStateException
- if the trend has already been removed.public void restore()
java.lang.IllegalStateException
- if the trend has not yet been removed.public float detrend(float f, float x1, float x2)
f
- the sample value.x1
- the sample x1 coordinate.x2
- the sample x2 coordinate.public float restore(float f, float x1, float x2)
f
- the sample value.x1
- the sample x1 coordinate.x2
- the sample x2 coordinate.public void detrend(float[] f, float[] x1, float[] x2)
f
- array of sample values to be detrended.x1
- array of sample x1 coordinates.x2
- array of sample x2 coordinates.public void restore(float[] f, float[] x1, float[] x2)
f
- array of sample values to be restored.x1
- array of sample x1 coordinates.x2
- array of sample x2 coordinates.public void detrend(float[][] f, Sampling s1, Sampling s2)
f
- array of sample values to be detrended.s1
- sampling of x1 coordinates.s2
- sampling of x2 coordinates.