Made shape function private
This commit is contained in:
parent
37e846233d
commit
6b8a27b565
@ -14,6 +14,6 @@ namespace FastRng.Double.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -14,6 +14,6 @@ namespace FastRng.Double.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -14,6 +14,6 @@ namespace FastRng.Double.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -14,6 +14,6 @@ namespace FastRng.Double.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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)));
|
||||
}
|
||||
}
|
@ -14,6 +14,6 @@ namespace FastRng.Double.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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)));
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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<double> GetDistributedValue(CancellationToken token = default) => await this.fitter.NextNumber(token);
|
||||
|
||||
|
@ -13,6 +13,6 @@ namespace FastRng.Double.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -13,6 +13,6 @@ namespace FastRng.Double.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -13,6 +13,6 @@ namespace FastRng.Double.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -13,6 +13,6 @@ namespace FastRng.Double.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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))));
|
||||
}
|
||||
}
|
@ -15,6 +15,6 @@ namespace FastRng.Double.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -14,6 +14,6 @@ namespace FastRng.Double.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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)));
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -12,6 +12,6 @@ namespace FastRng.Float.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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)));
|
||||
}
|
||||
}
|
@ -12,6 +12,6 @@ namespace FastRng.Float.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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)));
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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<float> GetDistributedValue(CancellationToken token = default) => await this.fitter.NextNumber(token);
|
||||
|
||||
|
@ -11,6 +11,6 @@ namespace FastRng.Float.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -11,6 +11,6 @@ namespace FastRng.Float.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -21,6 +21,6 @@ namespace FastRng.Float.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -11,6 +11,6 @@ namespace FastRng.Float.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -11,6 +11,6 @@ namespace FastRng.Float.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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))));
|
||||
}
|
||||
}
|
@ -12,6 +12,6 @@ namespace FastRng.Float.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -12,6 +12,6 @@ namespace FastRng.Float.Distributions
|
||||
{
|
||||
}
|
||||
|
||||
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)));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user