docs: private void computeVolumes(KNNQuery<O> knnq, int dim, DBIDs ids, WritableDoubleDataStore vols) {
      FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Volume", ids.size(), LOG) : null;
      double scaleconst = MathUtil.SQRTPI * FastMath.pow(GammaDistribution.gamma(1 + dim * .5), -1. / dim);
      boolean warned = false;
      double sum = 0.;
      for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
        double dk = knnq.getKNNForDBID(iter, k).getKNNDistance();
        double vol = dk > 0 ? MathUtil.powi(dk * scaleconst, dim) : 0.;
        if(vol == Double.POSITIVE_INFINITY && !warned) {
          LOG.warning("Variance of Volumes has hit double precision limits, results are not reliable.");
          warned = true;
        }
        vols.putDouble(iter, vol);
        sum += vol;
        LOG.incrementProcessed(prog);
      }
      double scaling = ids.size() / sum;
      for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
        vols.putDouble(iter, vols.doubleValue(iter) * scaling);
      }
      LOG.ensureCompleted(prog);
    }