in src/main/java/org/apache/datasketches/characterization/quantiles/tdigest/DataGenerator.java [61:79]
public void fillArray(final double[] array) {
int i = 0;
int value = 1;
double p = 0.001; // starting probability of incrementing a value for Blocky mode
while (i < array.length) {
if (Mode.Gaussian.equals(mode)) {
array[i++] = rnd.nextGaussian();
} else if (Mode.Uniform.equals(mode)) {
array[i++] = rnd.nextDouble();
} else {
array[i++] = value;
// growing blocks of repeated values
if (Mode.Blocky.equals(mode) && (rnd.nextDouble() < p)) {
value++;
p *= .98; // decrease the probability slightly so that blocks get longer
}
}
}
}