Esempio n. 1
0
        void TestMrg32k3A()
        {
            var sw      = stopwatch();
            var rng     = Rng.Mrg32k3a();
            var min     = double.MaxValue;
            var max     = double.MinValue;
            var cycles  = Pow2.T08;
            var samples = Pow2.T17;

            for (var cycle = 0; cycle < cycles; cycle++)
            {
                for (var i = 0; i < samples; i++)
                {
                    var next = rng.Next();
                    if (next < min)
                    {
                        min = next;
                    }
                    if (next > max)
                    {
                        max = next;
                    }
                }
                print('.');
                if (cycle != 0 && cycle % 80 == 0)
                {
                    print();
                }
            }
            print();

            OpTime time = (cycles * samples, sw, "MRG32k3u");

            print($"Min = {min}, Max = {max}");
            print(time);
        }
Esempio n. 2
0
 public void bench_mrg32k3a_uniform_f64()
 {
     Benchmark(Rng.Mrg32k3a() as IPointSource <double>);
 }
Esempio n. 3
0
 public void bench_mrg32k3a_uniform_u32()
 {
     Benchmark(Rng.Mrg32k3a());
 }