示例#1
0
        public static IEnumerable <double> SampleBeta(this IPolyrand random, double trueCount, double falseCount)
        {
            var dist = new Dist.Beta(trueCount, falseCount);

            while (true)
            {
                yield return(dist.Sample(random));
            }
        }
示例#2
0
        public static IEnumerable <T> SampleBeta <T>(this IPolyrand random, T trueCount, T falseCount)
            where T : struct
        {
            var dist = new Dist.Beta(convert <T, double>(trueCount), convert <T, double>(falseCount));

            while (true)
            {
                yield return(As.generic <T>(dist.Sample(random)));
            }
        }