Click or drag to resize

RandMT Class

32-bit implementation of the Mersenne Twister random number generator algorithm by Makoto Matsumoto and Takuji Nishimura.
Inheritance Hierarchy
SystemObject
  SystemRandom
    Orthogonal.Common.Basic.PRNGRandCustomBase
      Orthogonal.Common.Basic.PRNGRandMT

Namespace: Orthogonal.Common.Basic.PRNG
Assembly: Orthogonal.Common.Basic (in Orthogonal.Common.Basic.dll) Version: 2024-04-15 18:00 GMT+10.f27da1471008deaf16b803c17e24a5955690aef1
Syntax
C#
public class RandMT : RandCustomBase

The RandMT type exposes the following members.

Constructors
 NameDescription
Public methodRandMT Creates a random number generator with a random seed.
Public methodRandMT(Int32) Creates a random number generator seeded with a specified integer.
Public methodRandMT(Int32) Creates a random number generator seeded with a specified integer array.
Top
Methods
 NameDescription
Public methodNextDouble53This method was in the original C code. It is probably a cryptic way of combining two 32-bit numbers into a 64-bit number which then has 53 bits converted into a floating-point number so that all possible values can be produced. A shift-and-multiply is an easier way to do that. This method remains in the class as a reference.
Public methodNextInt64
(Overrides RandCustomBaseNextInt64)
Public methodRandUint32 Generates a random unsigned integer in the interval [0,0xFFFFFFFF]. This methods was a public function in the original C code, so it remains here as a reference. It is not part of the standard Random class interface.
Top
Remarks

Long running tests have observed the expected minimum values Next 0 (0x0) and Core 0.0 and the expected maximum Next 2147483646 (0x7FFFFFFE) from Core 0.999999999790607.

See Also