public void fillArray()

in src/main/java/org/apache/datasketches/characterization/quantiles/tdigest/DataGenerator.java [41:59]


  public void fillArray(final float[] array) {
    int i = 0;
    int value = 1;
    double p = PROBABILITY_OF_INCREMENT;
    while (i < array.length) {
      if (Mode.Gaussian.equals(mode)) {
        array[i++] = (float) rnd.nextGaussian();
      } else if (Mode.Uniform.equals(mode)) {
        array[i++] = rnd.nextFloat();
      } else {
        array[i++] = value;
        // growing blocks of repeated values
        if (Mode.Blocky.equals(mode) && (rnd.nextDouble() < p)) {
          value++;
          p *= DECREASE_FACTOR; // decrease the probability slightly so that blocks get longer
        }
      }
    }
  }