Search in sources :

Example 11 with DoubleDBIDPair

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;
}
Also used : ModifiableDoubleDBIDList(de.lmu.ifi.dbs.elki.database.ids.ModifiableDoubleDBIDList) DoubleDBIDPair(de.lmu.ifi.dbs.elki.database.ids.DoubleDBIDPair)

Aggregations

DoubleDBIDPair (de.lmu.ifi.dbs.elki.database.ids.DoubleDBIDPair)11 DBIDIter (de.lmu.ifi.dbs.elki.database.ids.DBIDIter)6 DoubleDBIDListIter (de.lmu.ifi.dbs.elki.database.ids.DoubleDBIDListIter)5 ModifiableDoubleDBIDList (de.lmu.ifi.dbs.elki.database.ids.ModifiableDoubleDBIDList)5 DBIDs (de.lmu.ifi.dbs.elki.database.ids.DBIDs)4 ArrayModifiableDBIDs (de.lmu.ifi.dbs.elki.database.ids.ArrayModifiableDBIDs)3 HashSetModifiableDBIDs (de.lmu.ifi.dbs.elki.database.ids.HashSetModifiableDBIDs)3 KNNList (de.lmu.ifi.dbs.elki.database.ids.KNNList)3 ArrayList (java.util.ArrayList)3 ArrayDBIDs (de.lmu.ifi.dbs.elki.database.ids.ArrayDBIDs)2 SetDBIDs (de.lmu.ifi.dbs.elki.database.ids.SetDBIDs)2 DoubleDBIDList (de.lmu.ifi.dbs.elki.database.ids.DoubleDBIDList)1 KNNHeap (de.lmu.ifi.dbs.elki.database.ids.KNNHeap)1 ModifiableDBIDs (de.lmu.ifi.dbs.elki.database.ids.ModifiableDBIDs)1 StepProgress (de.lmu.ifi.dbs.elki.logging.progress.StepProgress)1 ObjectHeap (de.lmu.ifi.dbs.elki.utilities.datastructures.heap.ObjectHeap)1 TiedTopBoundedHeap (de.lmu.ifi.dbs.elki.utilities.datastructures.heap.TiedTopBoundedHeap)1 Iterator (java.util.Iterator)1 List (java.util.List)1 TreeSet (java.util.TreeSet)1