@Test
public void testRepeatedValues() {
final Random gen = RandomUtils.getRandom();
// 5% of samples will be 0 or 1.0. 10% for each of the values 0.1 through 0.9
AbstractContinousDistribution mix = new AbstractContinousDistribution() {
@Override
public double nextDouble() {
return Math.rint(gen.nextDouble() * 10) / 10.0;
}
};
for (int run = 0; run < 3 * repeats(); run++) {
TDigest dist = new ArrayDigest(32, (double) 1000);
List<Double> data = Lists.newArrayList();
for (int i1 = 0; i1 < 100000; i1++) {
data.add(mix.nextDouble());
}
long t0 = System.nanoTime();
for (double x : data) {
dist.add(x);