docs: protected static <A> double[] ranks(final NumberArrayAdapter<?, A> adapter, final A data, int[] idx) {
      final int len = idx.length;
      double[] ret = new double[len];
      for(int i = 0; i < len;) {
        final int start = i++;
        final double val = adapter.getDouble(data, idx[start]);
        // Include ties:
        while(i < len && adapter.getDouble(data, idx[i]) <= val) {
          i++;
        }
        final double score = (start + i - 1) * .5 + 1;
        for(int j = start; j < i; j++) {
          ret[idx[j]] = score;
        }
      }
      return ret;
    }