C5  2.4
The C5 Generic Collection Library for C# and CLI is a comprehensive collection library supporting lists, sets, bags, dictionaries, priority queues, (FIFO) queues, and (LIFO) stacks. C5 runs on .NET 3.5+, Silverlight 5, Windows Phone 8, Xamarin.iOS, Xamarin.Android, and Mono.
C5.C5Random Class Reference

A modern random number generator based on G. Marsaglia: Seeds for Random Number Generators, Communications of the ACM 46, 5 (May 2003) 90-93; and a posting by Marsaglia to comp.lang.c on 2003-04-03. More...

Inheritance diagram for C5.C5Random:

Public Member Functions

override double NextDouble ()
 Get a new random System.Double value More...
 
override int Next ()
 Get a new random System.Int32 value More...
 
override int Next (int max)
 Get a random non-negative integer less than a given upper bound More...
 
override int Next (int min, int max)
 Get a random integer between two given bounds More...
 
override void NextBytes (byte[] buffer)
 Fill a array of byte with random bytes More...
 
 C5Random ()
 Create a random number generator seed by system time. More...
 
 C5Random (long seed)
 Create a random number generator with a given seed More...
 
 C5Random (uint[] Q)
 Create a random number generator with a specified internal start state. More...
 

Protected Member Functions

override double Sample ()
 Get a new random System.Double value More...
 

Detailed Description

A modern random number generator based on G. Marsaglia: Seeds for Random Number Generators, Communications of the ACM 46, 5 (May 2003) 90-93; and a posting by Marsaglia to comp.lang.c on 2003-04-03.

Constructor & Destructor Documentation

C5.C5Random.C5Random ( )

Create a random number generator seed by system time.

C5.C5Random.C5Random ( long  seed)

Create a random number generator with a given seed

Exceptions
ArgumentExceptionIf seed is zero
Parameters
seedThe seed
C5.C5Random.C5Random ( uint[]  Q)

Create a random number generator with a specified internal start state.

Exceptions
ArgumentExceptionIf Q is not of length exactly 16
Parameters
QThe start state. Must be a collection of random bits given by an array of exactly 16 uints.

Member Function Documentation

override int C5.C5Random.Next ( )

Get a new random System.Int32 value

Returns
The random int
override int C5.C5Random.Next ( int  max)

Get a random non-negative integer less than a given upper bound

Exceptions
ArgumentExceptionIf max is negative
Parameters
maxThe upper bound (exclusive)
Returns
override int C5.C5Random.Next ( int  min,
int  max 
)

Get a random integer between two given bounds

Exceptions
ArgumentExceptionIf max is less than min
Parameters
minThe lower bound (inclusive)
maxThe upper bound (exclusive)
Returns
override void C5.C5Random.NextBytes ( byte[]  buffer)

Fill a array of byte with random bytes

Parameters
bufferThe array to fill
override double C5.C5Random.NextDouble ( )

Get a new random System.Double value

Returns
The random double
override double C5.C5Random.Sample ( )
protected

Get a new random System.Double value

Returns
The random double

The documentation for this class was generated from the following file: