
public class DoubleDistanceDBIDPairKNNList extends Object implements DoubleDistanceKNNList
| Modifier and Type | Class and Description |
|---|---|
private class |
DoubleDistanceDBIDPairKNNList.Itr
Iterator.
|
| Modifier and Type | Field and Description |
|---|---|
private DoubleDistanceDBIDPair[] |
data
The actual data array.
|
private int |
k
The value of k this was materialized for.
|
| Modifier | Constructor and Description |
|---|---|
|
DoubleDistanceDBIDPairKNNList(Collection<DoubleDistanceDBIDPair> col,
int k)
Constructor.
|
protected |
DoubleDistanceDBIDPairKNNList(DoubleDistanceDBIDPairKNNHeap heap)
Constructor, to be called from KNNHeap only.
|
|
DoubleDistanceDBIDPairKNNList(Heap<DoubleDistanceDBIDPair> heap,
int k)
Constructor, to be called from KNNHeap only.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(DBIDRef o)
Test whether an ID is contained.
|
double |
doubleKNNDistance()
Get the kNN distance as double value.
|
DoubleDistanceDBIDPair |
get(int index)
Direct object access.
|
int |
getK()
Get the K parameter (note: this may be less than the size of the list!)
|
DoubleDistance |
getKNNDistance()
Deprecated.
|
boolean |
isEmpty()
Test for an empty DBID collection.
|
DoubleDistanceDBIDListIter |
iter()
Get an iterator
|
int |
size()
Size
|
String |
toString() |
private final int k
private final DoubleDistanceDBIDPair[] data
public DoubleDistanceDBIDPairKNNList(Collection<DoubleDistanceDBIDPair> col, int k)
col - Existing collectionk - K parameterprotected DoubleDistanceDBIDPairKNNList(DoubleDistanceDBIDPairKNNHeap heap)
KNNHeap.toKNNList()
instead!heap - Calling heappublic DoubleDistanceDBIDPairKNNList(Heap<DoubleDistanceDBIDPair> heap, int k)
KNNHeap.toKNNList()
instead!heap - Calling heapk - Target number of neighbors (before ties)public int getK()
KNNListgetK in interface KNNList<DoubleDistance>@Deprecated public DoubleDistance getKNNDistance()
DoubleDistanceKNNListgetKNNDistance in interface DoubleDistanceKNNListgetKNNDistance in interface KNNList<DoubleDistance>public double doubleKNNDistance()
DoubleDistanceKNNListdoubleKNNDistance in interface DoubleDistanceKNNListpublic DoubleDistanceDBIDPair get(int index)
KNNListget in interface DistanceDBIDList<DoubleDistance>get in interface DoubleDistanceKNNListget in interface KNNList<DoubleDistance>index - Offsetpublic DoubleDistanceDBIDListIter iter()
DistanceDBIDListiter in interface DBIDsiter in interface DistanceDBIDList<DoubleDistance>iter in interface DoubleDistanceKNNListpublic int size()
KNNListsize in interface DBIDssize in interface DistanceDBIDList<DoubleDistance>size in interface KNNList<DoubleDistance>public boolean contains(DBIDRef o)
DBIDs