Package elki.math.spacefillingcurves
Class ZCurveSpatialSorter
- java.lang.Object
-
- elki.math.spacefillingcurves.ZCurveSpatialSorter
-
- All Implemented Interfaces:
SpatialSorter
public class ZCurveSpatialSorter extends java.lang.Object implements SpatialSorter
Class to sort the data set by their Z-index, without doing a full materialization of the Z indexes.- Since:
- 0.5.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classZCurveSpatialSorter.ParParameterization class.
-
Field Summary
Fields Modifier and Type Field Description static ZCurveSpatialSorterSTATICStatic instance.private static doubleSTOPVALStopping threshold.
-
Constructor Summary
Constructors Constructor Description ZCurveSpatialSorter()Constructor, useSTATICinstead.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static doublegetMinPlusMaxObject(java.util.List<? extends SpatialComparable> objs, int s, int dim)Compute getMin(dim) + getMax(dim) for the spatial object.protected static intpivotizeList1D(java.util.List<? extends SpatialComparable> objs, int start, int end, int dim, double threshold, boolean desc)"Pivotize" the list, such that all elements before the given position are less than, all elements after the position are larger than the threshold value in the given dimension.voidsort(java.util.List<? extends SpatialComparable> objs, int start, int end, double[] minmax, int[] dims)Sort part of the list (start to end).protected voidzSort(java.util.List<? extends SpatialComparable> objs, int start, int end, double[] mms, int[] dims, int depth)The actual Z sorting function-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.math.spacefillingcurves.SpatialSorter
sort
-
-
-
-
Field Detail
-
STATIC
public static final ZCurveSpatialSorter STATIC
Static instance.
-
STOPVAL
private static final double STOPVAL
Stopping threshold.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ZCurveSpatialSorter
public ZCurveSpatialSorter()
Constructor, useSTATICinstead.
-
-
Method Detail
-
sort
public void sort(java.util.List<? extends SpatialComparable> objs, int start, int end, double[] minmax, int[] dims)
Description copied from interface:SpatialSorterSort part of the list (start to end).- Specified by:
sortin interfaceSpatialSorter- Parameters:
objs- the spatial objects to be sortedstart- First index to sort (e.g., 0)end- End of range (e.g.,site())minmax- Array with dim pairs of (min, max) of value rangesdims- Dimensions to sort by, for indexing vectors andminmax.
-
zSort
protected void zSort(java.util.List<? extends SpatialComparable> objs, int start, int end, double[] mms, int[] dims, int depth)
The actual Z sorting function- Parameters:
objs- Objects to sortstart- Startend- Endmms- Min-Max value rangesdims- Dimensions to processdepth- Current dimension
-
pivotizeList1D
protected static int pivotizeList1D(java.util.List<? extends SpatialComparable> objs, int start, int end, int dim, double threshold, boolean desc)
"Pivotize" the list, such that all elements before the given position are less than, all elements after the position are larger than the threshold value in the given dimension. (desc inverts the sorting!) Only the elements in the interval [start: end[ are sorted!- Parameters:
objs- List of objectsstart- Start of sorting rangeend- End of sorting rangedim- Dimension to sort bythreshold- Threshold valuedesc- Inversion flag- Returns:
- Pivot position
-
getMinPlusMaxObject
private static double getMinPlusMaxObject(java.util.List<? extends SpatialComparable> objs, int s, int dim)
Compute getMin(dim) + getMax(dim) for the spatial object.- Parameters:
objs- Objectss- indexdim- Dimensionality- Returns:
- Min+Max
-
-