Mersenne Twister Constructor
Definition
Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
Overload List
Mersenne | Initializes a new instance of the MersenneTwister class using a time-dependent default seed value. |
Mersenne | Initializes a new instance of the MersenneTwister class using the specified seed value. |
Mersenne | Initializes a new instance of the MersenneTwister class using the specified seed array of seed values. |
MersenneTwister
Initializes a new instance of the MersenneTwister class
using a time-dependent default seed value.
public MersenneTwister()
Remarks
Although the seed value is time-dependent, it may not change fast enough to be different on successive invocations. To ensure two or more random sequences are different, provide different seed values explicitly.
MersenneTwister(Int32)
Initializes a new instance of the MersenneTwister class
using the specified seed value.
public MersenneTwister(
int seed
)
Parameters
- seed Int32
- A number used to calculate a starting value for the pseudo-random number sequence.
Remarks
Different seeds produce different random sequences. You can produce the same sequence repeatedly by providing the same seed value each time.
MersenneTwister(Int32[])
Initializes a new instance of the MersenneTwister class
using the specified seed array of seed values.
public MersenneTwister(
int[] seedArray
)
Parameters
- seedArray Int32[]
- An array of integers used to calculate a starting value for the pseudo-random number sequence.
Remarks
The maximum length of seedArray is 16383. All elements after the 16383rd element are ignored.
Different seeds produce different random sequences. You can produce the same sequence repeatedly by providing the same seed value each time.
Exceptions
Argument | seedArray is null. |