Class UniformDistributionD
Represents a uniform distribution that returns random values for a given interval
[MinValue, MaxValue] (double-precision).
Namespace: Mars.Numerics.Statistics
Assembly: Mars.Numerics.dll
Syntax
public class UniformDistributionD : Distribution<double>
Remarks
Every time Next(FastRandom) is called, a new random value from the interval
[MinValue, MaxValue] is returned. All values in this interval have
the same chance to be chosen.
Constructors
UniformDistributionD()
Initializes a new instance of the UniformDistributionD class.
Declaration
public UniformDistributionD()
UniformDistributionD(Double, Double)
Initializes a new instance of the UniformDistributionD class.
Declaration
public UniformDistributionD(double minValue, double maxValue)
Parameters
Type | Name | Description |
---|---|---|
System.Double | minValue | The minimum value. |
System.Double | maxValue | The maximum value. |
Properties
MaxValue
Gets or sets the maximum value.
Declaration
public double MaxValue { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The maximum value. The default is 1. |
MinValue
Gets or sets the minimum value.
Declaration
public double MinValue { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The minimum value. The default is -1. |
Methods
Next(FastRandom)
Declaration
public override double Next(FastRandom random)
Parameters
Type | Name | Description |
---|---|---|
Mars.Common.Core.Random.FastRandom | random |
Returns
Type | Description |
---|---|
System.Double |
Overrides
Mars.Numerics.Statistics.Distribution<System.Double>.Next(Mars.Common.Core.Random.FastRandom)