Package de.lmu.ifi.dbs.elki.distance.distanceresultlist

Classes for building and storing the results of distance-based queries The classes in this package essentially form three groups: KNNHeap for building kNN results.

See: Description


Package de.lmu.ifi.dbs.elki.distance.distanceresultlist Description

Classes for building and storing the results of distance-based queries

The classes in this package essentially form three groups:

  1. KNNHeap for building kNN results. It allows adding new candidates (and loses old candidates automatically), but it is not iterable.
    To get an instance, use KNNUtil.newHeap(de.lmu.ifi.dbs.elki.distance.distancefunction.DistanceFunction<?, D>, int)!
  2. KNNResult is the final kNN result obtained by serializing a heap via KNNHeap.toKNNList(). It is iterable and totally ordered, but can no longer be modified (unless you call KNNUtil.newHeap(de.lmu.ifi.dbs.elki.distance.distancefunction.DistanceFunction<?, D>, int)!
  3. GenericDistanceDBIDList and the optimized counterpart DoubleDistanceDBIDList, are modifiable, but not necessarily sorted lists of neighbors, useful for example for range queries.

Try to choose the most appropriate one! Heaps are optimized for updates but bad for reading, KNNResult is optimized for reading but unmodifiable, and the lists are easy to modify, but less efficient than heaps.

Release 0.5.5 (2012-12-10_1245)