public class RecursiveRectangleFilter
extends java.lang.Object
m
y[i] = s * sum x[i+j]
j=l
for 0<=i<n, l<=m, and s = 1.0/(1.0+m-l).
This recursive implementation computes
y[i] = y[i-1]+s*(x[i+m]-x[i+l-1]),
with care taken to initialize y[0] and handle array index bounds.
For long filters (large 1+m-l), this recursive implementation may be
much more efficient than the more straightforward sum for each index i.Constructor and Description |
---|
RecursiveRectangleFilter(int l,
int m)
Constructs a rectangle filter with specified index bounds.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(float[] x,
float[] y)
Applies the filter.
|
void |
apply1(float[][][] x,
float[][][] y)
Applies the filter along the 1st dimension.
|
void |
apply1(float[][] x,
float[][] y)
Applies the filter along the 1st dimension.
|
void |
apply2(float[][][] x,
float[][][] y)
Applies the filter along the 2nd dimension.
|
void |
apply2(float[][] x,
float[][] y)
Applies the filter along the 2nd dimension.
|
void |
apply3(float[][][] x,
float[][][] y)
Applies the filter along the 3rd dimension.
|
public RecursiveRectangleFilter(int l, int m)
l
- the lower index bound in the sum; must not be greater than m.m
- the upper index bound in the sum; must not be less than l.public void apply(float[] x, float[] y)
x
- input array.y
- output array.public void apply1(float[][] x, float[][] y)
x
- input array.y
- output array.public void apply2(float[][] x, float[][] y)
x
- input array.y
- output array.public void apply1(float[][][] x, float[][][] y)
x
- input array.y
- output array.public void apply2(float[][][] x, float[][][] y)
x
- input array.y
- output array.public void apply3(float[][][] x, float[][][] y)
x
- input array.y
- output array.