SSJ
V. labo.

umontreal.iro.lecuyer.hups
Class CachedPointSet

java.lang.Object
  extended by umontreal.iro.lecuyer.hups.PointSet
      extended by umontreal.iro.lecuyer.hups.CachedPointSet
Direct Known Subclasses:
IndependentPointsCached, LatinHypercube, SortedPointSet, StratifiedUnitCube, StratifiedUnitCubeAnti

public class CachedPointSet
extends PointSet

CachedPointSet

This container class caches a point set by precomputing and storing its points locally in an array. This can be used to speed up computations when using a small low-dimensional point set more than once. Some types of point sets are also implemented directly as subclasses of this one, without having a contained point set P.


\begin{detailed}%
 After the points are stored in the array, this class uses
 the ...
 ...}
 However, it may require too much memory for a large point set.
 \end{detailed}

There are sort methods available to sort the cached points and stripCoordinates methods that remove certain coordinates of the points. Those methods affect only the array where the points are cached; they have no impact on the (underlying) original point set.


Constructor Summary
CachedPointSet(PointSet P)
          .
CachedPointSet(PointSet P, int n, int dim)
          .
CachedPointSet(PointSet P, int fromPoint, int toPoint, int fromDim, int toDim)
          .
 
Method Summary
 void addRandomShift(int d1, int d2, RandomStream stream)
          .
 double getCoordinate(int i, int j)
          .
 void randomize(PointSetRandomization rand)
          .
 void sortByCoordinate(int j)
          .
 void sortMultidimBatch(int[] numBatches, int d)
          .
 void sortMultidimBatchSplit(int numBatches, int d)
          .
 void stripCoordinates(int d)
          .
 String toString()
          .
 
Methods inherited from class umontreal.iro.lecuyer.hups.PointSet
addRandomShift, addRandomShift, addRandomShift, clearRandomShift, formatPoints, formatPoints, formatPoints, formatPoints, formatPointsBase, formatPointsBase, formatPointsBase, formatPointsBase, formatPointsNumbered, formatPointsNumbered, getDimension, getNumPoints, getStream, iterator, randomize, randomize, randomize, randomize, setStream, unrandomize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CachedPointSet

public CachedPointSet(PointSet P,
                      int fromPoint,
                      int toPoint,
                      int fromDim,
                      int toDim)
. \begin{tabb}
 Creates a new \texttt{PointSet} object that contains an array stor...
 ...\ of them.
 The original point set \texttt{P} itself is not modified.
 \end{tabb}
Ppoint set to be cached fromPointnumber of skipped points (usually 0) toPoint1 + number of the last point selected from P fromDimnumber of skipped coordinates (often 0) toDim1 + index of last coordinate in the original points


CachedPointSet

public CachedPointSet(PointSet P,
                      int n,
                      int dim)
. \begin{tabb}
 Same as \method{CachedPointSet (P, 0, n, 0, dim)}{}.
 \end{tabb}


CachedPointSet

public CachedPointSet(PointSet P)
. \begin{tabb}
 Creates a new \texttt{PointSet} object that contains an array stor...
 ...sion are the same as in the
 original point set. Both must be finite.
 \end{tabb}
Ppoint set to be cached

Method Detail

addRandomShift

public void addRandomShift(int d1,
                           int d2,
                           RandomStream stream)
. \begin{tabb}
 Add the shift to the contained point set and recaches the points. S...
 ...to randomize the cached points.
 \pierre{Should we keep this method?}
 \end{tabb}

Overrides:
addRandomShift in class PointSet

randomize

public void randomize(PointSetRandomization rand)
. \begin{tabb}
 Randomizes the underlying point set using \texttt{rand} and re-cach...
 ...nt set, this method must be redefined to randomize the cached points.
 \end{tabb}

Overrides:
randomize in class PointSet

sortByCoordinate

public void sortByCoordinate(int j)
. \begin{tabb}
 Sorts the \emph{cached} points by increasing order of coordinate \...
 ...y to the cached points, and not to the original points in \texttt{P}.
 \end{tabb}


sortMultidimBatch

public void sortMultidimBatch(int[] numBatches,
                              int d)
. \begin{tabb}
 Sorts the points with a multidimensional sort defined as follows, ...
 ...of sort is useful in the ArrayRQMC simulation method, in particular.
 \end{tabb}


sortMultidimBatchSplit

public void sortMultidimBatchSplit(int numBatches,
                                   int d)
. \begin{tabb}
 A variant of \method{sortMultidimBatch}{} where the the number of ...
 ..., the number of points \emph{must be} a power of \texttt{numBatches}.
 \end{tabb}


stripCoordinates

public void stripCoordinates(int d)
. \begin{tabb}
 Removes the first \texttt{d} coordinates of each point.
 This is useful in particular for the ArrayRQMC simulation method.
 \end{tabb}


toString

public String toString()
Description copied from class: PointSet
. \begin{tabb}
 Formats a string that contains information about the point set.
 \end{tabb}
string representation of the point set information

Overrides:
toString in class PointSet

getCoordinate

public double getCoordinate(int i,
                            int j)
Description copied from class: PointSet
. \begin{tabb}
 Returns $u_{i,j}$, the coordinate $j$\ of the point $i$.
 \richard{...
 ...xttt{getCoordinate} impl\'ementent le random shift
 quand il existe?}
 \end{tabb}
iindex of the point to look for jindex of the coordinate to look for the value of ui, j

Specified by:
getCoordinate in class PointSet

SSJ
V. labo.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.