IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.

IG::Num::RandomGeneratorSystem Class Reference

Generator of uniformly distributed random numbers. Based on system random generator. WARNING: Instance members are not guaranteed to be thread safe! More...

Inheritance diagram for IG::Num::RandomGeneratorSystem:
Collaboration diagram for IG::Num::RandomGeneratorSystem:

List of all members.

Public Member Functions

 RandomGeneratorSystem ()
 Initializes a new instance of random generator, using a time-dependent default seed value.
 RandomGeneratorSystem (int seed)
 Initializes a new instance of random generator, using the specified seed value.
override double NextDouble ()
 A double-precision floating point number greater than or equal to 0.0, and LESS THAN 1.0.
virtual double NextDouble (double maxValue)
 A double-precision floating point number greater than or equal to 0.0, and LESS than the specified maximum.
virtual double NextDouble (double minValue, double maxValue)
 A double-precision floating point number greater than or equal to the specified minimum, and LESS THAN the specified maximum.
virtual double NextDoubleInclusive ()
 A double-precision floating point number greater than or equal to 0.0, and LESS OR EQUAL than 1.0.
virtual double NextDoubleInclusive (double maxValue)
 A double-precision floating point number greater than or equal to 0.0, and LESS OR EQUAL than the specified maximum.
virtual double NextDoubleInclusive (double minValue, double maxValue)
 A double-precision floating point number greater than or equal to the specified minimum, and LESS OR EQUAL than the specified maximum.
override int Next ()
 Returns a nonnegative random number.
override int Next (int maxValue)
 Returns a nonnegative random number LESS THAN the specified maximum.
override int Next (int minValue, int maxValue)
 Returns a random number within a specified range (lower bound inclusive, UPPER BOUND EXCLUSIVE).
virtual int NextInclusive (int maxValue)
 Returns a nonnegative random number LESS OR EQUAL the specified maximum.
virtual int NextInclusive (int minValue, int maxValue)
 Returns a random number within a specified range (lower bound inclusive, upper bound INCLUSIVE).
override void NextBytes (byte[] buffer)
 Fills the elements of a specified array of bytes with random numbers.

Detailed Description

Generator of uniformly distributed random numbers. Based on system random generator. WARNING: Instance members are not guaranteed to be thread safe!


Constructor & Destructor Documentation

IG::Num::RandomGeneratorSystem::RandomGeneratorSystem ( ) [inline]

Initializes a new instance of random generator, using a time-dependent default seed value.

IG::Num::RandomGeneratorSystem::RandomGeneratorSystem ( int  seed) [inline]

Initializes a new instance of random generator, using the specified seed value.

Parameters:
seedA number used to calculate a starting value for the pseudo-random number sequence. If a negative number is specified, the absolute value of the number is used.

Member Function Documentation

override double IG::Num::RandomGeneratorSystem::NextDouble ( ) [inline]

A double-precision floating point number greater than or equal to 0.0, and LESS THAN 1.0.

Returns:
A double-precision floating point number greater than or equal to 0.0, and less than 1.0.

Implements IG::Num::IRandomGenerator.

Reimplemented in IG::Num::RandGeneratorThreadSafe.

virtual double IG::Num::RandomGeneratorSystem::NextDouble ( double  maxValue) [inline, virtual]

A double-precision floating point number greater than or equal to 0.0, and LESS than the specified maximum.

Returns:
A double-precision floating point number greater than or equal to 0.0, and LESS THAN THE SPECIFIED MAXIMUM.

Implements IG::Num::IRandomGenerator.

Reimplemented in IG::Num::RandGeneratorThreadSafe.

virtual double IG::Num::RandomGeneratorSystem::NextDouble ( double  minValue,
double  maxValue 
) [inline, virtual]

A double-precision floating point number greater than or equal to the specified minimum, and LESS THAN the specified maximum.

Returns:
A double-precision floating point number greater than or equal to the specified minimum, and LESS than the specified maximum.

Implements IG::Num::IRandomGenerator.

Reimplemented in IG::Num::RandGeneratorThreadSafe.

virtual double IG::Num::RandomGeneratorSystem::NextDoubleInclusive ( ) [inline, virtual]

A double-precision floating point number greater than or equal to 0.0, and LESS OR EQUAL than 1.0.

Returns:
A double-precision floating point number greater than or equal to 0.0, and less than 1.0.

Implements IG::Num::IRandomGenerator.

Reimplemented in IG::Num::RandGeneratorThreadSafe.

virtual double IG::Num::RandomGeneratorSystem::NextDoubleInclusive ( double  maxValue) [inline, virtual]

A double-precision floating point number greater than or equal to 0.0, and LESS OR EQUAL than the specified maximum.

Returns:
A double-precision floating point number greater than or equal to 0.0, and LESS OR EQUAL THAN THE SPECIFIED MAXIMUM.

Implements IG::Num::IRandomGenerator.

Reimplemented in IG::Num::RandGeneratorThreadSafe.

virtual double IG::Num::RandomGeneratorSystem::NextDoubleInclusive ( double  minValue,
double  maxValue 
) [inline, virtual]

A double-precision floating point number greater than or equal to the specified minimum, and LESS OR EQUAL than the specified maximum.

Returns:
A double-precision floating point number greater than or equal to the specified minimum, and LESS OR EQUAL than the specified maximum.

Implements IG::Num::IRandomGenerator.

Reimplemented in IG::Num::RandGeneratorThreadSafe.

override int IG::Num::RandomGeneratorSystem::Next ( ) [inline]

Returns a nonnegative random number.

Returns:
A 32-bit signed integer greater than or equal to zero and less than MaxValue.

Implements IG::Num::IRandomGenerator.

Reimplemented in IG::Num::RandGeneratorThreadSafe.

override int IG::Num::RandomGeneratorSystem::Next ( int  maxValue) [inline]

Returns a nonnegative random number LESS THAN the specified maximum.

Parameters:
maxValueThe EXCLUSIVE upper bound of the random number to be generated. Must be greater than or equal to zero.
Returns:
A 32-bit signed integer greater than or equal to zero, and LESS THAN maxValue. If maxValue equals zero, maxValue is returned.

Implements IG::Num::IRandomGenerator.

Reimplemented in IG::Num::RandGeneratorThreadSafe.

override int IG::Num::RandomGeneratorSystem::Next ( int  minValue,
int  maxValue 
) [inline]

Returns a random number within a specified range (lower bound inclusive, UPPER BOUND EXCLUSIVE).

Parameters:
minValueThe inclusive lower bound of the random number returned.
maxValueThe EXCLUSIVE UPPER BOUND of the random number returned. Must be greater than or equal to minValue.
Returns:
A 32-bit signed integer greater than or equal to minValue and less than maxValue. If minValue equals maxValue, minValue is returned.

Implements IG::Num::IRandomGenerator.

Reimplemented in IG::Num::RandGeneratorThreadSafe.

virtual int IG::Num::RandomGeneratorSystem::NextInclusive ( int  maxValue) [inline, virtual]

Returns a nonnegative random number LESS OR EQUAL the specified maximum.

Parameters:
maxValueThe INCLUSIVE upper bound of the random number to be generated. Must be greater than or equal to zero.
Returns:
A 32-bit signed integer greater than or equal to zero, and LESS OR EQUAL than maxValue. If maxValue equals zero, maxValue is returned.

Implements IG::Num::IRandomGenerator.

Reimplemented in IG::Num::RandGeneratorThreadSafe.

virtual int IG::Num::RandomGeneratorSystem::NextInclusive ( int  minValue,
int  maxValue 
) [inline, virtual]

Returns a random number within a specified range (lower bound inclusive, upper bound INCLUSIVE).

Parameters:
minValuehe inclusive lower bound of the random number returned.
maxValueThe INCLUSIVE upper bound of the random number returned. Must be greater than or equal to minValue.
Returns:
A 32-bit signed integer greater than or equal to minValue and LESS OR EQUAL than maxValue. If minValue equals maxValue, minValue is returned.

Implements IG::Num::IRandomGenerator.

Reimplemented in IG::Num::RandGeneratorThreadSafe.

override void IG::Num::RandomGeneratorSystem::NextBytes ( byte[]  buffer) [inline]

Fills the elements of a specified array of bytes with random numbers.

Parameters:
bufferAn array of bytes to contain random numbers.

Implements IG::Num::IRandomGenerator.

Reimplemented in IG::Num::RandGeneratorThreadSafe.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties Events