Class 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).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Util

        private Util()
        Private constructor. Do not instatiate.
    • 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 dimensions
        relation - Data relation
        iter - Iterator
        left - Beginning of range
        right - 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 relation
        dims - Dimensionality
        iter - Iterator
        left - Interval start
        right - 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 relation
        sorted - Sorted list of entries
        iter - List iterator
        dim - Dimension
        left - Left range of the list
        right - Right end of the list range
        mid - Value to pivot to
        Returns:
        Pivot position