|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.hups.PointSet umontreal.iro.lecuyer.hups.SubsetOfPointSet
public class SubsetOfPointSet
This container class permits one to select a subset of a point set. This is done by selecting a range or providing an array of either point or coordinate indices. A typical application of a range selection is to make the number of points or the dimension finite. It is also possible to provide, for example, a random permutation in the selection of components. It is possible also to take projections of coordinates for selected dimensions.
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 Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
String |
toString()
Formats a string that contains information about the point set. |
Methods inherited from class umontreal.iro.lecuyer.hups.PointSet |
---|
addRandomShift, addRandomShift, addRandomShift, addRandomShift, clearRandomShift, formatPoints, formatPoints, formatPoints, formatPoints, formatPointsBase, formatPointsBase, formatPointsBase, formatPointsBase, formatPointsNumbered, formatPointsNumbered, getDimension, getNumPoints, getStream, randomize, randomize, randomize, randomize, randomize, setStream, unrandomize |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SubsetOfPointSet(PointSet P)
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.
P
- point set for which a subset is constructedMethod Detail |
---|
public 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)
PointSet
getCoordinate
in class PointSet
i
- index of the point to look forj
- index of the coordinate to look for
public PointSetIterator iterator()
PointSet
getCoordinate
(i,j) to iterate over the
points and coordinates, but subclasses can reimplement it
for better efficiency.
iterator
in class PointSet
public String toString()
PointSet
toString
in class PointSet
|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |