docs: protected double computeLRD(KNNQuery<O> knnq, DBIDIter curr) {
      final KNNList neighbors = knnq.getKNNForDBID(curr, k);
      double sum = 0.0;
      int count = 0;
      for(DoubleDBIDListIter neighbor = neighbors.iter(); neighbor.valid(); neighbor.advance()) {
        if(DBIDUtil.equal(curr, neighbor)) {
          continue;
        }
        KNNList neighborsNeighbors = knnq.getKNNForDBID(neighbor, k);
        sum += MathUtil.max(neighbor.doubleValue(), neighborsNeighbors.getKNNDistance());
        count++;
      }
      // Avoid division by 0
      return (sum > 0) ? (count / sum) : Double.POSITIVE_INFINITY;
    }