diff --git a/FastRng/Double/Distributions/Beta.cs b/FastRng/Double/Distributions/BetaA2B2.cs similarity index 83% rename from FastRng/Double/Distributions/Beta.cs rename to FastRng/Double/Distributions/BetaA2B2.cs index 709ad93..88b0327 100644 --- a/FastRng/Double/Distributions/Beta.cs +++ b/FastRng/Double/Distributions/BetaA2B2.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; namespace FastRng.Double.Distributions { - public sealed class Beta : IDistribution + public sealed class BetaA2B2 : IDistribution { private const double ALPHA = 2; private const double BETA = 2; @@ -13,7 +13,7 @@ namespace FastRng.Double.Distributions private ShapeFitter fitter; private IRandom random; - public Beta() + public BetaA2B2() { } @@ -23,7 +23,7 @@ namespace FastRng.Double.Distributions set { this.random = value; - this.fitter = new ShapeFitter(Beta.ShapeFunction, this.random, 50, 0.99); + this.fitter = new ShapeFitter(BetaA2B2.ShapeFunction, this.random, 50, 0.99); } } diff --git a/FastRngTests/Double/Distributions/Beta.cs b/FastRngTests/Double/Distributions/Beta.cs index ad17463..36bff49 100644 --- a/FastRngTests/Double/Distributions/Beta.cs +++ b/FastRngTests/Double/Distributions/Beta.cs @@ -20,7 +20,7 @@ namespace FastRngTests.Double.Distributions const double MEAN = A / (A + B); const double VARIANCE = (A * B) / ((A + B) * (A + B) * (A + B + 1.0)); - var dist = new FastRng.Double.Distributions.Beta(); + var dist = new FastRng.Double.Distributions.BetaA2B2(); var stats = new RunningStatistics(); var rng = new MultiThreadedRng(); @@ -43,7 +43,7 @@ namespace FastRngTests.Double.Distributions var rng = new MultiThreadedRng(); var samples = new double[1_000]; for (var n = 0; n < samples.Length; n++) - samples[n] = await rng.NextNumber(-1.0, 1.0, new FastRng.Double.Distributions.Beta()); + samples[n] = await rng.NextNumber(-1.0, 1.0, new FastRng.Double.Distributions.BetaA2B2()); rng.StopProducer(); Assert.That(samples.Min(), Is.GreaterThanOrEqualTo(-1.0), "Min out of range"); @@ -58,7 +58,7 @@ namespace FastRngTests.Double.Distributions var rng = new MultiThreadedRng(); var samples = new double[1_000]; for (var n = 0; n < samples.Length; n++) - samples[n] = await rng.NextNumber(0.0, 1.0, new FastRng.Double.Distributions.Beta()); + samples[n] = await rng.NextNumber(0.0, 1.0, new FastRng.Double.Distributions.BetaA2B2()); rng.StopProducer(); Assert.That(samples.Min(), Is.GreaterThanOrEqualTo(0.0), "Min is out of range"); @@ -71,7 +71,7 @@ namespace FastRngTests.Double.Distributions public async Task TestBetaGeneratorWithRange03() { var rng = new MultiThreadedRng(); - var dist = new FastRng.Double.Distributions.Beta { Random = rng }; // Test default parameters + var dist = new FastRng.Double.Distributions.BetaA2B2 { Random = rng }; // Test default parameters var samples = new double[1_000]; for (var n = 0; n < samples.Length; n++) @@ -87,7 +87,7 @@ namespace FastRngTests.Double.Distributions [Category(TestCategories.NORMAL)] public async Task NoRandomNumberGenerator01() { - var dist = new FastRng.Double.Distributions.Beta(); + var dist = new FastRng.Double.Distributions.BetaA2B2(); Assert.DoesNotThrowAsync(async () => await dist.GetDistributedValue()); Assert.That(await dist.GetDistributedValue(), Is.NaN); }