use of de.lmu.ifi.dbs.elki.database.ids.DoubleDBIDPair in project elki by elki-project.
the class MaterializeKNNAndRKNNPreprocessor method getRKNN.
/**
* Returns the materialized RkNNs of the specified id.
*
* @param id the query id
* @return the RkNNs
*/
public DoubleDBIDList getRKNN(DBIDRef id) {
TreeSet<DoubleDBIDPair> rKNN = materialized_RkNN.get(id);
if (rKNN == null) {
return null;
}
ModifiableDoubleDBIDList ret = DBIDUtil.newDistanceDBIDList(rKNN.size());
for (DoubleDBIDPair pair : rKNN) {
ret.add(pair);
}
ret.sort();
return ret;
}
Aggregations