public static RandomVariateGenerator CreateNewPrng(GeneratorType generatorType, uint generatorSeed, uint seedIndex)
        {
            RandomVariateGenerator prng;

            switch (generatorType)
            {
            case GeneratorType.VANILLA:
                prng = DotNetVariateGenerator.CreateDotNetVariateGenerator(new[] { generatorSeed });
                break;

            case GeneratorType.RANDLIB:
                prng = RandLibVariateGenerator.CreateRandLibVariateGenerator(new [] { generatorSeed });
                break;

            case GeneratorType.PSEUDODES:
                prng = PseudoDesVariateGenerator.CreatePseudoDesVariateGenerator(new[] { generatorSeed, seedIndex });
                break;

            case GeneratorType.AESCOUNTER:
                prng = AesCounterVariateGenerator.CreateAesCounterVariateGenerator(new [] { generatorSeed, seedIndex });
                break;

            default:
                throw new ArgumentException($"Unknown/unsupported RNG type: {generatorType}");
            }

            return(prng);
        }
Exemple #2
0
        private const int SampleCount = 128 * 1048576;    // 128 * 2^20

        private DistributionSampler GetRandLibSampler()
        {
            DistributionSampler sampler = RandLibSampler.CreateRandLibSampler(RandLibVariateGenerator.CreateRandLibVariateGenerator(new uint[] { 20130110, 19680201 }));

            return(sampler);
        }