|
AlgART Home | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.algart.math.functions.ApertureFilterOperator
public final class ApertureFilterOperator extends java.lang.Object implements Operator
Aperture filtering operator in n-dimensional Euclidean space:
The number of space dimensions n is equal to the length of the apertureDim array,
passed to all generation methods. However, the new function, returned by this operator
(by its apply(Func) method, can be called with any number of arguments N.
If the number of arguments N<n, than only first N coordinates
of the aperture points ai will be used:
in other words, the aperture will be projected to the N-dimensional subspace.
If the number of arguments N>n, than only first n coordinates
of the source point x will be increased by the corresponding coordinates of aperture points:
in other words, all extra coordinates of aperture points will be supposed to be zero.
In any case, the original function f will be called with the same number of arguments N,
as were passed to the new function g.
So, if the function f has some restriction for the possible number of arguments,
the new function g will have the same restrictions.
This class is immutable and thread-safe: there are no ways to modify settings of the created instance.
AlgART Laboratory 2007-2013
ApertureFilteredFunc| Modifier and Type | Field and Description |
|---|
| Fields inherited from interface net.algart.math.functions.Operator |
|---|
IDENTITY |
| Modifier and Type | Method and Description |
|---|---|
long[] |
apertureDim()
Returns the dimensions of the aperture of this filter. |
double |
apertureDim(int coordIndex)
Equivalent to apertureDim()[coordIndex]. |
double[] |
apertureFrom()
Returns the start coordinates of the points in the aperture of this filter. |
double |
apertureFrom(int coordIndex)
Equivalent to apertureFrom()[coordIndex]. |
Func |
apertureFunc()
Returns the aperture function, used by this filter. |
double |
apertureStep(int coordIndex)
Equivalent to apertureSteps()[coordIndex]. |
double[] |
apertureSteps()
Returns the steps of changing coordinates of the points in the aperture of this filter. |
double |
apertureTo(int coordIndex)
Equivalent to apertureFrom()[coordIndex] + (apertureDim()[coordIndex] - 1)
* apertureSteps()[coordIndex]. |
Func |
apply(Func f)
Returns the result of applying this operator to the given function. |
static ApertureFilterOperator |
getAveragingInstance(long... apertureDim)
Equivalent to getInstance(averagingFunc, apertureDim),
where averagingFunc is the averaging linear function
LinearFunc.getAveragingInstance(m),
m = apertureDim[0]*apertureDim[1]*.... |
static ApertureFilterOperator |
getAveragingInstance(long[] apertureDim,
double[] apertureFrom,
double[] apertureSteps)
Equivalent to getInstance(averagingFunc, apertureDim, apertureFrom, apertureSteps),
where averagingFunc is the averaging linear function
LinearFunc.getAveragingInstance(m),
m = apertureDim[0]*apertureDim[1]*.... |
static ApertureFilterOperator |
getInstance(Func apertureFunc,
long... apertureDim)
Equivalent to getInstance(apertureFunc, apertureDim, apertureFrom, apertureSteps),
where averagingFrom and apertureSteps are chosen automatically
to get an aperture 1.0x1.0x... starting from the origin of coordinates
(0<=aij<1). |
static ApertureFilterOperator |
getInstance(Func apertureFunc,
long[] apertureDim,
double[] apertureFrom,
double[] apertureSteps)
Returns an instance of this class, describing the aperture filter with the specified aperture and aperture function apertureFunc. |
boolean |
isAveraging()
Returns true if and only if this filter performs averaging, i.e. if the aperture function is a linear function,
where the b coefficient is zero and all ai coefficients
are equal to 1/m, m=apertureDim[0]*apertureDim[1]*.... |
double |
maxApertureSize()
Returns the maximal aperture size for all dimensions: the maximal value of apertureTo(k)-apertureFrom(k)
for all k=0,1,...,n()-1 |
int |
n()
Returns the number of dimensions of the aperture of this filter. |
static boolean |
tooLargeAperture(long... apertureDim)
Returns true if the specified sizes of the aperture are too large for processing by this class. |
java.lang.String |
toString()
Returns a brief string description of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static ApertureFilterOperator getInstance(Func apertureFunc,
long[] apertureDim,
double[] apertureFrom,
double[] apertureSteps)
The aperture {ai}, i=0,1,...,m-1 is defined by
apertureDim, apertureFrom, apertureSteps arguments. Namely,
the number of dimensions of the space for the new operator will be equal to apertureDim.length,
and the aperture will consist of the following points
In other words, the aperture is a rectangular n-dimensional grid of point,
the coordinates of which are started from apertureFrom
and increased by the steps apertureSteps.
The number of points in the aperture is
This number must not be greater than Integer.MAX_VALUE.
The passed Java arrays are cloned by this method: no references to them
are maintained by the created instance.
ai0 = apertureFrom[0] + j0 * apertureSteps[0],
j0 = 0,1,...,apertureDim[0],
ai1 = apertureFrom[1] + j1 * apertureSteps[1],
j1 = 0,1,...,apertureDim[1],
. . .
ai,n-1 = apertureFrom[n-1] +
jn-1 * apertureSteps[n-1],
jn-1 = 0,1,...,apertureDim[n-1]
m = apertureDim[0] * apertureDim[1] * ... * apertureDim[n-1]
apertureFunc - the aperture function.apertureDim - the dimensions of the aperture.apertureFrom - the start coordinates of the points in the aperture.apertureSteps - the steps of changing coordinates of the points in the aperture.java.lang.NullPointerException - if one of the arguments of the method is null.java.lang.IllegalArgumentException - if the lengths of apertureDim, apertureFrom and
apertureSteps arrays are not equal,
or if they are zero ("0-dimensional" space),
or if some elements of apertureDim array are zero or negative,
or if tooLargeAperture(apertureDim)
returns true,
or, probably, if it's possible to detect that the number of points
in the aperture (m) is insufficient
for passing to the apertureFunc function.getInstance(Func, long[]),
getAveragingInstance(long[], double[], double[]),
getAveragingInstance(long[]),
tooLargeAperture(long[])
public static ApertureFilterOperator getInstance(Func apertureFunc,
long... apertureDim)
getInstance(apertureFunc, apertureDim, apertureFrom, apertureSteps),
where averagingFrom and apertureSteps are chosen automatically
to get an aperture 1.0x1.0x... starting from the origin of coordinates
(0<=aij<1).
More precisely, the following averagingFrom and apertureSteps are chosen:
apertureFrom[k] = 0.0; apertureSteps[k] = 1.0 / apertureDim[n];
apertureFunc - the aperture function.apertureDim - the dimensions of the aperture.java.lang.NullPointerException - if one of the arguments of the method is null.java.lang.IllegalArgumentException - if the lengths of apertureDim is zero ("0-dimensional" space),
or if some elements of apertureDim array are zero or negative,
or if tooLargeAperture(apertureDim)
returns true,
or, probably, if it's possible to detect that the number of points
in the aperture (m) is insufficient
for passing to the apertureFunc function.
public static ApertureFilterOperator getAveragingInstance(long[] apertureDim,
double[] apertureFrom,
double[] apertureSteps)
getInstance(averagingFunc, apertureDim, apertureFrom, apertureSteps),
where averagingFunc is the averaging linear function
LinearFunc.getAveragingInstance(m),
m = apertureDim[0]*apertureDim[1]*....
apertureDim - the dimensions of the aperture.apertureFrom - the start coordinates of the points in the aperture.apertureSteps - the steps of changing coordinates of the points in the aperture.java.lang.NullPointerException - if one of the arguments of the method is null.java.lang.IllegalArgumentException - in the same situations as
getInstance(Func, long[], double[], double[]).public static ApertureFilterOperator getAveragingInstance(long... apertureDim)
getInstance(averagingFunc, apertureDim),
where averagingFunc is the averaging linear function
LinearFunc.getAveragingInstance(m),
m = apertureDim[0]*apertureDim[1]*....
apertureDim - the dimensions of the aperture.java.lang.NullPointerException - if one of the arguments of the method is null.java.lang.IllegalArgumentException - in the same situations as
getInstance(Func, long[]).public static boolean tooLargeAperture(long... apertureDim)
If you are not sure that your aperture is small enough, please call this method before instantiating this class.
apertureDim - the dimensions of the aperture.java.lang.IllegalArgumentException - if some elements of apertureDim array are zero or negative.public Func apply(Func f)
Operator
apply in interface Operatorf - some function.public int n()
public long[] apertureDim()
The returned array is a clone of the internal dimension array stored in this object. The returned array is never empty (its length cannot be zero).
public double[] apertureFrom()
getInstance(Func, long[], double[], double[]) or
getAveragingInstance(long[], double[], double[]) generation methods.
The returned array is a clone of the internal dimension array stored in this object. The returned array is never empty (its length cannot be zero).
public double[] apertureSteps()
getInstance(Func, long[], double[], double[]) or
getAveragingInstance(long[], double[], double[]) generation methods.
The returned array is a clone of the internal dimension array stored in this object. The returned array is never empty (its length cannot be zero).
public double apertureDim(int coordIndex)
apertureDim()[coordIndex].
coordIndex - the index of dimension.public double apertureFrom(int coordIndex)
apertureFrom()[coordIndex].
coordIndex - the index of coordinate.public double apertureTo(int coordIndex)
apertureFrom()[coordIndex] + (apertureDim()[coordIndex] - 1)
* apertureSteps()[coordIndex].
coordIndex - the index of coordinate.public double apertureStep(int coordIndex)
apertureSteps()[coordIndex].
coordIndex - the index of coordinate.public double maxApertureSize()
apertureTo(k)-apertureFrom(k)
for all k=0,1,...,n()-1
public Func apertureFunc()
public boolean isAveraging()
aperture function is a linear function,
where the b coefficient is zero and all ai coefficients
are equal to 1/m, m=apertureDim[0]*apertureDim[1]*....
In particular, this method returns true if this filter was created by
getAveragingInstance(long[], double[], double[]) or
getAveragingInstance(long[]) method.
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||