@Test public void parallelMedian() { final Quantile quantile = IntStream.range(0, 1000) .asDoubleStream().parallel() .collect( Quantile::median, Quantile::accept, Quantile::combine); Assert.assertEquals(quantile.value(), floor(1000/2.0), 1.5); }
public double value() { return _q[2]; }
Quantile implements DoubleConsumer { public double value() { return _q[2]; } }
Quantile implements DoubleConsumer { public double value() { return _q[2]; } Quantile(final double quantile); }
Quantile implements DoubleConsumer { public double value() { return _q[2]; } Quantile(final double quantile); void reset(); double quantile(); double value(); long count(); @Override void accept(final double value); Quantile combine(final Quantile other); boolean sameState(final Quantile other); @Override String toString(); static Collector<T, ?, Quantile> toQuantile(
		final double quantile,
		final ToDoubleFunction<? super T> mapper
	); static Collector<T, ?, Quantile> toMedian(
		final ToDoubleFunction<? super T> mapper
	); }
Quantile implements DoubleConsumer { public double value() { return _q[2]; } Quantile(final double quantile); void reset(); double quantile(); double value(); long count(); @Override void accept(final double value); Quantile combine(final Quantile other); boolean sameState(final Quantile other); @Override String toString(); static Collector<T, ?, Quantile> toQuantile(
		final double quantile,
		final ToDoubleFunction<? super T> mapper
	); static Collector<T, ?, Quantile> toMedian(
		final ToDoubleFunction<? super T> mapper
	);  }