private void doReverseKNN(RdKNNNode node,DBID oid,ModifiableDoubleDBIDList result){
  if (node.isLeaf()) {
    for (int i=0; i < node.getNumEntries(); i++) {
      RdKNNLeafEntry entry=(RdKNNLeafEntry)node.getEntry(i);
      double distance=distanceQuery.distance(entry.getDBID(),oid);
      if (distance <= entry.getKnnDistance()) {
        result.add(distance,entry.getDBID());
      }
    }
  }
 else {
    for (int i=0; i < node.getNumEntries(); i++) {
      RdKNNDirectoryEntry entry=(RdKNNDirectoryEntry)node.getEntry(i);
      double minDist=distanceQuery.minDist(entry,oid);
      if (minDist <= entry.getKnnDistance()) {
        doReverseKNN(getNode(entry),oid,result);
      }
    }
  }
}

private void doReverseKNN ( RdKNNNode node , DBID oid , ModifiableDoubleDBIDList result ) { if ( node . isLeaf ( ) ) { for ( int i = 0 ; i < node . getNumEntries ( ) ; i ++ ) { RdKNNLeafEntry entry = ( RdKNNLeafEntry ) node . getEntry ( i ) ; double distance = distanceQuery . distance ( entry . getDBID ( ) , oid ) ; if ( distance <= entry . getKnnDistance ( ) ) { result . add ( distance , entry . getDBID ( ) ) ; } } } else { for ( int i = 0 ; i < node . getNumEntries ( ) ; i ++ ) { RdKNNDirectoryEntry entry = ( RdKNNDirectoryEntry ) node . getEntry ( i ) ; double minDist = distanceQuery . minDist ( entry , oid ) ; if ( minDist <= entry . getKnnDistance ( ) ) { doReverseKNN ( getNode ( entry ) , oid , result ) ; } } } }
performs a reverse knn query in the specified subtree .
