/// <summary> /// Initializes a new instance of the <see cref="Xorshift"/> class using /// a seed based on time and unique GUIDs. /// </summary> /// <remarks>If the seed value is zero, it is set to one. Uses the /// value of <see cref="Control.ThreadSafeRandomNumberGenerators"/> to /// set whether the instance is thread safe. /// Uses the default values of: /// <list> /// <item>a = 916905990</item> /// <item>c = 13579</item> /// <item>X1 = 77465321</item> /// <item>X2 = 362436069</item> /// </list></remarks> public Xorshift() : this(RandomSeed.Robust()) { }
/// <summary> /// Initializes a new instance of the <see cref="Xorshift"/> class using /// a seed based on time and unique GUIDs. /// </summary> /// <param name="threadSafe">if set to <c>true</c> , the class is thread safe.</param> /// <remarks> /// Uses the default values of: /// <list> /// <item>a = 916905990</item> /// <item>c = 13579</item> /// <item>X1 = 77465321</item> /// <item>X2 = 362436069</item> /// </list></remarks> public Xorshift(bool threadSafe) : this(RandomSeed.Robust(), threadSafe) { }
/// <summary> /// Initializes a new instance of the <see cref="Xorshift"/> class using /// a seed based on time and unique GUIDs. /// </summary> /// <param name="threadSafe">if set to <c>true</c> , the class is thread safe.</param> /// <param name="a">The multiply value</param> /// <param name="c">The initial carry value.</param> /// <param name="x1">The initial value if X1.</param> /// <param name="x2">The initial value if X2.</param> /// <remarks><paramref name="c"/> must be less than <paramref name="a"/>.</remarks> public Xorshift(bool threadSafe, long a, long c, long x1, long x2) : this(RandomSeed.Robust(), threadSafe, a, c, x1, x2) { }
/// <summary> /// Initializes a new instance of the <see cref="Mcg31m1"/> class using /// a seed based on time and unique GUIDs. /// </summary> public Mcg31m1() : this(RandomSeed.Robust()) { }
/// <summary> /// Initializes a new instance of the <see cref="Xorshift"/> class using /// a seed based on time and unique GUIDs. /// </summary> /// <param name="a">The multiply value</param> /// <param name="c">The initial carry value.</param> /// <param name="x1">The initial value if X1.</param> /// <param name="x2">The initial value if X2.</param> /// <remarks>If the seed value is zero, it is set to one. Uses the /// value of <see cref="Control.ThreadSafeRandomNumberGenerators"/> to /// set whether the instance is thread safe. /// Note: <paramref name="c"/> must be less than <paramref name="a"/>. /// </remarks> public Xorshift(long a, long c, long x1, long x2) : this(RandomSeed.Robust(), a, c, x1, x2) { }
/// <summary> /// Initializes a new instance of the <see cref="WH1982"/> class using /// a seed based on time and unique GUIDs. /// </summary> public WH1982() : this(RandomSeed.Robust()) { }
/// <summary> /// Initializes a new instance of the <see cref="Mcg31m1"/> class using /// a seed based on time and unique GUIDs. /// </summary> /// <remarks>If the seed value is zero, it is set to one. Uses the /// value of <see cref="Control.ThreadSafeRandomNumberGenerators"/> to /// set whether the instance is thread safe.</remarks> public Mrg32k3a() : this(RandomSeed.Robust()) { }
/// <summary> /// Construct a new random number generator with a random seed. /// </summary> public SystemRandomSource() : this(RandomSeed.Robust()) { }
/// <summary> /// Construct a new random number generator with random seed. /// </summary> /// <param name="threadSafe">if set to <c>true</c> , the class is thread safe.</param> public SystemRandomSource(bool threadSafe) : this(RandomSeed.Robust(), threadSafe) { }
const double Reciprocal = 1.0 / 4294967296.0; // 1.0/(uint.MaxValue + 1.0) /// <summary> /// Initializes a new instance of the <see cref="Palf"/> class using /// a seed based on time and unique GUIDs. /// </summary> /// <remarks>If the seed value is zero, it is set to one. Uses the /// value of <see cref="Control.ThreadSafeRandomNumberGenerators"/> to /// set whether the instance is thread safe.</remarks> public Palf() : this(RandomSeed.Robust(), Control.ThreadSafeRandomNumberGenerators, DefaultShortLag, DefaultLongLag) { }
/// <summary> /// Initializes a new instance of the <see cref="Palf"/> class using /// a seed based on time and unique GUIDs. /// </summary> /// <param name="threadSafe">if set to <c>true</c> , the class is thread safe.</param> public Palf(bool threadSafe) : this(RandomSeed.Robust(), threadSafe, DefaultShortLag, DefaultLongLag) { }
/// <summary> /// Initializes a new instance of the <see cref="RandomSource"/> class. /// </summary> /// <param name="threadSafe">if set to <c>true</c> , the class is thread safe.</param> /// <remarks>Thread safe instances are two and half times slower than non-thread /// safe classes.</remarks> protected RandomSource(bool threadSafe) : base(RandomSeed.Robust()) { _threadSafe = threadSafe; }
/// <summary> /// Initializes a new instance of the <see cref="RandomSource"/> class using /// the value of <see cref="Control.ThreadSafeRandomNumberGenerators"/> to set whether /// the instance is thread safe or not. /// </summary> protected RandomSource() : base(RandomSeed.Robust()) { _threadSafe = Control.ThreadSafeRandomNumberGenerators; }
/// <summary> /// Initializes a new instance of the <see cref="Mcg31m1"/> class using /// a seed based on time and unique GUIDs. /// </summary> /// <param name="threadSafe">if set to <c>true</c> , the class is thread safe.</param> public Mcg31m1(bool threadSafe) : this(RandomSeed.Robust(), threadSafe) { }
/// <summary> /// Initializes a new instance of the <see cref="MersenneTwister"/> class using /// a seed based on time and unique GUIDs. /// </summary> /// <remarks>If the seed value is zero, it is set to one. Uses the /// value of <see cref="Control.ThreadSafeRandomNumberGenerators"/> to /// set whether the instance is thread safe.</remarks> public MersenneTwister() : this(RandomSeed.Robust()) { }
/// <summary> /// Construct a new random number generator with a random seed. /// </summary> public Xoshiro256StarStar() : this(RandomSeed.Robust()) { }
/// <summary> /// Initializes a new instance of the <see cref="MersenneTwister"/> class using /// a seed based on time and unique GUIDs. /// </summary> /// <param name="threadSafe">if set to <c>true</c> , the class is thread safe.</param> public MersenneTwister(bool threadSafe) : this(RandomSeed.Robust(), threadSafe) { }
/// <summary> /// Construct a new random number generator with random seed. /// </summary> /// <param name="threadSafe">if set to <c>true</c> , the class is thread safe.</param> public Xoshiro256StarStar(bool threadSafe) : this(RandomSeed.Robust(), threadSafe) { }
/// <summary> /// Initializes a new instance of the <see cref="WH1982"/> class using /// a seed based on time and unique GUIDs. /// </summary> /// <param name="threadSafe">if set to <c>true</c> , the class is thread safe.</param> public WH1982(bool threadSafe) : this(RandomSeed.Robust(), threadSafe) { }
/// <summary> /// Initializes a new instance of the <see cref="WH2006"/> class using /// a seed based on time and unique GUIDs. /// </summary> public WH2006() : this(RandomSeed.Robust()) { }
/// <summary> /// Initializes a new instance of the <see cref="Mcg31m1"/> class using /// a seed based on time and unique GUIDs. /// </summary> /// <param name="threadSafe">if set to <c>true</c> , the class is thread safe.</param> public Mrg32k3a(bool threadSafe) : this(RandomSeed.Robust(), threadSafe) { }
/// <summary> /// Initializes a new instance of the <see cref="Mcg59"/> class using /// a seed based on time and unique GUIDs. /// </summary> public Mcg59() : this(RandomSeed.Robust()) { }