Esempio n. 1
0
        public void MultiRandInt32()
        {
            var mr = Rng.SplitMix();
            var data = mr.Span <int>(Pow2.T23);
            int pos = 0, neg = 0, zed = 0;

            foreach (var x in data)
            {
                if (x > 0)
                {
                    pos++;
                }
                else if (x < 0)
                {
                    neg++;
                }
                else
                {
                    zed++;
                }
            }
            var r         = math.abs(pos - neg) / ((double)pos + (double)neg);
            var tolerance = .01;

            Claim.lt(r, tolerance);
        }
Esempio n. 2
0
        public void bench_splitmix_bernoulli_u64()
        {
            var gen     = Rng.SplitMix();
            var sampler = gen.Bernoulli <byte>(.35);

            Benchmark(sampler);
        }
Esempio n. 3
0
 public void bench_splitmix_uniform_f64()
 {
     Benchmark(Rng.SplitMix().PointSource <double>());
 }
Esempio n. 4
0
 void bench_splitmix_bitsource()
 {
     Benchmark(Rng.SplitMix().PointSource <ulong>().ToBitStream());
 }
Esempio n. 5
0
 public void bench_splitmix_bitstring()
 {
     Benchmark((Rng.SplitMix().BitStringSource((Pow2.T03, Pow2.T08))));
 }
Esempio n. 6
0
 public void bench_splitmix_uniform_u64()
 {
     Benchmark(Rng.SplitMix().PointSource <ulong>());
 }