Esempio n. 1
0
 /// <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())
 {
 }
Esempio n. 2
0
 /// <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)
 {
 }
Esempio n. 3
0
 /// <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)
 {
 }
Esempio n. 4
0
 /// <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())
 {
 }
Esempio n. 5
0
 /// <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)
 {
 }
Esempio n. 6
0
 /// <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())
 {
 }
Esempio n. 7
0
 /// <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())
 {
 }
Esempio n. 8
0
 /// <summary>
 /// Construct a new random number generator with a random seed.
 /// </summary>
 public SystemRandomSource() : this(RandomSeed.Robust())
 {
 }
Esempio n. 9
0
 /// <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)
 {
 }
Esempio n. 10
0
        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)
        {
        }
Esempio n. 11
0
 /// <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)
 {
 }
Esempio n. 12
0
 /// <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;
 }
Esempio n. 13
0
 /// <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;
 }
Esempio n. 14
0
 /// <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)
 {
 }
Esempio n. 15
0
 /// <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())
 {
 }
Esempio n. 16
0
 /// <summary>
 /// Construct a new random number generator with a random seed.
 /// </summary>
 public Xoshiro256StarStar() : this(RandomSeed.Robust())
 {
 }
Esempio n. 17
0
 /// <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)
 {
 }
Esempio n. 18
0
 /// <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)
 {
 }
Esempio n. 19
0
 /// <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)
 {
 }
Esempio n. 20
0
 /// <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())
 {
 }
Esempio n. 21
0
 /// <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)
 {
 }
Esempio n. 22
0
 /// <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())
 {
 }