Documentation
¶
Overview ¶
Package mt19937 implements 64-bit variant of Mersenne Twister pseudo-random number generator.
References:
M. Matsumoto and T. Nishimura, "Mersenne Twister: a 623-dimensionally equidistributed uniform pseudorandom number generator", ACM Transactions on Modeling and Computer Simulation 8. (Jan. 1998) 3--30.
http://www.math.sci.hiroshima-u.ac.jp/%7Em-mat/MT/emt64.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MT19937 ¶
type MT19937 struct {
// contains filtered or unexported fields
}
MT19937 implements the 64-bit variant of the Mersenne Twister algorithm based on the Mersenne prime 2^19937-1 as its period.
func New ¶
New returns a new instance of the MT19937 PRNG Engine. If the seed provided is 0, the engine is initialized with current time
func (*MT19937) Float64 ¶
Float64 returns a pseudo-random number in [0.0, 1.0) as a float64. Float64 advances the internal state of the engine.
func (*MT19937) Float64OO ¶
Float64OO returns a pseudo-random number in (0.0, 1.0) as a float64. Float6400 advances the internal state of the engine.
func (*MT19937) GetState ¶
GetState returns the internal state of the engine as []byte GetState can be used to save the state, e.g. to a file
func (*MT19937) Reset ¶
func (r *MT19937) Reset()
Reset reverts the internal state of the engine to its default state, except the seed
func (*MT19937) Seed ¶
Seed uses the provided value to initialize the engine If the seed provided is 0, the engine is initialized with current time