Interface KNNHeap

    • Method Detail

      • toKNNList

        KNNList toKNNList()
        Serialize to a KNNList. This empties the heap!
        Returns:
        KNNList with the heaps contents.
      • toKNNListSqrt

        KNNList toKNNListSqrt()
        Serialize to a KNNList, but applying sqrt to every distance. This empties the heap!
        Returns:
        KNNList with the heaps contents.
      • insert

        double insert​(double distance,
                      DBIDRef id)
        Add a distance-id pair to the heap
        Specified by:
        insert in interface DoubleDBIDHeap
        Parameters:
        distance - Distance value
        id - ID number
        Returns:
        Distance to the element at the top of the heap
      • insert

        @Deprecated
        default double insert​(double distance,
                              DBIDRef id,
                              int max)
        Deprecated.
        Disallowed, because max is fixed.
        Specified by:
        insert in interface DoubleDBIDHeap
        Parameters:
        distance - Distance value
        id - ID number
        max - Maximum number of values
        Returns:
        Distance to the element at the top of the heap
        Throws:
        java.lang.UnsupportedOperationException
      • getK

        int getK()
        Get the K parameter ("maxsize" internally).
        Returns:
        K
      • getKNNDistance

        double getKNNDistance()
        Get the distance to the k nearest neighbor, or maxdist otherwise.
        Returns:
        Maximum distance