|Modifier and Type||Method and Description|
Returns true if the weights of all points are the same.
Returns the pattern consisting of points, generated from points of this instance by multiplying on the mult argument via
Returns the product decomposition: the list of patterns such that the convolution with this pattern is equivalent to sequential convolution with all patterns from the list.
Returns this pattern, scaled by the specified multipliers along all coordinates.
Returns the symmetric pattern: equivalent to
Returns the weight of the given point of the pattern.
Returns the minimal and maximal weights of all points of this pattern.
allUnionDecompositions, carcass, coordArea, coordMax, coordMin, coordRange, dimCount, hasMinkowskiDecomposition, isSurelyInteger, isSurelyOriginPoint, isSurelySinglePoint, largePointCount, maxBound, maxCarcassMultiplier, minBound, minkowskiAdd, minkowskiDecomposition, minkowskiSubtract, pointCount, points, projectionAlongAxis, round, roundedCoordArea, roundedCoordRange, roundedPoints, shift, unionDecomposition
double weight(IPoint point)
WeightedPattern shift(IPoint shift)
weights, generated from points of this instance by adding the argument via
WeightedPattern multiply(double multiplier)
If mult is not an integer, the generated real coordinates are rounded to integer values.
If several source points are rounded to the same integer point, the
of the resulting points may differ from the weights of the source ones,
but the sum of all weights will be approximately same.
If the all source points are transformed to different points,
their weights are preserved.
Please note: if mult is not an integer, the algorithm of rounding is not strictly specified! However, you can be sure that the new pattern will be near from the precise result.
WeightedPattern scale(double... multipliers)
More precisely, the resulting pattern consists of the points,
obtained from all points of this pattern by the call
There is a guarantee, that this method does not try to allocate much more memory,
that it is required for storing this pattern itself, and that it
For comparison, an attempt to do the same operation via getting all points (
correcting them and forming a new pattern via
will lead to
TooManyPointsInPatternError / OutOfMemoryError for some forms of large patterns.
Warning: this method can fail with
TooLargePatternCoordinatesException, if some of new points
violate restrictions, described in the
comments to this interface,
section "Coordinate restrictions" (for example, due to very large multipliers).
However, such failure is obviously impossible, if all multipliers are
in range -1.0<=multipliers[k]<=1.0.
java.util.List<WeightedPattern> productDecomposition(int minimalPointCount)
Let the pattern consists of n-dimensional points p1, p2, ...
weights w1, w2, ...,
and let the integer vector i defines the position of some element of the n-dimensional
numeric matrix A.
Here the convolution by this pattern means transforming
the matrix A to another matrix B by the following rules:
B[i] = ∑ wkA[i-pk]
This method allows to optimize calculation of this convolution with help of several passes: first you calculate the convolution with the 1st element of the returned list, then you calculate the convolution of the new matrix with the 2nd element of the returned list, etc. The last convolution will be equal (or almost equal, due to possible rounding errors) to the convolution of the source matrix with full this pattern.
The simplest example of such decomposition is a case of the
In this case, this method should return a list of
Pattern.dimCount() linear constant patterns
(one-dimensional segments), the minkowski sum of which is equal to this one.
The linear constant segments should not be further decomposed, because there is an optimal algorithm
for convolution of any matrix with a linear constant segment, requiring 2 operations per element only.
There is no guarantee that this method returns a good decomposition. If this method cannot find required decomposition, it returns the list containing this instance as the only element.
The number of space dimensions in all returned patterns (
Pattern.dimCount() is the same as in this one.
The result of this method is immutable (Collections.unmodifiableList).
minimalPointCount- this method does not try to decompose patterns that contain less than minimalPointCount points.
java.lang.IllegalArgumentException- if the argument is negative.