Package org.apache.commons.rng

This package contains the library's interface to be used by client code that needs a generator of sequences of pseudo-random numbers that are uniformly distributed in a specified range.

Jumpable Generators

Interfaces are specified for generators that are capable of advancing forward a large number of steps in the output period of the generator in a single jump. This can be used to create a series of non-overlapping generators for use in multithreaded applications.

Note that there is not a one-to-one relationship between the number of output random values from a provider and the number of steps from the underlying state cycle. This is due to:

  1. Possible use of rejection algorithms to output a random value using multiple values from the state cycle.
  2. The number of bits required to generate a random value differing from the number of bits generated by the underlying source of randomness. For example generation of a 64-bit long value using a 32-bit source of randomness.

Users are advised to use jumping generators with care to avoid overlapping output of multiple generators in parallel computations. A cautious approach is to use a jump distance far larger than the expected output length used by each generator.