|
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
umontreal.iro.lecuyer.hups.CachedPointSet
umontreal.iro.lecuyer.hups.SortedPointSet
public class 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. ************
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
MultiDimSort
, 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)
Takes the first dim coordinates of the first n points of P and creates a SortedPointSet from these points by sorting them according to sort. |
|
SortedPointSet(PointSet P,
MultiDimSort sort)
Creates a new SortedPointSet storing the points of P and sorting them according to sort. |
Method Summary | |
---|---|
void |
addRandomShift(int d1,
int d2,
RandomStream stream)
Add the shift to the contained point set. |
int |
getDimension()
Returns the number of coordinates of each point, which is the dimension of the original point set minus the dimension of the sort. |
MultiDimSort |
getSort()
Returns the sort used. |
PointSetIterator |
iterator()
Constructs and returns a point set iterator which gets the values directly from the array. |
void |
randomize(PointSetRandomization rand)
Randomizes the contained point set using rand. |
String |
toString()
Formats a string that contains the information about the point set. |
Methods inherited from class umontreal.iro.lecuyer.hups.CachedPointSet |
---|
getCoordinate |
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 |
---|
public SortedPointSet(PointSet P, int n, int dim, MultiDimSort sort)
MultiDimSort
of dimension ds,
then the ordering of the points is determined from this sort acting
on the first ds coordinates of the original subset. The dimension of the
resulting SortedPointSet is (dim- ds).
P
- point set to be cachedn
- number of points from P to usedim
- dimension to use for the points of P, before sorting.sort
- MultiDimSort
to use for sortingpublic SortedPointSet(PointSet P, MultiDimSort sort)
P
- point set to be cachedsort
- MultiDimSort
to use for sortingMethod Detail |
---|
public int getDimension()
getDimension
in class PointSet
public MultiDimSort getSort()
public PointSetIterator iterator()
iterator
in class PointSet
public void addRandomShift(int d1, int d2, RandomStream stream)
addRandomShift
in class CachedPointSet
public void randomize(PointSetRandomization rand)
randomize
in class CachedPointSet
rand
- PointSetRandomization
to usepublic String toString()
toString
in class CachedPointSet
|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |