Class: MT19937

bit-generators.MT19937(seedopt)

Mersenne Twister MT19937 by Matsumoto and Nishimura (1998).

Seeding with a single integer in [0, 2^32) uses init_genrand, and seeding with an array uses init_by_array, exactly as numpy's legacy RandomState. Combined with the library's random, normal and exponential samplers this reproduces numpy's np.random.RandomState(seed) random_sample, standard_normal and standard_exponential streams bit for bit.

Constructor

new MT19937(seedopt)

Parameters:
Name Type Attributes Description
seed number | bigint | string | Array.<number> <optional>

Seed. Random if omitted.

Source: