|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.hups.PointSet
public abstract class PointSet
PointSet
This abstract class defines the basic methods for accessing and manipulating point sets. A point set can be represented as a two-dimensional array, whose element (i, j) contains ui, j, the coordinate j of point i. Each coordinate ui, j is assumed to be in the unit interval [0, 1]. Whether the values 0 and 1 can occur may depend on the actual implementation of the point set.
All points have the same number of coordinates (their dimension) and this number can be queried by getDimension. The number of points is queried by getNumPoints. The points and coordinates are both numbered starting from 0 and their number can actually be infinite.
The iterator method provides a point set iterator which permits one to enumerate the points and their coordinates. Several iterators over the same point set can coexist at any given time. These iterators are instances of a hidden inner-class that implements the PointSetIterator interface. The default implementation of iterator provided here relies on the method getCoordinate to access the coordinates directly. However, this approach is rarely efficient. Specialized implementations that dramatically improve the performance are provided in subclasses of PointSet. The PointSetIterator interface actually extends the RandomStream interface, so that the iterator can also be seen as a RandomStream and used wherever such a stream is required for generating uniform random numbers. This permits one to easily replace pseudorandom numbers by the coordinates of a selected set of highly-uniform points, i.e., to replace Monte Carlo by quasi-Monte Carlo in a simulation program.
This abstract class has only one abstract method: getCoordinate. Providing an implementation for this method is already sufficient for the subclass to work. However, in many cases, efficiency can be dramatically improved by overwriting iterator to provide a custom iterator that does not necessarily rely on getCoordinate. In fact, direct use of getCoordinate to access the coordinates is generally discouraged. One should access the points and coordinates via the iterators.
Constructor Summary | |
---|---|
PointSet()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PointSet()
Method Detail |
---|
public int getDimension()
public int getNumPoints()
public abstract double getCoordinate(int i, int j)
public PointSetIterator iterator()
public void setStream(RandomStream stream)
public RandomStream getStream()
public void randomize(PointSetRandomization rand)
@Deprecated public void addRandomShift(int d1, int d2, RandomStream stream)
@Deprecated public void addRandomShift(RandomStream stream)
@Deprecated public void addRandomShift(int d1, int d2)
@Deprecated public void addRandomShift()
@Deprecated public void clearRandomShift()
public void randomize(int fromDim, int toDim, RandomStream stream)
public void randomize(RandomStream stream)
@Deprecated public void randomize(int d1, int d2)
@Deprecated public void randomize()
public void unrandomize()
public String toString()
toString
in class Object
public String formatPoints()
public String formatPoints(int n, int d)
public String formatPoints(PointSetIterator iter)
public String formatPoints(PointSetIterator iter, int n, int d)
public String formatPointsBase(int b)
public String formatPointsBase(int n, int d, int b)
public String formatPointsBase(PointSetIterator iter, int b)
public String formatPointsBase(PointSetIterator iter, int n, int d, int b)
public String formatPointsNumbered()
public String formatPointsNumbered(int n, int d)
|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |