SSJ
V. labo.

umontreal.iro.lecuyer.hups
Class SortedPointSet

java.lang.Object
  extended by umontreal.iro.lecuyer.hups.PointSet
      extended by umontreal.iro.lecuyer.hups.CachedPointSet
          extended by umontreal.iro.lecuyer.hups.SortedPointSet

public class SortedPointSet
extends CachedPointSet

SortedPointSet

Cette classe est trop particulière au problème d'Adam pour être incluse dans le HUPS public. Ne pas la recopier pour distribution hors du labo. We can eliminate this class, indeed, because it is much too specific. The CachedPointSet class now offers methods for multi-dimensional sort and for skipping coordinates.

This container class builds a sorted point set based on some given original point set. Both point sets may have the same number of points, but the dimension of the sorted point set is smaller than the dimension of the original point set. Some of the coordinates of the original point set are used for sorting the points according to a umontreal.iro.lecuyer.utilMultiDimSort, and the remaining coordinates define the sorted point set, where the points are in the new sorted order.

If the original point set has dimension d0 and the MultiDimSort sorts in ds dimensions, then the sorted point set has dimension (d0 - ds). The MultiDimSort is applied on the first ds coordinates of the original point set and the remaining coordinates belong to the sorted point set.

When a SortedPointSet is randomized, the randomization is applied to the original point set, but the changes over the first ds coordinates are ignored, such that the point ordering between the original point set and the sorted point set is unchanged. The remaining randomized coordinates of the original used become the new values of the SortedPointSet.

All points of a SortedPointSet are held in memory, which could be problematic for a large point set.


Constructor Summary
SortedPointSet(PointSet P, int n, int dim, MultiDimSort sort)
          .
SortedPointSet(PointSet P, MultiDimSort sort)
          .
 
Method Summary
 void addRandomShift(int d1, int d2, RandomStream stream)
          .
 int getDimension()
          .
 MultiDimSort getSort()
          .
 PointSetIterator iterator()
          .
 void randomize(PointSetRandomization rand)
          .
 String toString()
          .
 
Methods inherited from class umontreal.iro.lecuyer.hups.CachedPointSet
getCoordinate, sortByCoordinate, sortMultidimBatch, sortMultidimBatchSplit, stripCoordinates
 
Methods inherited from class umontreal.iro.lecuyer.hups.PointSet
addRandomShift, addRandomShift, addRandomShift, clearRandomShift, formatPoints, formatPoints, formatPoints, formatPoints, formatPointsBase, formatPointsBase, formatPointsBase, formatPointsBase, formatPointsNumbered, formatPointsNumbered, getNumPoints, getStream, randomize, randomize, randomize, randomize, setStream, unrandomize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SortedPointSet

public SortedPointSet(PointSet P,
                      int n,
                      int dim,
                      MultiDimSort sort)
. \begin{tabb}
 Takes the first \texttt{dim} coordinates of the first \texttt{n} po...
 ...of the
 resulting \texttt{SortedPointSet} is (\texttt{dim}${}- d_s$).
 \end{tabb}
Ppoint set to be cached nnumber of points from P to use dimdimension to use for the points of P, before sorting. sortumontreal.iro.lecuyer.utilMultiDimSort to use for sorting


SortedPointSet

public SortedPointSet(PointSet P,
                      MultiDimSort sort)
. \begin{tabb}
 Creates a new \texttt{SortedPointSet} storing the points of
 \textt...
 ...sort}. Both the
 number of points and their dimension must be finite.
 \end{tabb}
Ppoint set to be cached sortumontreal.iro.lecuyer.utilMultiDimSort to use for sorting

Method Detail

getDimension

public int getDimension()
. \begin{tabb}
 Returns the number of coordinates of each point, which is
 the dimension of the original point set minus the dimension of the sort.
 \end{tabb}

Overrides:
getDimension in class PointSet

getSort

public MultiDimSort getSort()
. \begin{tabb}
 Returns the sort used.
 \end{tabb}


iterator

public PointSetIterator iterator()
. \begin{tabb}
 Constructs and returns a point set iterator which gets the values
 directly from the array.
 \end{tabb}

Overrides:
iterator in class PointSet

addRandomShift

public void addRandomShift(int d1,
                           int d2,
                           RandomStream stream)
. \begin{tabb}
 Add the shift to the contained point set.
 \end{tabb}

Overrides:
addRandomShift in class CachedPointSet

randomize

public void randomize(PointSetRandomization rand)
. \begin{tabb}
 Randomizes the contained point set using \texttt{rand}.
 \end{tabb}
randPointSetRandomization to use

Overrides:
randomize in class CachedPointSet

toString

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

Overrides:
toString in class CachedPointSet

SSJ
V. labo.

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