docs: protected void computeLRDs(KNNQuery<O> knnq, DBIDs ids, WritableDoubleDataStore lrds) {
      FiniteProgress lrdsProgress = LOG.isVerbose() ? new FiniteProgress("LRD", ids.size(), LOG) : null;
      for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
        final KNNList neighbors = knnq.getKNNForDBID(iter, kreach);
        double sum = 0.0;
        int count = 0;
        for(DoubleDBIDListIter neighbor = neighbors.iter(); neighbor.valid(); neighbor.advance()) {
          if(DBIDUtil.equal(neighbor, iter)) {
            continue;
          }
          KNNList neighborsNeighbors = knnq.getKNNForDBID(neighbor, kreach);
          sum += MathUtil.max(neighbor.doubleValue(), neighborsNeighbors.getKNNDistance());
          count++;
        }
        // Avoid division by 0
        final double lrd = (sum > 0) ? (count / sum) : Double.POSITIVE_INFINITY;
        lrds.putDouble(iter, lrd);
        LOG.incrementProcessed(lrdsProgress);
      }
      LOG.ensureCompleted(lrdsProgress);
    }