Package elki.data

Class VectorUtil.SortDBIDsBySingleDimension

  • All Implemented Interfaces:
    java.util.Comparator<DBIDRef>
    Direct Known Subclasses:
    MinimalisticMemoryKDTree.CountSortAccesses
    Enclosing class:
    VectorUtil

    public static class VectorUtil.SortDBIDsBySingleDimension
    extends java.lang.Object
    implements java.util.Comparator<DBIDRef>
    Compare number vectors by a single dimension.
    Author:
    Erich Schubert
    • Field Detail

      • d

        private int d
        Dimension to sort with.
    • Constructor Detail

      • SortDBIDsBySingleDimension

        public SortDBIDsBySingleDimension​(Relation<? extends NumberVector> data,
                                          int dim)
        Constructor.
        Parameters:
        data - Vector data source
        dim - Dimension to sort by
      • SortDBIDsBySingleDimension

        public SortDBIDsBySingleDimension​(Relation<? extends NumberVector> data)
        Constructor.
        Parameters:
        data - Vector data source
    • Method Detail

      • getDimension

        public int getDimension()
        Get the dimension to sort by.
        Returns:
        Dimension to sort with
      • setDimension

        public void setDimension​(int d2)
        Set the dimension to sort by.
        Parameters:
        d2 - Dimension to sort with
      • compare

        public int compare​(DBIDRef id1,
                           DBIDRef id2)
        Specified by:
        compare in interface java.util.Comparator<DBIDRef>