Package elki.database.ids.integer
Class DoubleIntegerDBIDKNNList
- java.lang.Object
-
- elki.database.ids.integer.DoubleIntegerDBIDArrayList
-
- elki.database.ids.integer.DoubleIntegerDBIDKNNList
-
- All Implemented Interfaces:
DBIDs,DoubleDBIDList,DoubleIntegerDBIDList,IntegerDBIDs,KNNList,ModifiableDoubleDBIDList
class DoubleIntegerDBIDKNNList extends DoubleIntegerDBIDArrayList implements KNNList, DoubleIntegerDBIDList
kNN list, but without automatic sorting. Use with care, as others may expect the results to be sorted!- Since:
- 0.6.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface elki.database.ids.DoubleDBIDList
DoubleDBIDList.Consumer
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intkThe k value this list was generated for.-
Fields inherited from class elki.database.ids.integer.DoubleIntegerDBIDArrayList
dists, ids, size
-
-
Constructor Summary
Constructors Constructor Description DoubleIntegerDBIDKNNList()Constructor.DoubleIntegerDBIDKNNList(int k, int size)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetK()Get the K parameter (note: this may be less than the size of the list!)doublegetKNNDistance()Get the distance to the k nearest neighbor, or infinity otherwise.KNNListmap(java.util.function.DoubleUnaryOperator f)Function to project the knn list.KNNListsubList(int k)Select a subset for a smaller k.java.lang.StringtoString()-
Methods inherited from class elki.database.ids.integer.DoubleIntegerDBIDArrayList
add, add, addInternal, assignVar, clear, contains, doubleValue, grow, iter, remove, removeSwap, reverse, size, slice, sort, sortDescending, swap, truncate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface elki.database.ids.DoubleDBIDList
assignVar, doubleValue, forEachDouble, size
-
Methods inherited from interface elki.database.ids.integer.DoubleIntegerDBIDList
iter, slice
-
-
-
-
Method Detail
-
getK
public int getK()
Description copied from interface:KNNListGet the K parameter (note: this may be less than the size of the list!)
-
getKNNDistance
public double getKNNDistance()
Description copied from interface:KNNListGet the distance to the k nearest neighbor, or infinity otherwise.- Specified by:
getKNNDistancein interfaceKNNList- Returns:
- Maximum distance
-
subList
public KNNList subList(int k)
Description copied from interface:KNNListSelect a subset for a smaller k.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classDoubleIntegerDBIDArrayList
-
-