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) int
k
The 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 int
getK()
Get the K parameter (note: this may be less than the size of the list!)double
getKNNDistance()
Get the distance to the k nearest neighbor, or infinity otherwise.KNNList
map(java.util.function.DoubleUnaryOperator f)
Function to project the knn list.KNNList
subList(int k)
Select a subset for a smaller k.java.lang.String
toString()
-
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:KNNList
Get the K parameter (note: this may be less than the size of the list!)
-
getKNNDistance
public double getKNNDistance()
Description copied from interface:KNNList
Get the distance to the k nearest neighbor, or infinity otherwise.- Specified by:
getKNNDistance
in interfaceKNNList
- Returns:
- Maximum distance
-
subList
public KNNList subList(int k)
Description copied from interface:KNNList
Select a subset for a smaller k.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classDoubleIntegerDBIDArrayList
-
-