D
- Distance typepublic interface KNNList<D extends Distance<D>> extends DistanceDBIDList<D>
for (DistanceDBIDResultIter<D> iter = result.iter(); iter.valid(); iter.advance()) {
// You can get the distance via: iter.getDistance();
// Or use iter just like any other DBIDRef
}
If you are only interested in the IDs of the objects, the following is also
sufficient:
for (DBIDIter<D> iter = result.iter(); iter.valid(); iter.advance()) {
// Use iter just like any other DBIDRef
}
Modifier and Type | Method and Description |
---|---|
DistanceDBIDPair<D> |
get(int index)
Direct object access.
|
int |
getK()
Get the K parameter (note: this may be less than the size of the list!)
|
D |
getKNNDistance()
Get the distance to the k nearest neighbor, or maxdist otherwise.
|
int |
size()
Size
|
iter
int size()
int getK()
DistanceDBIDPair<D> get(int index)
get
in interface DistanceDBIDList<D extends Distance<D>>
index
- D getKNNDistance()