Class CacheDoubleDistanceKNNLists<O>

  • Type Parameters:
    O - Object type

    public class CacheDoubleDistanceKNNLists<O>
    extends elki.application.AbstractApplication
    Precompute the k nearest neighbors in a disk cache.
    Since:
    0.6.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private elki.database.Database database
      Data source to process.
      private elki.distance.Distance<? super O> distance
      Distance function that is to be cached.
      private int k
      Number of neighbors to precompute.
      static int KNN_CACHE_MAGIC
      Magic number to identify files.
      private static elki.logging.Logging LOG
      The logger for this class.
      private java.nio.file.Path out
      Output file.
      • Fields inherited from class elki.application.AbstractApplication

        REFERENCE, VERSION
    • Constructor Summary

      Constructors 
      Constructor Description
      CacheDoubleDistanceKNNLists​(elki.database.Database database, elki.distance.Distance<? super O> distance, int k, java.nio.file.Path out)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)
      Main method, delegate to super class.
      void run()  
      • Methods inherited from class elki.application.AbstractApplication

        printErrorMessage, runCLIApplication, usage
      • Methods inherited from class java.lang.Object

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

      • LOG

        private static final elki.logging.Logging LOG
        The logger for this class.
      • database

        private elki.database.Database database
        Data source to process.
      • distance

        private elki.distance.Distance<? super O> distance
        Distance function that is to be cached.
      • k

        private int k
        Number of neighbors to precompute.
      • out

        private java.nio.file.Path out
        Output file.
      • KNN_CACHE_MAGIC

        public static final int KNN_CACHE_MAGIC
        Magic number to identify files.

        Note, when cloning this class, and performing any incompatible change to the file format, you should also change this magic ID!

        See Also:
        Constant Field Values
    • Constructor Detail

      • CacheDoubleDistanceKNNLists

        public CacheDoubleDistanceKNNLists​(elki.database.Database database,
                                           elki.distance.Distance<? super O> distance,
                                           int k,
                                           java.nio.file.Path out)
        Constructor.
        Parameters:
        database - Data source
        distance - Distance function
        k - Number of nearest neighbors
        out - Matrix output file
    • Method Detail

      • run

        public void run()
        Specified by:
        run in class elki.application.AbstractApplication
      • main

        public static void main​(java.lang.String[] args)
        Main method, delegate to super class.
        Parameters:
        args - Command line arguments