public interface KNNList extends DoubleDBIDList
To iterate over the results, use the following code:
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
}
DoubleDBIDList.Consumer
Modifier and Type | Method and 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 |
subList(int k)
Select a subset for a smaller k.
|
assignVar, doubleValue, forEachDouble, iter, size, slice
int getK()
double getKNNDistance()
KNNList subList(int k)
k
- New kCopyright © 2019 ELKI Development Team. License information.