From 6b8a27b56592be2fdc8f495ba9e39ec2aa60658c Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sun, 8 Nov 2020 16:23:05 +0100 Subject: [PATCH] Made shape function private --- FastRng/Double/Distributions/BetaA2B2.cs | 4 ++-- FastRng/Double/Distributions/BetaA2B5.cs | 4 ++-- FastRng/Double/Distributions/BetaA5B2.cs | 4 ++-- FastRng/Double/Distributions/CauchyLorentzX0.cs | 4 ++-- FastRng/Double/Distributions/CauchyLorentzX1.cs | 4 ++-- FastRng/Double/Distributions/ChiSquareK1.cs | 4 ++-- FastRng/Double/Distributions/ChiSquareK10.cs | 2 +- FastRng/Double/Distributions/ChiSquareK4.cs | 2 +- FastRng/Double/Distributions/Distribution.cs | 2 +- FastRng/Double/Distributions/ExponentialLa10.cs | 4 ++-- FastRng/Double/Distributions/ExponentialLa5.cs | 4 ++-- FastRng/Double/Distributions/GammaA5B15.cs | 2 +- FastRng/Double/Distributions/InverseExponentialLa10.cs | 4 ++-- FastRng/Double/Distributions/InverseExponentialLa5.cs | 4 ++-- FastRng/Double/Distributions/InverseGammaA3B05.cs | 2 +- FastRng/Double/Distributions/LaplaceB01M0.cs | 2 +- FastRng/Double/Distributions/LaplaceB01M05.cs | 2 +- FastRng/Double/Distributions/LogNormalS1M0.cs | 2 +- FastRng/Double/Distributions/NormalS02M05.cs | 4 ++-- FastRng/Double/Distributions/StudentTNu1.cs | 2 +- FastRng/Double/Distributions/WeibullK05La1.cs | 4 ++-- FastRng/Float/Distributions/BetaA2B2.cs | 4 ++-- FastRng/Float/Distributions/BetaA2B5.cs | 4 ++-- FastRng/Float/Distributions/BetaA5B2.cs | 2 +- FastRng/Float/Distributions/CauchyLorentzX0.cs | 4 ++-- FastRng/Float/Distributions/CauchyLorentzX1.cs | 4 ++-- FastRng/Float/Distributions/ChiSquareK1.cs | 2 +- FastRng/Float/Distributions/ChiSquareK10.cs | 2 +- FastRng/Float/Distributions/ChiSquareK4.cs | 2 +- FastRng/Float/Distributions/Distribution.cs | 2 +- FastRng/Float/Distributions/ExponentialLa10.cs | 4 ++-- FastRng/Float/Distributions/ExponentialLa5.cs | 4 ++-- FastRng/Float/Distributions/GammaA5B15.cs | 4 ++-- FastRng/Float/Distributions/InverseExponentialLa10.cs | 4 ++-- FastRng/Float/Distributions/InverseExponentialLa5.cs | 4 ++-- FastRng/Float/Distributions/InverseGammaA3B05.cs | 2 +- FastRng/Float/Distributions/LaplaceB01M0.cs | 2 +- FastRng/Float/Distributions/LaplaceB01M05.cs | 2 +- FastRng/Float/Distributions/LogNormalS1M0.cs | 2 +- FastRng/Float/Distributions/NormalS02M05.cs | 4 ++-- FastRng/Float/Distributions/StudentTNu1.cs | 2 +- FastRng/Float/Distributions/WeibullK05La1.cs | 4 ++-- 42 files changed, 65 insertions(+), 65 deletions(-) diff --git a/FastRng/Double/Distributions/BetaA2B2.cs b/FastRng/Double/Distributions/BetaA2B2.cs index 5ae8cbb..b1d6c26 100644 --- a/FastRng/Double/Distributions/BetaA2B2.cs +++ b/FastRng/Double/Distributions/BetaA2B2.cs @@ -13,7 +13,7 @@ namespace FastRng.Double.Distributions public BetaA2B2(IRandom rng) : base(rng) { } - - protected override double ShapeFunction(double x) => CONSTANT * Math.Pow(x, ALPHA - 1) * Math.Pow(1 - x, BETA - 1); + + private protected override double ShapeFunction(double x) => CONSTANT * Math.Pow(x, ALPHA - 1) * Math.Pow(1 - x, BETA - 1); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/BetaA2B5.cs b/FastRng/Double/Distributions/BetaA2B5.cs index ea21505..e7d4677 100644 --- a/FastRng/Double/Distributions/BetaA2B5.cs +++ b/FastRng/Double/Distributions/BetaA2B5.cs @@ -13,7 +13,7 @@ namespace FastRng.Double.Distributions public BetaA2B5(IRandom rng) : base(rng) { } - - protected override double ShapeFunction(double x) => CONSTANT * Math.Pow(x, ALPHA - 1) * Math.Pow(1 - x, BETA - 1); + + private protected override double ShapeFunction(double x) => CONSTANT * Math.Pow(x, ALPHA - 1) * Math.Pow(1 - x, BETA - 1); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/BetaA5B2.cs b/FastRng/Double/Distributions/BetaA5B2.cs index b460a8f..a7613e9 100644 --- a/FastRng/Double/Distributions/BetaA5B2.cs +++ b/FastRng/Double/Distributions/BetaA5B2.cs @@ -13,7 +13,7 @@ namespace FastRng.Double.Distributions public BetaA5B2(IRandom rng) : base(rng) { } - - protected override double ShapeFunction(double x) => CONSTANT * Math.Pow(x, ALPHA - 1) * Math.Pow(1 - x, BETA - 1); + + private protected override double ShapeFunction(double x) => CONSTANT * Math.Pow(x, ALPHA - 1) * Math.Pow(1 - x, BETA - 1); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/CauchyLorentzX0.cs b/FastRng/Double/Distributions/CauchyLorentzX0.cs index fa638ae..c19851b 100644 --- a/FastRng/Double/Distributions/CauchyLorentzX0.cs +++ b/FastRng/Double/Distributions/CauchyLorentzX0.cs @@ -13,7 +13,7 @@ namespace FastRng.Double.Distributions public CauchyLorentzX0(IRandom rng) : base(rng) { } - - protected override double ShapeFunction(double x) => CONSTANT * (1.0 / (Math.PI * SCALE)) * ((SCALE * SCALE) / (Math.Pow(x - MEDIAN, 2) + (SCALE * SCALE))); + + private protected override double ShapeFunction(double x) => CONSTANT * (1.0 / (Math.PI * SCALE)) * ((SCALE * SCALE) / (Math.Pow(x - MEDIAN, 2) + (SCALE * SCALE))); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/CauchyLorentzX1.cs b/FastRng/Double/Distributions/CauchyLorentzX1.cs index bd8b120..acb2151 100644 --- a/FastRng/Double/Distributions/CauchyLorentzX1.cs +++ b/FastRng/Double/Distributions/CauchyLorentzX1.cs @@ -13,7 +13,7 @@ namespace FastRng.Double.Distributions public CauchyLorentzX1(IRandom rng) : base(rng) { } - - protected override double ShapeFunction(double x) => CONSTANT * (1.0 / (Math.PI * SCALE)) * ((SCALE * SCALE) / (Math.Pow(x - MEDIAN, 2) + (SCALE * SCALE))); + + private protected override double ShapeFunction(double x) => CONSTANT * (1.0 / (Math.PI * SCALE)) * ((SCALE * SCALE) / (Math.Pow(x - MEDIAN, 2) + (SCALE * SCALE))); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/ChiSquareK1.cs b/FastRng/Double/Distributions/ChiSquareK1.cs index 92fb17a..3290765 100644 --- a/FastRng/Double/Distributions/ChiSquareK1.cs +++ b/FastRng/Double/Distributions/ChiSquareK1.cs @@ -23,7 +23,7 @@ namespace FastRng.Double.Distributions public ChiSquareK1(IRandom rng) : base(rng) { } - - protected override double ShapeFunction(double x) => CONSTANT * ((Math.Pow(x, K_HALF_MINUS_ONE) * Math.Exp(-x * 0.5d)) / DIVISOR); + + private protected override double ShapeFunction(double x) => CONSTANT * ((Math.Pow(x, K_HALF_MINUS_ONE) * Math.Exp(-x * 0.5d)) / DIVISOR); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/ChiSquareK10.cs b/FastRng/Double/Distributions/ChiSquareK10.cs index b6dbf62..d13cf44 100644 --- a/FastRng/Double/Distributions/ChiSquareK10.cs +++ b/FastRng/Double/Distributions/ChiSquareK10.cs @@ -24,6 +24,6 @@ namespace FastRng.Double.Distributions { } - protected override double ShapeFunction(double x) => CONSTANT * ((Math.Pow(x, K_HALF_MINUS_ONE) * Math.Exp(-x * 0.5d)) / DIVISOR); + private protected override double ShapeFunction(double x) => CONSTANT * ((Math.Pow(x, K_HALF_MINUS_ONE) * Math.Exp(-x * 0.5d)) / DIVISOR); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/ChiSquareK4.cs b/FastRng/Double/Distributions/ChiSquareK4.cs index 9f5aff4..1f854b5 100644 --- a/FastRng/Double/Distributions/ChiSquareK4.cs +++ b/FastRng/Double/Distributions/ChiSquareK4.cs @@ -24,6 +24,6 @@ namespace FastRng.Double.Distributions { } - protected override double ShapeFunction(double x) => CONSTANT * ((Math.Pow(x, K_HALF_MINUS_ONE) * Math.Exp(-x * 0.5d)) / DIVISOR); + private protected override double ShapeFunction(double x) => CONSTANT * ((Math.Pow(x, K_HALF_MINUS_ONE) * Math.Exp(-x * 0.5d)) / DIVISOR); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/Distribution.cs b/FastRng/Double/Distributions/Distribution.cs index 80c5c67..8de07c5 100644 --- a/FastRng/Double/Distributions/Distribution.cs +++ b/FastRng/Double/Distributions/Distribution.cs @@ -18,7 +18,7 @@ namespace FastRng.Double.Distributions this.fitter = new ShapeFitter(this.ShapeFunction, this.random, 100); } - protected abstract double ShapeFunction(double x); + private protected abstract double ShapeFunction(double x); public async ValueTask GetDistributedValue(CancellationToken token = default) => await this.fitter.NextNumber(token); diff --git a/FastRng/Double/Distributions/ExponentialLa10.cs b/FastRng/Double/Distributions/ExponentialLa10.cs index eae90e4..cb1d736 100644 --- a/FastRng/Double/Distributions/ExponentialLa10.cs +++ b/FastRng/Double/Distributions/ExponentialLa10.cs @@ -12,7 +12,7 @@ namespace FastRng.Double.Distributions public ExponentialLa10(IRandom rng) : base(rng) { } - - protected override double ShapeFunction(double x) => CONSTANT * LAMBDA * Math.Exp(-LAMBDA * x); + + private protected override double ShapeFunction(double x) => CONSTANT * LAMBDA * Math.Exp(-LAMBDA * x); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/ExponentialLa5.cs b/FastRng/Double/Distributions/ExponentialLa5.cs index dc59a19..29151de 100644 --- a/FastRng/Double/Distributions/ExponentialLa5.cs +++ b/FastRng/Double/Distributions/ExponentialLa5.cs @@ -12,7 +12,7 @@ namespace FastRng.Double.Distributions public ExponentialLa5(IRandom rng) : base(rng) { } - - protected override double ShapeFunction(double x) => CONSTANT * LAMBDA * Math.Exp(-LAMBDA * x); + + private protected override double ShapeFunction(double x) => CONSTANT * LAMBDA * Math.Exp(-LAMBDA * x); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/GammaA5B15.cs b/FastRng/Double/Distributions/GammaA5B15.cs index 7cd149c..3a48a2d 100644 --- a/FastRng/Double/Distributions/GammaA5B15.cs +++ b/FastRng/Double/Distributions/GammaA5B15.cs @@ -23,6 +23,6 @@ namespace FastRng.Double.Distributions { } - protected override double ShapeFunction(double x) => CONSTANT * ((BETA_TO_THE_ALPHA * Math.Pow(x, ALPHA - 1.0d) * Math.Exp(-BETA * x)) / GAMMA_ALPHA); + private protected override double ShapeFunction(double x) => CONSTANT * ((BETA_TO_THE_ALPHA * Math.Pow(x, ALPHA - 1.0d) * Math.Exp(-BETA * x)) / GAMMA_ALPHA); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/InverseExponentialLa10.cs b/FastRng/Double/Distributions/InverseExponentialLa10.cs index edb1d97..f32e45a 100644 --- a/FastRng/Double/Distributions/InverseExponentialLa10.cs +++ b/FastRng/Double/Distributions/InverseExponentialLa10.cs @@ -12,7 +12,7 @@ namespace FastRng.Double.Distributions public InverseExponentialLa10(IRandom rng) : base(rng) { } - - protected override double ShapeFunction(double x) => CONSTANT * LAMBDA * Math.Exp(LAMBDA * x); + + private protected override double ShapeFunction(double x) => CONSTANT * LAMBDA * Math.Exp(LAMBDA * x); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/InverseExponentialLa5.cs b/FastRng/Double/Distributions/InverseExponentialLa5.cs index d4e753a..526c0e8 100644 --- a/FastRng/Double/Distributions/InverseExponentialLa5.cs +++ b/FastRng/Double/Distributions/InverseExponentialLa5.cs @@ -12,7 +12,7 @@ namespace FastRng.Double.Distributions public InverseExponentialLa5(IRandom rng) : base(rng) { } - - protected override double ShapeFunction(double x) => CONSTANT * LAMBDA * Math.Exp(LAMBDA * x); + + private protected override double ShapeFunction(double x) => CONSTANT * LAMBDA * Math.Exp(LAMBDA * x); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/InverseGammaA3B05.cs b/FastRng/Double/Distributions/InverseGammaA3B05.cs index 1cf142a..d278d57 100644 --- a/FastRng/Double/Distributions/InverseGammaA3B05.cs +++ b/FastRng/Double/Distributions/InverseGammaA3B05.cs @@ -24,6 +24,6 @@ namespace FastRng.Double.Distributions { } - protected override double ShapeFunction(double x) => FACTOR_LEFT * Math.Pow(x, -ALPHA - 1.0d) * Math.Exp(-BETA / x); + private protected override double ShapeFunction(double x) => FACTOR_LEFT * Math.Pow(x, -ALPHA - 1.0d) * Math.Exp(-BETA / x); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/LaplaceB01M0.cs b/FastRng/Double/Distributions/LaplaceB01M0.cs index 3f1cdae..2c37119 100644 --- a/FastRng/Double/Distributions/LaplaceB01M0.cs +++ b/FastRng/Double/Distributions/LaplaceB01M0.cs @@ -21,6 +21,6 @@ namespace FastRng.Double.Distributions { } - protected override double ShapeFunction(double x) => FACTOR_LEFT * Math.Exp(-Math.Abs(x - MU) / B); + private protected override double ShapeFunction(double x) => FACTOR_LEFT * Math.Exp(-Math.Abs(x - MU) / B); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/LaplaceB01M05.cs b/FastRng/Double/Distributions/LaplaceB01M05.cs index 12c257e..4cb55d6 100644 --- a/FastRng/Double/Distributions/LaplaceB01M05.cs +++ b/FastRng/Double/Distributions/LaplaceB01M05.cs @@ -21,6 +21,6 @@ namespace FastRng.Double.Distributions { } - protected override double ShapeFunction(double x) => FACTOR_LEFT * Math.Exp(-Math.Abs(x - MU) / B); + private protected override double ShapeFunction(double x) => FACTOR_LEFT * Math.Exp(-Math.Abs(x - MU) / B); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/LogNormalS1M0.cs b/FastRng/Double/Distributions/LogNormalS1M0.cs index 371f050..e25dfe4 100644 --- a/FastRng/Double/Distributions/LogNormalS1M0.cs +++ b/FastRng/Double/Distributions/LogNormalS1M0.cs @@ -21,6 +21,6 @@ namespace FastRng.Double.Distributions { } - protected override double ShapeFunction(double x) => (CONSTANT / (x * FACTOR)) * Math.Exp( -(Math.Pow(Math.Log(x) - MU, 2) / (2 * Math.Pow(SIGMA, 2)))); + private protected override double ShapeFunction(double x) => (CONSTANT / (x * FACTOR)) * Math.Exp( -(Math.Pow(Math.Log(x) - MU, 2) / (2 * Math.Pow(SIGMA, 2)))); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/NormalS02M05.cs b/FastRng/Double/Distributions/NormalS02M05.cs index c6e7418..6e0386b 100644 --- a/FastRng/Double/Distributions/NormalS02M05.cs +++ b/FastRng/Double/Distributions/NormalS02M05.cs @@ -14,7 +14,7 @@ namespace FastRng.Double.Distributions public NormalS02M05(IRandom rng) : base(rng) { } - - protected override double ShapeFunction(double x) => 1.0 / (STDDEV * SQRT_2_PI) * Math.Exp(-0.5 * Math.Pow((x - MEAN) / STDDEV, 2.0)); + + private protected override double ShapeFunction(double x) => 1.0 / (STDDEV * SQRT_2_PI) * Math.Exp(-0.5 * Math.Pow((x - MEAN) / STDDEV, 2.0)); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/StudentTNu1.cs b/FastRng/Double/Distributions/StudentTNu1.cs index d047406..e490618 100644 --- a/FastRng/Double/Distributions/StudentTNu1.cs +++ b/FastRng/Double/Distributions/StudentTNu1.cs @@ -26,6 +26,6 @@ namespace FastRng.Double.Distributions { } - protected override double ShapeFunction(double x) => CONSTANT * Math.Pow((DIVIDEND / DIVISOR) * Math.Pow(1.0d + Math.Pow(START + x * COMPRESS, 2) / NU, EXPONENT), COMPRESS); + private protected override double ShapeFunction(double x) => CONSTANT * Math.Pow((DIVIDEND / DIVISOR) * Math.Pow(1.0d + Math.Pow(START + x * COMPRESS, 2) / NU, EXPONENT), COMPRESS); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/WeibullK05La1.cs b/FastRng/Double/Distributions/WeibullK05La1.cs index 5fc3191..c68a706 100644 --- a/FastRng/Double/Distributions/WeibullK05La1.cs +++ b/FastRng/Double/Distributions/WeibullK05La1.cs @@ -13,7 +13,7 @@ namespace FastRng.Double.Distributions public WeibullK05La1(IRandom rng) : base(rng) { } - - protected override double ShapeFunction(double x) => CONSTANT * ( (K / LAMBDA) * Math.Pow(x / LAMBDA, K - 1.0d) * Math.Exp(-Math.Pow(x/LAMBDA, K))); + + private protected override double ShapeFunction(double x) => CONSTANT * ( (K / LAMBDA) * Math.Pow(x / LAMBDA, K - 1.0d) * Math.Exp(-Math.Pow(x/LAMBDA, K))); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/BetaA2B2.cs b/FastRng/Float/Distributions/BetaA2B2.cs index 98f5db4..4b32c56 100644 --- a/FastRng/Float/Distributions/BetaA2B2.cs +++ b/FastRng/Float/Distributions/BetaA2B2.cs @@ -11,7 +11,7 @@ namespace FastRng.Float.Distributions public BetaA2B2(IRandom rng) : base(rng) { } - - protected override float ShapeFunction(float x) => CONSTANT * MathF.Pow(x, ALPHA - 1f) * MathF.Pow(1f - x, BETA - 1f); + + private protected override float ShapeFunction(float x) => CONSTANT * MathF.Pow(x, ALPHA - 1f) * MathF.Pow(1f - x, BETA - 1f); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/BetaA2B5.cs b/FastRng/Float/Distributions/BetaA2B5.cs index 7b6e620..d3a2e5e 100644 --- a/FastRng/Float/Distributions/BetaA2B5.cs +++ b/FastRng/Float/Distributions/BetaA2B5.cs @@ -11,7 +11,7 @@ namespace FastRng.Float.Distributions public BetaA2B5(IRandom rng) : base(rng) { } - - protected override float ShapeFunction(float x) => CONSTANT * MathF.Pow(x, ALPHA - 1f) * MathF.Pow(1f - x, BETA - 1f); + + private protected override float ShapeFunction(float x) => CONSTANT * MathF.Pow(x, ALPHA - 1f) * MathF.Pow(1f - x, BETA - 1f); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/BetaA5B2.cs b/FastRng/Float/Distributions/BetaA5B2.cs index 50bdc12..e0ce271 100644 --- a/FastRng/Float/Distributions/BetaA5B2.cs +++ b/FastRng/Float/Distributions/BetaA5B2.cs @@ -12,6 +12,6 @@ namespace FastRng.Float.Distributions { } - protected override float ShapeFunction(float x) => CONSTANT * MathF.Pow(x, ALPHA - 1f) * MathF.Pow(1f - x, BETA - 1f); + private protected override float ShapeFunction(float x) => CONSTANT * MathF.Pow(x, ALPHA - 1f) * MathF.Pow(1f - x, BETA - 1f); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/CauchyLorentzX0.cs b/FastRng/Float/Distributions/CauchyLorentzX0.cs index 814738a..9eb5a56 100644 --- a/FastRng/Float/Distributions/CauchyLorentzX0.cs +++ b/FastRng/Float/Distributions/CauchyLorentzX0.cs @@ -11,7 +11,7 @@ namespace FastRng.Float.Distributions public CauchyLorentzX0(IRandom rng) : base(rng) { } - - protected override float ShapeFunction(float x) => CONSTANT * (1.0f / (MathF.PI * SCALE)) * ((SCALE * SCALE) / (MathF.Pow(x - MEDIAN, 2f) + (SCALE * SCALE))); + + private protected override float ShapeFunction(float x) => CONSTANT * (1.0f / (MathF.PI * SCALE)) * ((SCALE * SCALE) / (MathF.Pow(x - MEDIAN, 2f) + (SCALE * SCALE))); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/CauchyLorentzX1.cs b/FastRng/Float/Distributions/CauchyLorentzX1.cs index 7fdf4f7..12e2467 100644 --- a/FastRng/Float/Distributions/CauchyLorentzX1.cs +++ b/FastRng/Float/Distributions/CauchyLorentzX1.cs @@ -11,7 +11,7 @@ namespace FastRng.Float.Distributions public CauchyLorentzX1(IRandom rng) : base(rng) { } - - protected override float ShapeFunction(float x) => CONSTANT * (1.0f / (MathF.PI * SCALE)) * ((SCALE * SCALE) / (MathF.Pow(x - MEDIAN, 2f) + (SCALE * SCALE))); + + private protected override float ShapeFunction(float x) => CONSTANT * (1.0f / (MathF.PI * SCALE)) * ((SCALE * SCALE) / (MathF.Pow(x - MEDIAN, 2f) + (SCALE * SCALE))); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/ChiSquareK1.cs b/FastRng/Float/Distributions/ChiSquareK1.cs index 623541c..dc013e2 100644 --- a/FastRng/Float/Distributions/ChiSquareK1.cs +++ b/FastRng/Float/Distributions/ChiSquareK1.cs @@ -22,6 +22,6 @@ namespace FastRng.Float.Distributions { } - protected override float ShapeFunction(float x) => CONSTANT * ((MathF.Pow(x, K_HALF_MINUS_ONE) * MathF.Exp(-x * 0.5f)) / DIVISOR); + private protected override float ShapeFunction(float x) => CONSTANT * ((MathF.Pow(x, K_HALF_MINUS_ONE) * MathF.Exp(-x * 0.5f)) / DIVISOR); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/ChiSquareK10.cs b/FastRng/Float/Distributions/ChiSquareK10.cs index fda0510..77e1d83 100644 --- a/FastRng/Float/Distributions/ChiSquareK10.cs +++ b/FastRng/Float/Distributions/ChiSquareK10.cs @@ -22,6 +22,6 @@ namespace FastRng.Float.Distributions { } - protected override float ShapeFunction(float x) => CONSTANT * ((MathF.Pow(x, K_HALF_MINUS_ONE) * MathF.Exp(-x * 0.5f)) / DIVISOR); + private protected override float ShapeFunction(float x) => CONSTANT * ((MathF.Pow(x, K_HALF_MINUS_ONE) * MathF.Exp(-x * 0.5f)) / DIVISOR); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/ChiSquareK4.cs b/FastRng/Float/Distributions/ChiSquareK4.cs index 64d48b8..5d4142d 100644 --- a/FastRng/Float/Distributions/ChiSquareK4.cs +++ b/FastRng/Float/Distributions/ChiSquareK4.cs @@ -22,6 +22,6 @@ namespace FastRng.Float.Distributions { } - protected override float ShapeFunction(float x) => CONSTANT * ((MathF.Pow(x, K_HALF_MINUS_ONE) * MathF.Exp(-x * 0.5f)) / DIVISOR); + private protected override float ShapeFunction(float x) => CONSTANT * ((MathF.Pow(x, K_HALF_MINUS_ONE) * MathF.Exp(-x * 0.5f)) / DIVISOR); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/Distribution.cs b/FastRng/Float/Distributions/Distribution.cs index 4fec032..70b2a0e 100644 --- a/FastRng/Float/Distributions/Distribution.cs +++ b/FastRng/Float/Distributions/Distribution.cs @@ -18,7 +18,7 @@ namespace FastRng.Float.Distributions this.fitter = new ShapeFitter(this.ShapeFunction, this.random, 100); } - protected abstract float ShapeFunction(float x); + private protected abstract float ShapeFunction(float x); public async ValueTask GetDistributedValue(CancellationToken token = default) => await this.fitter.NextNumber(token); diff --git a/FastRng/Float/Distributions/ExponentialLa10.cs b/FastRng/Float/Distributions/ExponentialLa10.cs index bc2708b..ae9a4de 100644 --- a/FastRng/Float/Distributions/ExponentialLa10.cs +++ b/FastRng/Float/Distributions/ExponentialLa10.cs @@ -10,7 +10,7 @@ namespace FastRng.Float.Distributions public ExponentialLa10(IRandom rng) : base(rng) { } - - protected override float ShapeFunction(float x) => CONSTANT * LAMBDA * MathF.Exp(-LAMBDA * x); + + private protected override float ShapeFunction(float x) => CONSTANT * LAMBDA * MathF.Exp(-LAMBDA * x); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/ExponentialLa5.cs b/FastRng/Float/Distributions/ExponentialLa5.cs index dac3f68..c289f35 100644 --- a/FastRng/Float/Distributions/ExponentialLa5.cs +++ b/FastRng/Float/Distributions/ExponentialLa5.cs @@ -10,7 +10,7 @@ namespace FastRng.Float.Distributions public ExponentialLa5(IRandom rng) : base(rng) { } - - protected override float ShapeFunction(float x) => CONSTANT * LAMBDA * MathF.Exp(-LAMBDA * x); + + private protected override float ShapeFunction(float x) => CONSTANT * LAMBDA * MathF.Exp(-LAMBDA * x); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/GammaA5B15.cs b/FastRng/Float/Distributions/GammaA5B15.cs index 7dfd20f..e0667e2 100644 --- a/FastRng/Float/Distributions/GammaA5B15.cs +++ b/FastRng/Float/Distributions/GammaA5B15.cs @@ -20,7 +20,7 @@ namespace FastRng.Float.Distributions public GammaA5B15(IRandom rng) : base(rng) { } - - protected override float ShapeFunction(float x) => CONSTANT * ((BETA_TO_THE_ALPHA * MathF.Pow(x, ALPHA - 1.0f) * MathF.Exp(-BETA * x)) / GAMMA_ALPHA); + + private protected override float ShapeFunction(float x) => CONSTANT * ((BETA_TO_THE_ALPHA * MathF.Pow(x, ALPHA - 1.0f) * MathF.Exp(-BETA * x)) / GAMMA_ALPHA); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/InverseExponentialLa10.cs b/FastRng/Float/Distributions/InverseExponentialLa10.cs index 3efd4fd..51a2785 100644 --- a/FastRng/Float/Distributions/InverseExponentialLa10.cs +++ b/FastRng/Float/Distributions/InverseExponentialLa10.cs @@ -10,7 +10,7 @@ namespace FastRng.Float.Distributions public InverseExponentialLa10(IRandom rng) : base(rng) { } - - protected override float ShapeFunction(float x) => CONSTANT * LAMBDA * MathF.Exp(LAMBDA * x); + + private protected override float ShapeFunction(float x) => CONSTANT * LAMBDA * MathF.Exp(LAMBDA * x); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/InverseExponentialLa5.cs b/FastRng/Float/Distributions/InverseExponentialLa5.cs index f8bccaa..1a988b2 100644 --- a/FastRng/Float/Distributions/InverseExponentialLa5.cs +++ b/FastRng/Float/Distributions/InverseExponentialLa5.cs @@ -10,7 +10,7 @@ namespace FastRng.Float.Distributions public InverseExponentialLa5(IRandom rng) : base(rng) { } - - protected override float ShapeFunction(float x) => CONSTANT * LAMBDA * MathF.Exp(LAMBDA * x); + + private protected override float ShapeFunction(float x) => CONSTANT * LAMBDA * MathF.Exp(LAMBDA * x); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/InverseGammaA3B05.cs b/FastRng/Float/Distributions/InverseGammaA3B05.cs index c18434f..50fe1cd 100644 --- a/FastRng/Float/Distributions/InverseGammaA3B05.cs +++ b/FastRng/Float/Distributions/InverseGammaA3B05.cs @@ -22,6 +22,6 @@ namespace FastRng.Float.Distributions { } - protected override float ShapeFunction(float x) => FACTOR_LEFT * MathF.Pow(x, -ALPHA - 1.0f) * MathF.Exp(-BETA / x); + private protected override float ShapeFunction(float x) => FACTOR_LEFT * MathF.Pow(x, -ALPHA - 1.0f) * MathF.Exp(-BETA / x); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/LaplaceB01M0.cs b/FastRng/Float/Distributions/LaplaceB01M0.cs index 25074d0..bdecca0 100644 --- a/FastRng/Float/Distributions/LaplaceB01M0.cs +++ b/FastRng/Float/Distributions/LaplaceB01M0.cs @@ -19,6 +19,6 @@ namespace FastRng.Float.Distributions { } - protected override float ShapeFunction(float x) => FACTOR_LEFT * MathF.Exp(-MathF.Abs(x - MU) / B); + private protected override float ShapeFunction(float x) => FACTOR_LEFT * MathF.Exp(-MathF.Abs(x - MU) / B); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/LaplaceB01M05.cs b/FastRng/Float/Distributions/LaplaceB01M05.cs index 4cc1eb6..505a2ee 100644 --- a/FastRng/Float/Distributions/LaplaceB01M05.cs +++ b/FastRng/Float/Distributions/LaplaceB01M05.cs @@ -19,6 +19,6 @@ namespace FastRng.Float.Distributions { } - protected override float ShapeFunction(float x) => FACTOR_LEFT * MathF.Exp(-MathF.Abs(x - MU) / B); + private protected override float ShapeFunction(float x) => FACTOR_LEFT * MathF.Exp(-MathF.Abs(x - MU) / B); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/LogNormalS1M0.cs b/FastRng/Float/Distributions/LogNormalS1M0.cs index dd7ed02..b6c1cb8 100644 --- a/FastRng/Float/Distributions/LogNormalS1M0.cs +++ b/FastRng/Float/Distributions/LogNormalS1M0.cs @@ -19,6 +19,6 @@ namespace FastRng.Float.Distributions { } - protected override float ShapeFunction(float x) => (CONSTANT / (x * FACTOR)) * MathF.Exp( -(MathF.Pow(MathF.Log(x) - MU, 2f) / (2f * MathF.Pow(SIGMA, 2f)))); + private protected override float ShapeFunction(float x) => (CONSTANT / (x * FACTOR)) * MathF.Exp( -(MathF.Pow(MathF.Log(x) - MU, 2f) / (2f * MathF.Pow(SIGMA, 2f)))); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/NormalS02M05.cs b/FastRng/Float/Distributions/NormalS02M05.cs index fa3d3a9..b1f52a4 100644 --- a/FastRng/Float/Distributions/NormalS02M05.cs +++ b/FastRng/Float/Distributions/NormalS02M05.cs @@ -11,7 +11,7 @@ namespace FastRng.Float.Distributions public NormalS02M05(IRandom rng) : base(rng) { } - - protected override float ShapeFunction(float x) => 1.0f / (STDDEV * SQRT_2_PI) * MathF.Exp(-0.5f * MathF.Pow((x - MEAN) / STDDEV, 2.0f)); + + private protected override float ShapeFunction(float x) => 1.0f / (STDDEV * SQRT_2_PI) * MathF.Exp(-0.5f * MathF.Pow((x - MEAN) / STDDEV, 2.0f)); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/StudentTNu1.cs b/FastRng/Float/Distributions/StudentTNu1.cs index 10ddc67..6e4e38f 100644 --- a/FastRng/Float/Distributions/StudentTNu1.cs +++ b/FastRng/Float/Distributions/StudentTNu1.cs @@ -24,6 +24,6 @@ namespace FastRng.Float.Distributions { } - protected override float ShapeFunction(float x) => CONSTANT * MathF.Pow((DIVIDEND / DIVISOR) * MathF.Pow(1.0f + MathF.Pow(START + x * COMPRESS, 2f) / NU, EXPONENT), COMPRESS); + private protected override float ShapeFunction(float x) => CONSTANT * MathF.Pow((DIVIDEND / DIVISOR) * MathF.Pow(1.0f + MathF.Pow(START + x * COMPRESS, 2f) / NU, EXPONENT), COMPRESS); } } \ No newline at end of file diff --git a/FastRng/Float/Distributions/WeibullK05La1.cs b/FastRng/Float/Distributions/WeibullK05La1.cs index 9415dad..612e5f5 100644 --- a/FastRng/Float/Distributions/WeibullK05La1.cs +++ b/FastRng/Float/Distributions/WeibullK05La1.cs @@ -11,7 +11,7 @@ namespace FastRng.Float.Distributions public WeibullK05La1(IRandom rng) : base(rng) { } - - protected override float ShapeFunction(float x) => CONSTANT * ( (K / LAMBDA) * MathF.Pow(x / LAMBDA, K - 1.0f) * MathF.Exp(-MathF.Pow(x/LAMBDA, K))); + + private protected override float ShapeFunction(float x) => CONSTANT * ( (K / LAMBDA) * MathF.Pow(x / LAMBDA, K - 1.0f) * MathF.Exp(-MathF.Pow(x/LAMBDA, K))); } } \ No newline at end of file