public interface Pattern
Pattern: nonempty set of real points
in multidimensional space
(points with real coordinates).
Usually patterns are relatively little point sets: from tens to millions of points not too far from
the origin of coordinates. However, please note that the number of points is not limited
by any value. In particular, it can be greater than Long.MAX_VALUE.
For example, it may occur for rectangular ndimensional patterns
.
Patterns are the arguments of many image processing filters. For example, a pattern may specify the form and sizes of the aperture for a linear filter.
The very important subclass among all patterns is integer patterns,
consisting of points with integer coordinates. More precisely, a pattern is called integer,
if for all pattern's points
round()
,
rounding any pattern to the nearest integer pattern — the result of this method is always integer.
Usually integer patterns are uniformgrid patterns (see the next section), but this condition is not absolute:
even a pattern, not implementing UniformGridPattern
interface, is called integer pattern,
if all its points are really integer. The most popular case of integer patters is socalled
ordinary integer patterns — see below in the next section
"Uniformgrid patterns".
You can try to investigate, whether some pattern is integer or not, by isSurelyInteger()
method.
Integer patterns is the basic pattern type for image processing tasks.
In this package, the following methods always create integer patterns:
round()
,Patterns.newIntegerPattern(net.algart.math.IPoint...)
,Patterns.newIntegerPattern(java.util.Collection)
,Patterns.newSphereIntegerPattern(net.algart.math.Point, double)
,Patterns.newEllipsoidIntegerPattern(net.algart.math.Point, double...)
,Patterns.newRectangularIntegerPattern(net.algart.math.IRange...)
,Patterns.newRectangularIntegerPattern(net.algart.math.IPoint, net.algart.math.IPoint)
.The important subclass among all patterns is uniformgrid patterns, represented
by the subinterface UniformGridPattern
. Uniformgrid patterns is a pattern, all points
of which are mesh nodes of some uniform grids, i.e. have coordinates
x_{0} = o_{0} + i_{0}d_{0}
x_{1} = o_{1} + i_{1}d_{1}
. . .
x_{n−1} = o_{n−1} + i_{n−1}d_{n−1}
where o_{j} and d_{j} are some constants
(d_{j}>0) and i_{j} are any integer numbers.
The parameters o_{j} (named origin) and
d_{j} (named steps) are specified while creating the pattern,
and they are stored inside the object and can be quickly read by the access methods
UniformGridPattern.originOfGrid()
and UniformGridPattern.stepsOfGrid()
.
Draw attention to the last condition! You can easily create also a pattern,
all points of which lie in mesh nodes of some uniform grid, but which will not "know" anything
about this grid and will not implement UniformGridPattern
interface.
The simplest way to do this is the call of the constructor
newSimplePattern
(pattern.points()
),
where pattern is a uniformgrid pattern. The resulting pattern is geometrically identical
to the original uniformgrid one, but it does not implement
UniformGridPattern
and is not considered to be uniformgrid, because there are no ways
to get information about the grid (origin and steps).
It is obvious that a uniformgrid pattern is also an integer pattern (see above), if all numbers o_{j} and d_{j} are integer. The most important particular case: all o_{j}=0 and all d_{j}=1. We shall call this kind of patterns ordinary integer patterns.
In this package, uniformgrid patterns are the patterns, created by one of the following ways, and only they:
Patterns.newUniformGridPattern(net.algart.math.Point, double[], java.util.Collection)
,Patterns.newIntegerPattern(net.algart.math.IPoint...)
(creates an ordinary integer pattern),Patterns.newIntegerPattern(java.util.Collection)
(creates an ordinary integer pattern),Patterns.newSphereIntegerPattern(net.algart.math.Point, double)
(creates an ordinary integer pattern),Patterns.newEllipsoidIntegerPattern(net.algart.math.Point, double...)
(creates an ordinary integer pattern),Patterns.newSpaceSegment(UniformGridPattern, Func, Func, double, double)
,Patterns.newRectangularUniformGridPattern(net.algart.math.Point, double[], net.algart.math.IRange...)
,
Patterns.newRectangularIntegerPattern(net.algart.math.IRange...)
(creates an ordinary integer pattern),Patterns.newRectangularIntegerPattern(net.algart.math.IPoint, net.algart.math.IPoint)
(creates an ordinary integer pattern),and also, in some cases (depending on the arguments), by the following methods:
One of the most popular, basic kinds of patterns is direct pointset patterns,
represented by the subinterface DirectPointSetPattern
.
The pattern is called direct pointset or, briefly, direct,
if it is internally represented as an actual set of points
like Set<Point
>.
Of course, any pattern is a set of points. The main feature of this subclass is that
the pointset is stored directly in a form of some collection — and, so, can be directly accessed
at any time via points()
or roundedPoints()
methods.
As a result, direct pointset pattern cannot contain more than Integer.MAX_VALUE points
(because Java Set object cannot contain more than Integer.MAX_VALUE elements).
Unlike direct patterns, other forms of pattern, like rectangular or complex (see below),
do not actually store the set of their points, though still can build and return it by a request,
when you call points()
or roundedPoints()
.
In this package, direct pointset patterns are the patterns, created by one of the following ways, and only they:
SimplePattern
constructor,Patterns.newPattern(net.algart.math.Point...)
,Patterns.newPattern(java.util.Collection)
,Patterns.newUniformGridPattern(net.algart.math.Point, double[], java.util.Collection)
,Patterns.newIntegerPattern(net.algart.math.IPoint...)
,Patterns.newIntegerPattern(java.util.Collection)
,Patterns.newSphereIntegerPattern(net.algart.math.Point, double)
,Patterns.newEllipsoidIntegerPattern(net.algart.math.Point, double...)
,Patterns.newSurface(Pattern, net.algart.math.functions.Func)
,Patterns.newSpaceSegment(UniformGridPattern, Func, Func, double, double)
.Direct pointset pattern may be, at the same time, uniformgrid. In this case it must implement
DirectPointSetUniformGridPattern
interface.
This package provides an implementation of direct pattern, which is not uniformgrid: SimplePattern
.
Most of other direct pointset patterns, provided by this package, are uniformgrid and
implement DirectPointSetUniformGridPattern
interface.
The second popular basic kind of patterns is rectangular patterns,
represented by the subinterface RectangularPattern
.
The pattern is called rectangular, if it is uniformgrid (implements UniformGridPattern
interface),
and it consists of all points inside some hyperparallelepiped, the parameters (bounds) of which were
specified while creating the pattern, are stored inside the object and can be quickly read
by methods like coordRange(int)
.
Draw attention to the last condition! Of course, you can create also a direct pointset pattern, consisting of all points inside some hyperparallelepiped. The simplest way to do this is the call of the constructor
newSimplePattern
(pattern.points()
),
where pattern is a rectangular pattern. However, the resulting pattern is considered to be direct, but not rectangular.
The main difference between direct pointset and rectangular patterns is the behaviour of methods,
retrieving the point set like points()
, and some methods, retrieving boundaries of the pattern,
like UniformGridPattern.upperSurface(int)
, UniformGridPattern.maxBound(int)
, etc.
In direct patterns, all methods always work stably, i.e. without exceptions (if the passed arguments
are correct), but calculation of pattern boundaries can require some time, proportional to the number
of points in the pattern.
In rectangular patterns, an attempt to get all points by points()
or roundedPoints()
method can lead to TooManyPointsInPatternError
or to OutOfMemoryError,
because the number of points can be extremely large (for example, 10000x10000x10000 3dimensional parallelepiped
consists of 10^{12} points); but the information about boundaries is available very quickly.
See the details in comments to DirectPointSetPattern
and RectangularPattern
interfaces.
The classes of direct pointset and rectangular patterns do not intersect: a direct pointset pattern cannot be rectangular, and a rectangular pattern cannot be direct.
Direct pointset and rectangular pattern are the base, used in many algorithms and allowing to build more specific pattern types (see below).
In this package, rectangular patterns are the patterns, created by one of the following ways, and only they:
Patterns.newRectangularUniformGridPattern(net.algart.math.Point, double[], net.algart.math.IRange...)
,
Patterns.newRectangularIntegerPattern(net.algart.math.IRange...)
,Patterns.newRectangularIntegerPattern(net.algart.math.IPoint, net.algart.math.IPoint)
.Besides the basic types of patterns — direct pointset and rectangular — this package
allows to create more complex forms of patterns. Such patterns do not actually store information
about the point set, but contain some rules allowing to construct this point set.
The typical examples are Minkowski sum of several patterns, created by
Patterns.newMinkowskiSum(java.util.Collection)
method,
and the union of several patterns, created by
Patterns.newUnion(java.util.Collection)
method.
An attempt to get actual information about the figure of such a pattern via its methods
points()
, roundedPoints()
, and even usage of the simplest methods
pointCount()
, largePointCount()
, isSurelyOriginPoint()
can lead to very long calculations and even to TooManyPointsInPatternError
/ OutOfMemoryError.
However, such patterns can be used indirectly, usually via their decompositions into more simple patterns
by minkowskiDecomposition(int)
and unionDecomposition(int)
methods.
For example, it is possible to perform morphological dilation filter over an image
(see Patterns.newMinkowskiSum(java.util.Collection)
and consisting of millions or milliards points, via sequential dilations with the Minkowski summands
of such a pattern, extracted by minkowskiDecomposition(int)
call.
There are the following guarantees for coordinates of the points of any pattern:
MAX_COORDINATE
≤x_{j}≤MAX_COORDINATE
for all j; here this inequality means absolutely precise mathematical inequality;MAX_COORDINATE
for all j, where
x_{j}^{1}−x_{j}^{2} means
the absolute value of mathematically precise difference (not the result of Java operators
Math.abs(x_{j}^{1}−x_{j}^{2})).
(This condition can be checked with help of
Patterns.isAllowedDifference(double, double)
method.)Each implementation of this interface must fulfil both restriction. The point sets,
satisfying these requirements, are called allowed points sets for patterns.
Any attempt to create a pattern, the set of points of which is not allowed,
leads to TooLargePatternCoordinatesException
.
Note: though patterns are sets of real points, their coordinates are restricted by longtype constant
MAX_COORDINATE
.
Also note: uniformgrid patterns must fulfil, in addition, two similar restrictions for their grid indexes.
See more details in the comments to UniformGridPattern
interface,
the section "Grid index restrictions".
Below are two important theorems, following from these two restrictions.
Theorem I. If you round the coordinates of all points of a pattern, i.e. replace each pattern's point
The proof of this is complex enough. The paper
It means that you can freely use round()
method for any pattern:
it always constructs another allowed pattern,
both in terms of this interface and in terms in UniformGridPattern
,
and cannot throw TooLargePatternCoordinatesException
.
Theorem II. If all points of a pattern are integer, i.e.
for all pattern's points
Proof.
First of all, let's remind that the computer difference a⊖b, according
IEEE 754 standard and Java language specification, is the nearest double value to
the precise mathematical difference a−b.
Because all pattern's points are integer, the restriction 2 allows to state that
any difference x_{j}−X_{j}
can be represented precisely by double type (see the comments to MAX_COORDINATE
constant).
So, we have
Now the proof is simple.
If is enough to show that the restrictions will be satisfied for the coordinate index j.
The restriction 2 is obvious: (mathematical) subtracting X_{j} does not change
the (mathematical!) differences
x_{j}^{1}−x_{j}^{2}.
The new value of this coordinate for each point will be
x_{j}−X_{j}, where both
(x_{0},x_{1},...,x_{n−1}) and
(X_{0},X_{1},...,X_{n−1}) are some points of the pattern;
according the condition 2, this difference lies in range
−MAX_COORDINATE
≤x_{j}−X_{j}≤MAX_COORDINATE
. In other words, the restriction 1 is also satisfied.
This completes the proof.
Note: this proof is really correct only for patterns, consisting of integer points only.
The reason is that all integer coordinates, fulfilling the restriction 1, and all their differences
x_{j}−X_{j} are represented precisely by double
Java type. If a pattern contains noninteger points, the statement of this theorem is not true.
For example, for 1dimensional pattern, consisting of three points
x_{1}=2251799813685248.00 (=MAX_COORDINATE
/2),
x_{2}=−2251799813685248.00 (=−MAX_COORDINATE
/2) and
x_{3}=−2251799813685247.75 (=−MAX_COORDINATE
/2+0.25), subtracting
the point x_{3} by Java “−” operator leads to the pattern
x'_{1}=4503599627370496.00 (=MAX_COORDINATE
) (computer subtraction of double
values leads to rounding here),
x'_{2}=−0.25 and
x'_{3}=0.0, which obviously violates the mathematically precise restriction 2:
x'_{1}−x'_{2}>MAX_COORDINATE
.
As a result, there is an obvious conclusion. If p is one of the points
of
some integer pattern (see above), then the method
pattern.shift
(p.symmetric()
) always works successfully and never throw TooLargePatternCoordinatesException
.
Minkowski sum
of several segments,
because the thorough comparison of these patterns can require too long time and large memory.
(Please consider 10000x10000x10000 3dimensional parallelepiped, consisting of 10^{12} points
with integer coordinates in range 0..9999. It is geometrically equal to Minkowski sum of 3 orthogonal
segments with 10000 integer points in every segment, but we have no resources to check this fact
via direct comparison of the point sets.)
However, the patterns of the same kind (for example, two rectangular patterns,
two Minkowski sums
or
two unions
) are usually compared precisely.
In particular, there are the following guarantees:
The classes, implementing this interface, are immutable and threadsafe: there are no ways to modify settings of the created instance.
Modifier and Type  Field and Description 

static long 
MAX_COORDINATE
The maximal possible absolute coordinate value and maximal absolute difference between the corresponding
coordinates for all points in a pattern.

Modifier and Type  Method and Description 

java.util.List<java.util.List<Pattern>> 
allUnionDecompositions(int minimalPointCount)
Returns a nonempty list of all best or almost best
union decompositions
with equal or similar "quality",
i.e. with the same or almost same summary number of points in all Minkowski decompositions
of all returned patterns. 
Pattern 
carcass()
Returns the carcass of this pattern.

RectangularArea 
coordArea()
Returns the minimal and maximal coordinates
among all points of this pattern for all dimensions.

Point 
coordMax()
Returns the point, each coordinate of which
is equal to the maximal corresponding coordinate
among all points of this pattern.

Point 
coordMin()
Returns the point, each coordinate of which
is equal to the minimal corresponding coordinate
among all points of this pattern.

Range 
coordRange(int coordIndex)
Returns the minimal and maximal coordinate with the given index
(
Point.coord(coordIndex) )
among all points of this pattern. 
int 
dimCount()
Returns the number of space dimensions of this pattern.

boolean 
hasMinkowskiDecomposition()
Returns true if and only if the Minkowski decomposition,
returned by
minkowskiDecomposition(0) call,
consists of 2 or more patterns:
minkowskiDecomposition(0) .size()>1. 
boolean 
isSurelyInteger()
Returns true if this pattern is integer:
all coordinates of all points of this pattern are integer numbers.

boolean 
isSurelyOriginPoint()
Returns true if this pattern consists of the single point and
this point is the origin of coordinates.

boolean 
isSurelySinglePoint()
Returns true if this pattern consists of the single point, i.e.
if
pointCount() ==1. 
double 
largePointCount()
Returns the number of points in this pattern as double value.

Pattern 
maxBound(int coordIndex)
Returns the maximal boundary of this pattern along the given axis:
a pattern consisting of all points of this pattern, for which there are
no other points with greater coordinate #coordIndex
and same other coordinates.

int 
maxCarcassMultiplier()
Returns the maximal multiplier k, for which the calculation of
the Minkowski multiple k⊗P can be optimized by using the carcass of this pattern P.

Pattern 
minBound(int coordIndex)
Returns the minimal boundary of this pattern along the given axis:
a pattern consisting of all points of this pattern, for which there are
no other points with less coordinate #coordIndex
and same other coordinates.

Pattern 
minkowskiAdd(Pattern added)
Calculates and returns the Minkowski sum of this and specified patterns.

java.util.List<Pattern> 
minkowskiDecomposition(int minimalPointCount)
Returns the Minkowski decomposition:
a nonempty list of patterns P_{0}, P_{1}, ..., P_{n−1},
such that this pattern P (the point set represented by it)
is a Minkowski sum of them (of the point sets represented by them):

Pattern 
minkowskiSubtract(Pattern subtracted)
Calculates and returns the erosion of this pattern by specified pattern
or null if this erosion is the empty set.

Pattern 
multiply(double multiplier)
Returns this pattern, scaled by the specified multiplier along all coordinates.

long 
pointCount()
Returns the number of points in this pattern.

java.util.Set<Point> 
points()
Returns a set of all points of this pattern.

Pattern 
projectionAlongAxis(int coordIndex)
Returns the projection of this pattern along the given axis.

UniformGridPattern 
round()
Returns this pattern, every point of which is rounded to the nearest integer point.

IRectangularArea 
roundedCoordArea()
Returns the same result as
coordArea() method,
but all minimal and maximal coordinates are rounded to integer values
by StrictMath.round operation. 
IRange 
roundedCoordRange(int coordIndex)
Returns the same result as
coordRange(int coordIndex) method,
but both minimal and maximal coordinates are rounded to integer values
by StrictMath.round operation. 
java.util.Set<IPoint> 
roundedPoints()
Returns the set of all
integer points , obtained from the points of this pattern
(results of points() method by rounding with help of
Point.toRoundedPoint() method. 
Pattern 
scale(double... multipliers)
Returns this pattern, scaled by the specified multipliers along all coordinates.

Pattern 
shift(Point shift)
Returns this pattern, shifted by the argument.

Pattern 
symmetric()
Returns the symmetric pattern: equivalent to
multiply(1.0) . 
java.util.List<Pattern> 
unionDecomposition(int minimalPointCount)
Returns a union decomposition:
a nonempty list of patterns P_{0}, P_{1}, ..., P_{n−1},
such that this pattern P (the point set represented by it)
is the settheoretical union of them (of the point sets represented by them):

static final long MAX_COORDINATE
comments to this interface
, section
"Coordinate restrictions", for more details.
The value of this constant is 1L << 52 = 2^{52} = 4503599627370496L ~ Long.MAX_VALUE/2048.
There is an important feature of this constant.
Any integer values x (long Java type) from the range
−2*MAX_COORDINATE
≤x≤2*MAX_COORDINATE
, and also
all halfinteger values x inside the range
−MAX_COORDINATE
≤x≤MAX_COORDINATE
(i.e. values x=k+0.5, where k is long
integer in range −MAX_COORDINATE
≤k≤MAX_COORDINATE
1)
are represented by double Java type precisely, without loss of precision.
As a result, we can be sure that for any integer k (long Java type), for which
Math.abs(k)<=2*MAX_COORDINATE
, the following equality is true:
(long)(double)k==k.
See also the paper MAX_COORDINATE
≤x≤MAX_COORDINATE
.
int dimCount()
There is a guarantee, that this method always works very quickly (O(1) operations) and without exceptions.
long pointCount()
Warning! This method can work slowly for some forms of large patterns:
the required time can be O(N), where N is the number of points (result of this method).
In these cases, this method can also throw TooManyPointsInPatternError
or OutOfMemoryError.
There is a guarantee, that if this object implements QuickPointCountPattern
interface,
then this method works very quickly (O(1) operations) and without exceptions.
There is a guarantee, that if this object implements DirectPointSetPattern
interface,
then the result of this method is not greater than Integer.MAX_VALUE.
Note: if this method returns some value greater than Integer.MAX_VALUE,
it means that you cannot use points()
and roundedPoints()
methods,
because Java Set object cannot contain more than Integer.MAX_VALUE elements.
points
in this pattern.TooManyPointsInPatternError
 for some forms of large patterns, if the number of points is greater than
Integer.MAX_VALUE or, in some rare situations, is near this limit
(OutOfMemoryError can be also thrown instead of this exception).largePointCount()
,
isSurelySinglePoint()
,
QuickPointCountPattern.isPointCountVeryLarge()
double largePointCount()
pointCount()
method is not greater than Long.MAX_VALUE,
there is a guarantee that this method returns the same result, cast to double type.
Warning! This method can work slowly for some forms of large patterns:
the required time can be O(N), where N is the number of points (result of this method).
In these cases, this method can also throw TooManyPointsInPatternError
or OutOfMemoryError.
There is a guarantee, that if this object implements QuickPointCountPattern
interface,
then this method works very quickly (O(1) operations) and without exceptions.
points
in this pattern as double value.TooManyPointsInPatternError
 for some forms of large patterns, if the number of points is greater than
Integer.MAX_VALUE or, in some rare situations, is near this limit
(OutOfMemoryError can be also thrown instead of this exception).QuickPointCountPattern.isPointCountVeryLarge()
java.util.Set<Point> points()
The result of this method is immutable (Collections.unmodifiableSet). Moreover, the result is always the same for different calls of this method for the same instance — there are no ways to change it, in particular, via any custom methods of the implementation class (it is a conclusion from the common requirement, that all implementations of this interface must be immutable).
The returned set is always nonempty,
and the number of its elements is always equal to pointCount()
.
Warning! This method can work slowly for some forms of large patterns.
In these cases, this method can also throw TooManyPointsInPatternError
or OutOfMemoryError.
This method surely fails (throws one of these exception), if the total number of points
pointCount()
>Integer.MAX_VALUE, because Java Set object
cannot contain more than Integer.MAX_VALUE elements.
For example, implementations of the rectangular patterns
allow to successfully define a very large 3D parallelepiped
TooManyPointsInPatternError
)
for n=2000 (2000^{3}>Integer.MAX_VALUE).
There is a guarantee, that if this object implements DirectPointSetPattern
interface,
then this method requires not greater than O(N) operations and memory
(N=pointCount()
)
and never throws TooManyPointsInPatternError
.
Note: this method works very quickly (O(1) operations) in SimplePattern
class.
TooManyPointsInPatternError
 if the number of points is greater than Integer.MAX_VALUE or,
in some rare situations, is near this limit
(OutOfMemoryError can be also thrown instead of this exception).java.util.Set<IPoint> roundedPoints()
Returns the set of all integer points
, obtained from the points of this pattern
(results of points()
method by rounding with help of
Point.toRoundedPoint()
method.
In other words, the results of this method is the same as the result of the following code:
Set<IPoint> result = new HashSet<IPoint>(); // or another Set implementation for (Point p :points()
) { result.add(p.toRoundedPoint()
); } result = Collections.unmodifiableSet(result);
The result of this method is immutable (Collections.unmodifiableSet). Moreover, the result is always the same for different calls of this method for the same instance — there are no ways to change it, in particular, via any custom methods of the implementation class (it is a conclusion from the common requirement, that all implementations of this interface must be immutable).
The returned set is always nonempty.
Note: the number of resulting points can be less than pointCount()
, because some
real points can be rounded to the same integer points.
According the basic restriction to pattern coordinates (see
the comments to this interface
, section "Coordinate restrictions"),
you may be sure that you will able
to create an integer uniformgrid
pattern by passing the result of this method
to Patterns.newIntegerPattern(java.util.Collection)
.
Warning! This method can work slowly or throw TooManyPointsInPatternError
/ OutOfMemoryError in the same situations as points()
method.
There is a guarantee, that if this object implements DirectPointSetPattern
interface,
then this method requires not greater than O(N) operations and memory
(N=pointCount()
)
and never throws TooManyPointsInPatternError
.
Please compare with round()
method, which always works quickly and without exceptions also
for the case of RectangularPattern
.
TooManyPointsInPatternError
 if the number of points is greater than Integer.MAX_VALUE or,
in some rare situations, is near this limit
(OutOfMemoryError can be also thrown instead of this exception).Range coordRange(int coordIndex)
Point.coord(coordIndex)
)
among all points of this pattern.
The minimal coordinate will be r.min()
,
the maximal coordinate will be r.max()
,
where r is the result of this method.
There is a guarantee, that if this object implements RectangularPattern
interface,
then this method works very quickly (O(1) operations) and without exceptions.
Moreover, all patterns, implemented in this package, have very quick implementations of this method (O(1) operations). Also, the implementations of this method in this package never throw exceptions.
It is theoretically possible, that in custom implementations of this interface
(outside this package) this method will work slowly, up to O(N) operations,
N is the number of points in this pattern.
However, even in such implementations this method must not lead to
TooManyPointsInPatternError
/ OutOfMemoryError, like points()
method.
coordIndex
 the index of the coordinate (0 for x, 1 for y, 2 for z, etc.).java.lang.IndexOutOfBoundsException
 if coordIndex<0 or coordIndex>=dimCount()
.roundedCoordRange(int)
,
coordMin()
,
coordMax()
,
coordArea()
RectangularArea coordArea()
coordCount()
==dimCount()
and a.range
(k)
is equal to coordRange
(k) for all k.
For example, in 2dimensional case the result is the circumscribed rectangle (with sides, parallel to the axes).
All, said in the comments to coordRange(int)
method
about the speed and impossibility of TooManyPointsInPatternError
/ OutOfMemoryError,
is also true for this method.
roundedCoordArea()
Point coordMin()
coordArea()
.min()
.
All, said in the comments to coordRange(int)
method
about the speed and impossibility of TooManyPointsInPatternError
/ OutOfMemoryError,
is also true for this method.
Point coordMax()
coordArea()
.max()
.
All, said in the comments to coordRange(int)
method
about the speed and impossibility of TooManyPointsInPatternError
/ OutOfMemoryError,
is also true for this method.
IRange roundedCoordRange(int coordIndex)
coordRange(int coordIndex)
method,
but both minimal and maximal coordinates are rounded to integer values
by StrictMath.round operation.
Equivalent to coordRange
(coordIndex).toRoundedRange()
.
According the basic restriction to pattern coordinates (see
the comments to this interface
, section "Coordinate restrictions"),
you may be sure that you will be able
to create an integer rectangular pattern
by passing the ranges, got by this method,
to Patterns.newRectangularIntegerPattern(IRange...)
.
All, said in the comments to coordRange(int)
method
about the speed and impossibility of TooManyPointsInPatternError
/ OutOfMemoryError,
is also true for this method.
coordIndex
 the index of the coordinate (0 for x, 1 for y, 2 for z, etc.).java.lang.IndexOutOfBoundsException
 if coordIndex<0 or coordIndex>=dimCount()
.roundedCoordArea()
IRectangularArea roundedCoordArea()
coordArea()
method,
but all minimal and maximal coordinates are rounded to integer values
by StrictMath.round operation.
The method IRectangularArea.range(int coordIndex)
in the returned area
returns the same result as roundedCoordRange(int coordIndex)
method in this object.
All, said in the comments to coordRange(int)
method
about the speed and impossibility of TooManyPointsInPatternError
/ OutOfMemoryError,
is also true for this method.
boolean isSurelySinglePoint()
pointCount()
==1.
There are no strict guarantees that this method always returns true if the pattern
consist of the single point. (In some complex situations, such analysis can
be too difficult. In particular, if the pattern is a Minkowski sum
, then limited floatingpoint precision can lead to equality of all points of the result.
Simple example: a Minkowski sum of twopoint onedimensional pattern, consisting of points
0.0 and 0.000001, and onepoint 2^{51}=2251799813685248.0, contains only 1 point 2^{51},
because the computer cannot represent precise value 2251799813685248.000001 in double type
and rounds it to 2251799813685248.0.
In such situations, this method sometimes may incorrectly return false.)
But there is the reverse guarantee: if this method returns true, the number of points in this pattern is always 1.
Unlike pointCount()
method, there is a guarantee that this method
never works very slowly and cannot lead to TooManyPointsInPatternError
/ OutOfMemoryError.
In situations, when the number of points is very large
(and, so, pointCount()
method is not safe in use),
this method must detect this fact in reasonable time and return false.
There is a guarantee, that if this object implements QuickPointCountPattern
interface,
then this method works very quickly (O(1) operations) and absolutely correctly
(always returns true if and only if pointCount()
==1).
isSurelyOriginPoint()
boolean isSurelyOriginPoint()
There are no strict guarantees that this method always returns true if the pattern
consist of the single point, equal to the origin of coordinates. (In some complex situations, such analysis can
be too difficult. In such situations, this method may incorrectly return false.)
But there is the reverse guarantee: if this method returns true,
the number of points in this pattern is always 1 and its only point is the origin of coordinates,
in terms of Point.isOrigin()
method.
Unlike pointCount()
method, there is a guarantee that this method
never works very slowly and cannot lead to TooManyPointsInPatternError
/ OutOfMemoryError.
In situations, when the number of points is very large
(and, so, pointCount()
method is not safe in use),
this method must detect this fact in reasonable time and return false.
There is a guarantee, that if this object implements QuickPointCountPattern
interface,
then this method works very quickly (O(1) operations) and absolutely correctly.
isSurelySinglePoint()
boolean isSurelyInteger()
More precisely, if this method returns true, then there are the following guarantees:
points()
method, as well as by
coordMin()
/coordMax()
, Point.isInteger()
method returns true;minkowskiDecomposition(int)
,
unionDecomposition(int)
and allUnionDecompositions(int)
methods, is also surely integer,
i.e. this method also returns true for it.However, there are no strict guarantees that this method always returns true if the pattern is really integer. In other words, if this method returns false, there is no guarantee, that this pattern really contains some noninteger points — but it is probable.
Unlike points()
method, there is a guarantee that this method
never works very slowly and cannot lead to TooManyPointsInPatternError
/ OutOfMemoryError.
In situations, when the number of points is very large
and there is a risk to fail with TooManyPointsInPatternError
/ OutOfMemoryError,
this method must detect this fact in reasonable time and return false.
See the comments to this interface
, section "Integer patterns", for more details.
UniformGridPattern round()
comments to this interface
, section "Uniformgrid patterns").
More precisely, the resulting pattern:
toRoundedPoint()
.toPoint()
;UniformGridPattern.originOfGrid()
=(0,0,...,0)
and unit steps UniformGridPattern.stepsOfGrid()
={1,1,..,1}.Note: the number of points in the result can be less than pointCount()
, because some
real points can be rounded to the same integer points.
Warning! If this object is not DirectPointSetPattern
and is not RectangularPattern
, this method can work slowly for some large patterns:
the required time can be O(N), where N is the number of points.
In these cases, this method can also throw TooManyPointsInPatternError
or OutOfMemoryError. The situation is like in points()
and roundedPoints()
method.
There is a guarantee, that if this object implements DirectPointSetPattern
interface,
then this method requires not greater than O(N) operations and memory
(N=pointCount()
)
and never throws TooManyPointsInPatternError
.
There is a guarantee, that if this object implements RectangularPattern
interface,
then this method works quickly (O(1) operations) and without exceptions.
It is an important difference from points()
and roundedPoints()
method.
The theorem I, described in the comments to this interface
,
section "Coordinate restrictions", provides a guarantee that this method never throws
TooLargePatternCoordinatesException
.
TooManyPointsInPatternError
 if this pattern is not DirectPointSetPattern
and
not RectangularPattern
and if, at the same time, the number
of points is greater than Integer.MAX_VALUE or,
in some rare situations, is near this limit
(OutOfMemoryError can be also thrown instead of this exception).Pattern shift(Point shift)
More precisely, the resulting pattern consists of the points,
obtained from all points of this pattern by the call point.add
(shift).
The returned pattern always implements DirectPointSetPattern
if this pattern implements DirectPointSetPattern
The returned pattern always implements RectangularPattern
if this pattern implements RectangularPattern
.
The returned pattern always implements UniformGridPattern
if this pattern implements UniformGridPattern
.
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
never throws TooManyPointsInPatternError
.
For comparison, an attempt to do the same operation via getting all points (points()
method),
correcting them and forming a new pattern via Patterns.newPattern(java.util.Collection)
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 shift).
However, TooLargePatternCoordinatesException
is impossible in many important cases, when
this pattern is an integer pattern and each coordinate
coord
(j)TooLargePatternCoordinatesException
in the following situations:
coordMin()
.symmetric()
,coordMax()
.symmetric()
,symmetric()
, where p is
some of the points
if this integer pattern.See more details in the comments to this interface
,
section "Coordinate restrictions", the theorem II.
shift
 the shift.java.lang.NullPointerException
 if the argument is null.java.lang.IllegalArgumentException
 if point.coordCount()
!=dimCount()
.TooLargePatternCoordinatesException
 if the set of shifted points does not fulfil the restrictions,
described in the comments to this interface
,
section "Coordinate restrictions".Pattern symmetric()
multiply(1.0)
.
The returned pattern always implements DirectPointSetPattern
if this pattern implements DirectPointSetPattern
The returned pattern always implements RectangularPattern
if this pattern implements RectangularPattern
.
The returned pattern always implements UniformGridPattern
if this pattern implements UniformGridPattern
.
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
never throws TooManyPointsInPatternError
.
For comparison, an attempt to do the same operation via getting all points (points()
method),
correcting them and forming a new pattern via Patterns.newPattern(java.util.Collection)
will lead to TooManyPointsInPatternError
/ OutOfMemoryError for some forms of large patterns.
Pattern multiply(double multiplier)
More precisely, the resulting pattern consists of the points,
obtained from all points of this pattern by the call
point.multiply
(multipliers).
This method is equivalent to scale(double... multipliers)
, where all
dimCount()
arguments of that method are equal to multiplier.
The returned pattern always implements DirectPointSetPattern
if this pattern implements DirectPointSetPattern
The returned pattern always implements RectangularPattern
if this pattern implements RectangularPattern
.
The returned pattern always implements UniformGridPattern
if this pattern implements UniformGridPattern
.
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
never throws TooManyPointsInPatternError
.
For comparison, an attempt to do the same operation via getting all points (points()
method),
correcting them and forming a new pattern via Patterns.newPattern(java.util.Collection)
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 a very large multiplier).
However, such failure is obviously impossible, if the multiplier is
in range 1.0<=multiplier<=1.0.
multiplier
 the scale along all coordinates.TooLargePatternCoordinatesException
 if the set of scaled points does not fulfil the restrictions,
described in the comments to this interface
,
section "Coordinate restrictions".scale(double...)
Pattern scale(double... multipliers)
More precisely, the resulting pattern consists of the points,
obtained from all points of this pattern by the call
point.scale
(multipliers).
The returned pattern always implements DirectPointSetPattern
if this pattern implements DirectPointSetPattern
The returned pattern always implements RectangularPattern
if this pattern implements RectangularPattern
.
The returned pattern always implements UniformGridPattern
if this pattern implements UniformGridPattern
.
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
never throws TooManyPointsInPatternError
.
For comparison, an attempt to do the same operation via getting all points (points()
method),
correcting them and forming a new pattern via Patterns.newPattern(java.util.Collection)
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.
multipliers
 the scales along coordinates.java.lang.NullPointerException
 if the argument is null.java.lang.IllegalArgumentException
 if multipliers.length!=dimCount()
.TooLargePatternCoordinatesException
 if the set of scaled points does not fulfil the restrictions,
described in the comments to this interface
,
section "Coordinate restrictions".multiply(double)
Pattern projectionAlongAxis(int coordIndex)
dimCount()
) is less by 1, than in this one.
More precisely, the resulting pattern consists of the points,
obtained from all points of this pattern by the call
point.projectionAlongAxis
(coordIndex).
The returned pattern always implements DirectPointSetPattern
if this pattern implements DirectPointSetPattern
The returned pattern always implements RectangularPattern
if this pattern implements RectangularPattern
.
The returned pattern always implements UniformGridPattern
if this pattern implements UniformGridPattern
.
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
never throws TooManyPointsInPatternError
.
For comparison, an attempt to do the same operation via getting all points (points()
method),
correcting them and forming a new pattern via Patterns.newPattern(java.util.Collection)
will lead to TooManyPointsInPatternError
/ OutOfMemoryError for some forms of large patterns.
coordIndex
 the index of the coordinate (0 for xaxis , 1 for yaxis,
2 for zaxis, etc.).dimCount()
is equal to
thisInstance.dimCount()
1).java.lang.IndexOutOfBoundsException
 if coordIndex<0 or coordIndex>=dimCount()
.java.lang.IllegalStateException
 if this pattern is 1dimensional (dimCount()
==1).Pattern minBound(int coordIndex)
dimCount()
) is the same as in this one.
In other words, this method removes some points from this pattern according the following rule:
if this pattern contains several points p_{0}, p_{1}, ...,
p_{m−1} with identical projection to the given axis
(p_{i}.projectionAlongAxis
(coordIndex).equals(p_{j}.projectionAlongAxis
(coordIndex)) for all i, j),
then the resulting pattern contains only one from these points, for which
the given coordinate coord
(coordIndex) has the minimal value.
This method is especially useful for uniformgrid
patterns.
For example, in rectangular patterns
this method returns
one of the facets of the hyperparallelepiped.
In most cases (including all rectangular patterns
)
this method returns the same result as UniformGridPattern.lowerSurface(int)
;
but if the figure, described by this pattern, contains some "holes", the result of this method
contains fewer points than UniformGridPattern.lowerSurface(int)
.
The returned pattern always implements DirectPointSetPattern
if this pattern implements DirectPointSetPattern
The returned pattern always implements RectangularPattern
if this pattern implements RectangularPattern
.
The returned pattern always implements UniformGridPattern
if this pattern implements UniformGridPattern
.
Warning! If this object is not DirectPointSetPattern
and is not RectangularPattern
, this method can work slowly for some large patterns:
the required time can be O(N), where N is the number of points.
In these cases, this method can also throw TooManyPointsInPatternError
or OutOfMemoryError. The situation is like in points()
and roundedPoints()
method.
There is a guarantee, that if this object implements DirectPointSetPattern
interface,
then this method requires not greater than O(N) memory
(N=pointCount()
)
and never throws TooManyPointsInPatternError
.
There is a guarantee, that if this object implements RectangularPattern
interface,
then this method works quickly (O(1) operations) and without exceptions.
coordIndex
 the index of the coordinate (0 for xaxis , 1 for yaxis,
2 for zaxis, etc.).java.lang.IndexOutOfBoundsException
 if coordIndex<0 or coordIndex>=dimCount()
.TooManyPointsInPatternError
 if this pattern is not DirectPointSetPattern
and
not RectangularPattern
and if, at the same time, the number
of points is greater than Integer.MAX_VALUE or,
in some rare situations, is near this limit
(OutOfMemoryError can be also thrown instead of this exception).maxBound(int)
Pattern maxBound(int coordIndex)
dimCount()
) is the same as in this one.
In other words, this method removes some points from this pattern according the following rule:
if this pattern contains several points p_{0}, p_{1}, ...,
p_{m−1} with identical projection to the given axis
(p_{i}.projectionAlongAxis
(coordIndex).equals(p_{j}.projectionAlongAxis
(coordIndex)) for all i, j),
then the resulting pattern contains only one from these points, for which
the given coordinate coord
(coordIndex) has the maximal value.
This method is especially useful for uniformgrid
patterns.
For example, in rectangular patterns
this method returns
one of the facets of the hyperparallelepiped.
In most cases (including all rectangular patterns
)
this method returns the same result as UniformGridPattern.upperSurface(int)
;
but if the figure, described by this pattern, contains some "holes", the result of this method
contains fewer points than UniformGridPattern.upperSurface(int)
.
The returned pattern always implements DirectPointSetPattern
if this pattern implements DirectPointSetPattern
The returned pattern always implements RectangularPattern
if this pattern implements RectangularPattern
.
The returned pattern always implements UniformGridPattern
if this pattern implements UniformGridPattern
.
Warning! If this object is not DirectPointSetPattern
and is not RectangularPattern
, this method can work slowly for some large patterns:
the required time can be O(N), where N is the number of points.
In these cases, this method can also throw TooManyPointsInPatternError
or OutOfMemoryError. The situation is like in points()
and roundedPoints()
method.
There is a guarantee, that if this object implements DirectPointSetPattern
interface,
then this method requires not greater than O(N) memory
(N=pointCount()
)
and never throws TooManyPointsInPatternError
.
There is a guarantee, that if this object implements RectangularPattern
interface,
then this method works quickly (O(1) operations) and without exceptions.
coordIndex
 the index of the coordinate (0 for xaxis , 1 for yaxis,
2 for zaxis, etc.).java.lang.IndexOutOfBoundsException
 if coordIndex<0 or coordIndex>=dimCount()
.TooManyPointsInPatternError
 if this pattern is not DirectPointSetPattern
and
not RectangularPattern
and if, at the same time, the number
of points is greater than Integer.MAX_VALUE or,
in some rare situations, is near this limit
(OutOfMemoryError can be also thrown instead of this exception).minBound(int)
Pattern carcass()
Here A⊕B means the Minkowski sum
of patterns A and B,
k⊗P means P⊕P⊕...⊕P (k summands),
and kP means the pointwise geometrical multiplication of the pattern P by the multiplier k,
i.e. P.multiply
(k).
This method tries to find the minimal carcass, consisting of as little as possible number of points,
and the maximal value n, for which the formulas above are correct for the found carcass.
(The value 2^{n} is called the maximal carcass multiplier
and is returned by maxCarcassMultiplier()
method.)
For example, for rectangular patterns
this method returns
the set of vertices of the hyperparallelepiped (in onedimensional case, the pair of segment ends),
and the corresponding n=+∞.
But this method does not guarantee that the returned result is always the minimal possible carcass
and that the found n is really maximal for this carcass.
This method allows to optimize calculation of the point set of a Minkowski multiple k⊗P.
It is really used in the pattern implementations, returned
by Patterns.newMinkowskiMultiplePattern(Pattern, int)
method:
the result of that method is not always an actual Minkowski sum of N equal patterns,
but can be (in the best case) an equal Minkowski sum of ~log_{2}N patterns
In the worst case (no optimization is possible), this method just returns this object (C=P),
and maxCarcassMultiplier()
returns 2 (i.e. n=1).
The returned pattern has the same number of dimensions (dimCount()
) as this one.
The returned pattern always implements UniformGridPattern
if this pattern implements UniformGridPattern
.
This method can require some time and memory for execution,
but never throws TooManyPointsInPatternError
.
int maxCarcassMultiplier()
carcass()
method for more information.
Note: the returned value is always ≥2. If the correct value is greater than Integer.MAX_VALUE
(for example, for rectangular patterns
),
this method returns Integer.MAX_VALUE; in all other cases the returning value is a power of two.
This method can require some time and memory for execution,
but never throws TooManyPointsInPatternError
.
Usually an implementation caches the results of carcass()
and this methods,
so this method works very quickly after the first call of carcass()
.
carcass
.Pattern minkowskiAdd(Pattern added)
add
(b)" call).
Please see details in
Warning! This method can work slowly for some forms of large patterns.
In these cases, this method can also throw TooManyPointsInPatternError
or OutOfMemoryError.
Warning: this method can fail with TooLargePatternCoordinatesException
, if some of new points
violate restrictions, described in the comments to this interface
,
section "Coordinate restrictions".
The returned pattern always implements DirectPointSetPattern
if this pattern implements DirectPointSetPattern
.
The returned pattern always implements RectangularPattern
if this pattern and subtracted argument implement RectangularPattern
and both patterns have identical steps
(i.e. thisPattern.stepsOfGridEqual
(subtracted) returns true).
In this case, this method works very quickly and without
TooManyPointsInPatternError
/ OutOfMemoryError exceptions.
Please draw attention: there is another way to build a Minkowski sum,
namely the method Patterns.newMinkowskiSum(java.util.Collection)
.
That method does not perform actual calculations and returns a special implementation
of this interface (see comments to this interface
, section "Complex patterns").
Unlike that method, this one tries to actually calculate the Minkowski sum, saving (when possible)
the type of the original pattern: see above two guarantees about DirectPointSetPattern
and RectangularPattern
types. If it is impossible to represent the Minkowski sum
by Java class of this pattern, it is probable that the result will be constructed
as DirectPointSetUniformGridPattern
or as SimplePattern
.
added
 another pattern.java.lang.NullPointerException
 if the argument is null.java.lang.IllegalArgumentException
 if the numbers of space dimensions of both patterns are different.TooManyPointsInPatternError
 for some forms of large patterns, if the number of points in this,
added or result pattern is greater than
Integer.MAX_VALUE or, maybe, is near this limitTooLargePatternCoordinatesException
 if the resulting set of points does not fulfil the restrictions,
described in the comments to this interface
,
section "Coordinate restrictions".Patterns.newMinkowskiSum(java.util.Collection)
,
minkowskiSubtract(Pattern)
Pattern minkowskiSubtract(Pattern subtracted)
add
(b)" call)
belongs to this pattern.
Please see more details in
Warning! This method can work slowly for some forms of large patterns.
In these cases, this method can also throw TooManyPointsInPatternError
or OutOfMemoryError.
Warning: this method can fail with TooLargePatternCoordinatesException
, if some of new points
violate restrictions, described in the comments to this interface
,
section "Coordinate restrictions". But it is obvious, that this exception
is impossible if the passed pattern "subtracted" contains the origin of coordinates
(in this case, the result is a subset of this pattern).
The returned pattern always implements DirectPointSetPattern
if this pattern implements DirectPointSetPattern
.
The returned pattern always implements RectangularPattern
if this pattern and subtracted argument implement RectangularPattern
and both patterns have identical steps
(i.e. thisPattern.stepsOfGridEqual
(subtracted) returns true).
In this case, this method works very quickly and without
TooManyPointsInPatternError
/ OutOfMemoryError exceptions.
subtracted
 another pattern.java.lang.NullPointerException
 if the argument is null.java.lang.IllegalArgumentException
 if the numbers of space dimensions of both patterns are different.TooManyPointsInPatternError
 for some forms of large patterns, if the number of points in this,
subtracted or result pattern is greater than
Integer.MAX_VALUE or, maybe, is near this limitTooLargePatternCoordinatesException
 if the resulting set of points does not fulfil the restrictions,
described in the comments to this interface
,
section "Coordinate restrictions".minkowskiAdd(Pattern)
java.util.List<Pattern> minkowskiDecomposition(int minimalPointCount)
This method tries to find the best decomposition, that means the list of patterns
with minimal summary number of points. For good pattern, the returned patterns list
can consist of O(log_{2}N) points (sum of pointCount()
values for all returned patterns),
where N is the number of points (pointCount()
) in this pattern.
For example, a linear onedimensional segment {x: 0<=x<2^{m}}
is a Minkowski sum of m point pairs {0, 2^{i}}, i=0,1,...,m1.
There is no guarantee that this method returns a good decomposition. If this method cannot find required decomposition, it returns the 1element list containing this instance as the only element.
If the number of points in this pattern is less than the argument, i.e.
pointCount()
<minimalPointCount, then this method probably does not
decompose this pattern and returns the 1element list containing this instance as its element.
But it is not guaranteed: if the method "knows" some decomposition, but estimation of the number of points
can require a lot of resources, this method may ignore minimalPointCount argument.
However, there is a guarantee that if the number of points is 1 or 2,
i.e. pointCount()
≤2, then this method always returns
the 1element list containing this instance as its element.
There is a guarantee that the elements of the resulting list cannot be further decomposed: this method, called for them with the same or larger minimalPointCount argument, always returns a list consisting of one element.
The number of space dimensions in all returned patterns (dimCount()
is the same as in this one.
The result of this method is immutable (Collections.unmodifiableList).
minimalPointCount
 this method usually does not decompose patterns that contain
less than minimalPointCount points.java.lang.IllegalArgumentException
 if the argument is negative.boolean hasMinkowskiDecomposition()
minkowskiDecomposition(0)
call,
consists of 2 or more patterns:
minkowskiDecomposition(0)
.size()>1.
In some situations this method works essentially faster then the actual
minkowskiDecomposition(0)
call.
Note that if this method returns true, then pointCount()
and
largePointCount()
methods can work very slowly and even may fail with
OutOfMemoryError or TooManyPointsInPatternError
.
java.util.List<Pattern> unionDecomposition(int minimalPointCount)
This method tries to find such decomposition, that all patterns P_{i} have good
Minkowski decompositions
and the summary number of points in all Minkowski decompositions
minkowskiDecomposition(minimalPointCount)
If the number of points in this pattern is less than the argument, i.e.
pointCount()
<minimalPointCount, then this method probably does not
decompose this pattern and returns the 1element list containing this instance as its element.
Moreover, this method tries to build such decomposition, that every element P_{i}
in the resulting list contains ≥minimalPointCount elements.
There is a guarantee that the elements of the resulting list cannot be further decomposed: this method, called for them with the same or larger minimalPointCount argument, always returns a list consisting of one element.
The number of space dimensions in all returned patterns (dimCount()
is the same as in this one.
The result of this method is immutable (Collections.unmodifiableList).
minimalPointCount
 this method usually does not decompose patterns that contain
less than minimalPointCount points.java.lang.IllegalArgumentException
 if the argument is negative.java.util.List<java.util.List<Pattern>> allUnionDecompositions(int minimalPointCount)
union decompositions
with equal or similar "quality",
i.e. with the same or almost same summary number of points in all Minkowski decompositions
of all returned patterns.
This method is a useful addition to unionDecomposition(int)
method for a case,
when there are several union decompositions with similar "quality".
In this case an algorithm, using union decompositions, is able to choose
the best from several variants according additional algorithmspecific criteria.
The number of space dimensions in all returned patterns (dimCount()
is the same as in this one.
The result of this method and the elements of the result are immutable (Collections.unmodifiableList).
minimalPointCount
 this method usually does not decompose patterns that contain
less than minimalPointCount points.java.lang.IllegalArgumentException
 if the argument is negative.