C# Class YAMP.Numerics.DiscreteUniformDistribution

Provides generation of discrete uniformly distributed random numbers.
The discrete uniform distribution generates only discrete numbers.
The implementation of the DiscreteUniformDistribution type bases upon information presented on Wikipedia - Uniform distribution (discrete).
Inheritance: Distribution
显示文件 Open project: FlorianRappl/YAMP Class Usage Examples

Public Methods

Method Description
DiscreteUniformDistribution ( ) : System

Initializes a new instance of the DiscreteUniformDistribution class, using a StandardGenerator as underlying random number generator.

DiscreteUniformDistribution ( Generator generator ) : System

Initializes a new instance of the DiscreteUniformDistribution class, using the specified Generator as underlying random number generator.

IsValidAlpha ( int value ) : bool

Determines whether the specified value is valid for parameter Alpha.

IsValidBeta ( int value ) : bool

Determines whether the specified value is valid for parameter Beta.

Next ( ) : int

Returns a uniformly distributed random number.

NextDouble ( ) : double

Returns a uniformly distributed floating point random number.

Private Methods

Method Description
UpdateHelpers ( ) : void

Updates the helper variables that store intermediate results for generation of uniformly distributed random numbers.

Method Details

DiscreteUniformDistribution() public method

Initializes a new instance of the DiscreteUniformDistribution class, using a StandardGenerator as underlying random number generator.
public DiscreteUniformDistribution ( ) : System
return System

DiscreteUniformDistribution() public method

Initializes a new instance of the DiscreteUniformDistribution class, using the specified Generator as underlying random number generator.
/// is NULL ( in Visual Basic). ///
public DiscreteUniformDistribution ( Generator generator ) : System
generator Generator A object.
return System

IsValidAlpha() public method

Determines whether the specified value is valid for parameter Alpha.
public IsValidAlpha ( int value ) : bool
value int The value to check.
return bool

IsValidBeta() public method

Determines whether the specified value is valid for parameter Beta.
public IsValidBeta ( int value ) : bool
value int The value to check.
return bool

Next() public method

Returns a uniformly distributed random number.
public Next ( ) : int
return int

NextDouble() public method

Returns a uniformly distributed floating point random number.
public NextDouble ( ) : double
return double