Package elki.index.tree.spatial.kd.split
Class SplitStrategy.Util
- java.lang.Object
-
- elki.index.tree.spatial.kd.split.SplitStrategy.Util
-
- Enclosing interface:
- SplitStrategy
public static final class SplitStrategy.Util extends java.lang.Object
Utility functions.- Author:
- Erich Schubert
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Util()
Private constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static int
argmaxdiff(double[] minmax)
Find the largest difference(package private) static double[]
minmaxRange(int dims, Relation<? extends NumberVector> relation, DBIDArrayIter iter, int left, int right)
Find the minimum and maximum in each dimension of a range of values.(package private) static int
pivot(Relation<? extends NumberVector> relation, ArrayModifiableDBIDs sorted, DBIDArrayMIter iter, int dim, int left, int right, double mid)
Pivot an interval.(package private) static double[]
sumvar(Relation<? extends NumberVector> relation, int dims, DBIDArrayMIter iter, int left, int right)
Compute the sum and sum-of-squares (for variance).
-
-
-
Method Detail
-
minmaxRange
static double[] minmaxRange(int dims, Relation<? extends NumberVector> relation, DBIDArrayIter iter, int left, int right)
Find the minimum and maximum in each dimension of a range of values.- Parameters:
dims
- Number of dimensionsrelation
- Data relationiter
- Iteratorleft
- Beginning of rangeright
- End of range- Returns:
- Array containing minima, then maxima
-
sumvar
static double[] sumvar(Relation<? extends NumberVector> relation, int dims, DBIDArrayMIter iter, int left, int right)
Compute the sum and sum-of-squares (for variance).- Parameters:
relation
- Data relationdims
- Dimensionalityiter
- Iteratorleft
- Interval startright
- Interval end- Returns:
- Array containing sums and variances
-
argmaxdiff
static int argmaxdiff(double[] minmax)
Find the largest difference- Parameters:
minmax
- Minima, then maxima- Returns:
- Index of largest difference
-
pivot
static int pivot(Relation<? extends NumberVector> relation, ArrayModifiableDBIDs sorted, DBIDArrayMIter iter, int dim, int left, int right, double mid)
Pivot an interval.- Parameters:
relation
- Data relationsorted
- Sorted list of entriesiter
- List iteratordim
- Dimensionleft
- Left range of the listright
- Right end of the list rangemid
- Value to pivot to- Returns:
- Pivot position
-
-