diff --git a/src/Numerics/Distributions/Erlang.cs b/src/Numerics/Distributions/Erlang.cs index d7e30d67..2eec3d8c 100644 --- a/src/Numerics/Distributions/Erlang.cs +++ b/src/Numerics/Distributions/Erlang.cs @@ -81,9 +81,10 @@ namespace MathNet.Numerics.Distributions /// /// The shape (k) of the Erlang distribution. Range: k ≥ 0. /// The scale (μ) of the Erlang distribution. Range: μ ≥ 0. - public static Erlang WithShapeScale(int shape, double scale) + /// The random number generator which is used to draw random samples. Optional, can be null. + public static Erlang WithShapeScale(int shape, double scale, System.Random randomSource = null) { - return new Erlang(shape, 1.0/scale); + return new Erlang(shape, 1.0/scale, randomSource); } /// @@ -92,9 +93,10 @@ namespace MathNet.Numerics.Distributions /// /// The shape (k) of the Erlang distribution. Range: k ≥ 0. /// The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0. - public static Erlang WithShapeRate(int shape, double rate) + /// The random number generator which is used to draw random samples. Optional, can be null. + public static Erlang WithShapeRate(int shape, double rate, System.Random randomSource = null) { - return new Erlang(shape, rate); + return new Erlang(shape, rate, randomSource); } /// diff --git a/src/Numerics/Distributions/Gamma.cs b/src/Numerics/Distributions/Gamma.cs index 552d893b..d1ab96f1 100644 --- a/src/Numerics/Distributions/Gamma.cs +++ b/src/Numerics/Distributions/Gamma.cs @@ -88,9 +88,10 @@ namespace MathNet.Numerics.Distributions /// /// The shape (k) of the Gamma distribution. Range: k ≥ 0. /// The scale (θ) of the Gamma distribution. Range: θ ≥ 0 - public static Gamma WithShapeScale(double shape, double scale) + /// The random number generator which is used to draw random samples. Optional, can be null. + public static Gamma WithShapeScale(double shape, double scale, System.Random randomSource = null) { - return new Gamma(shape, 1.0/scale); + return new Gamma(shape, 1.0/scale, randomSource); } /// @@ -99,9 +100,10 @@ namespace MathNet.Numerics.Distributions /// /// The shape (k, α) of the Gamma distribution. Range: α ≥ 0. /// The rate or inverse scale (β) of the Gamma distribution. Range: β ≥ 0. - public static Gamma WithShapeRate(double shape, double rate) + /// The random number generator which is used to draw random samples. Optional, can be null. + public static Gamma WithShapeRate(double shape, double rate, System.Random randomSource = null) { - return new Gamma(shape, rate); + return new Gamma(shape, rate, randomSource); } ///