public class SubsetOfPointSet extends PointSet
Selecting a new subset of points or coordinates overwrites the previous selection. The specification of a subset with respect to the points is independent from selecting a subset with respect to the coordinates. The number of points and the dimension are adapted to the current selection and all indices still start from 0, i.e., the subset works just like an ordinary point set.
When the points or coordinates ranges are changed, existing iterators become invalid. They should be reconstructed or reset to avoid inconsistencies.
| Constructor and Description |
|---|
SubsetOfPointSet(PointSet P)
Constructs a new
PointSet object, initially identical to P,
and from which a subset of the points and/or a subset of the coordinates
is to be extracted. |
| Modifier and Type | Method and Description |
|---|---|
double |
getCoordinate(int i,
int j)
Returns ui, j, the coordinate j of the point i.
|
PointSetIterator |
iterator()
Constructs and returns a point set iterator.
|
void |
selectCoordinates(int[] coordIndices,
int numCoord)
Selects the numCoord coordinates whose numbers are provided in
the array coordIndices.
|
void |
selectCoordinatesRange(int from,
int to)
Selects the coordinates from ``from'' to ``to - 1'' from the
original point set.
|
void |
selectPoints(int[] pointIndices,
int numPoints)
Selects the numPoints points whose numbers are provided in the array
pointIndices.
|
void |
selectPointsRange(int from,
int to)
Selects the points numbered from ``from'' to ``to - 1'' from the
original point set.
|
java.lang.String |
toString()
Formats a string that contains information about the point set.
|
addRandomShift, addRandomShift, addRandomShift, addRandomShift, clearRandomShift, formatPoints, formatPoints, formatPoints, formatPoints, formatPointsBase, formatPointsBase, formatPointsBase, formatPointsBase, formatPointsNumbered, formatPointsNumbered, getDimension, getNumPoints, getStream, randomize, randomize, randomize, randomize, randomize, setStream, unrandomizepublic void selectPointsRange(int from,
int to)
from - index of the point, in the contained point set,
corresponding to the point 0 of this point setto - index of the last point taken from the contained point setpublic void selectPoints(int[] pointIndices,
int numPoints)
pointIndices - array of point indices to be selectednumPoints - number of points in the subset of point setpublic void selectCoordinatesRange(int from,
int to)
from - index of the coordinate, in the contained point set,
corresponding to the coordinate 0 of each point of this point setto - index of the last coordinate taken for each point
from the contained point setpublic void selectCoordinates(int[] coordIndices,
int numCoord)
coordIndices - array of coordinate indices to be selectednumCoord - number of coordinatess for each point in the subset of point setpublic double getCoordinate(int i,
int j)
PointSetgetCoordinate in class PointSeti - index of the point to look forj - index of the coordinate to look forpublic PointSetIterator iterator()
PointSetgetCoordinate (i,j) to iterate over the
points and coordinates, but subclasses can reimplement it
for better efficiency.To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.