Class UniformLongSampler.SmallRangeUniformLongSampler

    • Field Detail

      • n

        private final long n
        Maximum range of the sample (exclusive).
      • limit

        private final long limit
        Limit of the uniform range (inclusive) to sample a positive long. This is the largest positive multiple of n minus 1: floor(2^63 / n) * n - 1. The -1 changes the limit to an inclusive bound and allows support for a power of 2 range.
    • Constructor Detail

      • SmallRangeUniformLongSampler

        SmallRangeUniformLongSampler​(UniformRandomProvider rng,
                                     long range)
        Parameters:
        rng - Generator of uniformly distributed random numbers.
        range - Maximum range of the sample (exclusive).