docs: public static <T> double[] crowdingDistance(
  		final Seq<? extends T> set,
  		final ElementComparator<? super T> comparator,
  		final ElementDistance<? super T> distance,
  		final ToIntFunction<? super T> dimension
  	) {
  		requireNonNull(set);
  		requireNonNull(comparator);
  		requireNonNull(distance);
  
  		final double[] result = new double[set.size()];
  		if (set.size() < 3) {
  			Arrays.fill(result, POSITIVE_INFINITY);
  		} else {
  			final int[] idx = new int[set.size()];
  			final IndexSorter sorter = IndexSorter.sorter(set.size());
  
  			for (int m = 0, d = dimension.applyAsInt(set.get(0)); m < d; ++m) {
  				sorter.sort(set, init(idx), comparator.ofIndex(m));
  
  				result[idx[0]] = POSITIVE_INFINITY;
  				result[idx[set.size() - 1]] = POSITIVE_INFINITY;
  
  				final T max = set.get(idx[0]);
  				final T min = set.get(idx[set.size() - 1]);
  				final double dm = distance.distance(max, min, m);
  
  				if (Double.compare(dm, 0) > 0) {
  					for (int i = 1, n = set.size() - 1; i < n; ++i) {
  						final double dist = distance.distance(
  							set.get(idx[i - 1]),
  							set.get(idx[i + 1]),
  							m
  						);
  
  						result[idx[i]] += dist/dm;
  					}
  				}
  			}
  		}
  
  		return result;
  	}