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, wait
slice
forEachDouble
private final int k
private final int size
private final IntegerDBIDKNNList inner
public IntegerDBIDKNNSubList(IntegerDBIDKNNList inner, int k)
inner
- Inner instancek
- k valuepublic int getK()
KNNList
public DBIDVar assignVar(int index, DBIDVar var)
DoubleDBIDList
index
.assignVar
in interface DoubleDBIDList
index
- Positionvar
- Variable to assign the value to.public double doubleValue(int index)
DoubleDBIDList
DoubleDBIDList.iter()
or DoubleDBIDList.assignVar(int, de.lmu.ifi.dbs.elki.database.ids.DBIDVar)
.doubleValue
in interface DoubleDBIDList
index
- Indexpublic double getKNNDistance()
KNNList
getKNNDistance
in interface KNNList
public IntegerDBIDKNNSubList.Itr iter()
DBIDs
Example:
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
DBID id = iter.getDBID();
}
iter
in interface DBIDs
iter
in interface DoubleDBIDList
iter
in interface DoubleIntegerDBIDList
iter
in interface IntegerDBIDs
public boolean contains(DBIDRef o)
DBIDs
public int size()
DBIDs
size
in interface DBIDs
size
in interface DoubleDBIDList
Copyright © 2019 ELKI Development Team. License information.