public class IntegerDBIDKNNSubList extends java.lang.Object implements IntegerDBIDKNNList
| Modifier and Type | Class and Description |
|---|---|
private class |
IntegerDBIDKNNSubList.Itr
Iterator for the sublist.
|
DoubleDBIDList.Consumer| Modifier and Type | Field and Description |
|---|---|
private IntegerDBIDKNNList |
inner
Wrapped inner result.
|
private int |
k
Parameter k.
|
private int |
size
Actual size, including ties.
|
| Constructor and Description |
|---|
IntegerDBIDKNNSubList(IntegerDBIDKNNList inner,
int k)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
DBIDVar |
assignVar(int index,
DBIDVar var)
Assign a DBID variable the value of position
index. |
boolean |
contains(DBIDRef o)
Test whether an ID is contained.
|
double |
doubleValue(int index)
Get the double value at a given index (to access the DBID, either use
DoubleDBIDList.iter() or DoubleDBIDList.assignVar(int, de.lmu.ifi.dbs.elki.database.ids.DBIDVar). |
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.
|
IntegerDBIDKNNSubList.Itr |
iter()
Get a DBID iterator (a more efficient API).
|
int |
size()
Retrieve the collection / data size.
|
KNNList |
subList(int k)
Select a subset for a smaller k.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsliceforEachDoubleprivate final int k
private final int size
private final IntegerDBIDKNNList inner
public IntegerDBIDKNNSubList(IntegerDBIDKNNList inner, int k)
inner - Inner instancek - k valuepublic int getK()
KNNListpublic DBIDVar assignVar(int index, DBIDVar var)
DoubleDBIDListindex.assignVar in interface DoubleDBIDListindex - Positionvar - Variable to assign the value to.public double doubleValue(int index)
DoubleDBIDListDoubleDBIDList.iter() or DoubleDBIDList.assignVar(int, de.lmu.ifi.dbs.elki.database.ids.DBIDVar).doubleValue in interface DoubleDBIDListindex - Indexpublic double getKNNDistance()
KNNListgetKNNDistance in interface KNNListpublic IntegerDBIDKNNSubList.Itr iter()
DBIDsExample:
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
DBID id = iter.getDBID();
}
iter in interface DBIDsiter in interface DoubleDBIDListiter in interface DoubleIntegerDBIDListiter in interface IntegerDBIDspublic boolean contains(DBIDRef o)
DBIDspublic int size()
DBIDssize in interface DBIDssize in interface DoubleDBIDListCopyright © 2019 ELKI Development Team. License information.