docs: public static <I extends ScoreIter> double computeDCG(Predicate<? super I> predicate, I iter) {
      double sum = 0.;
      int i = 0, positive = 0, tied = 0;
      while(iter.valid()) {
        // positive or negative match?
        do {
          if(predicate.test(iter)) {
            ++positive;
          }
          ++tied;
          ++i;
          iter.advance();
        } // Loop while tied:
        while(iter.valid() && iter.tiedToPrevious());
        // We only support binary labeling, and can ignore negative weight.
        if(positive > 0) {
          sum += tied == 1 ? 1. / FastMath.log(i + 1) : //
              DCGEvaluation.sumInvLog1p(i - tied + 1, i) * positive / (double) tied;
        }
        positive = 0;
        tied = 0;
      }
      return sum * MathUtil.LOG2; // Change base to log 2.
    }