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

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
Public Member Functions | Protected Attributes | Properties | List of all members
IG.Num.RandGeneratorThreadSafe Class Reference

Generator of uniformly distributed random numbers. Based on the default random generator. Instance members are thread safe! More...

Inheritance diagram for IG.Num.RandGeneratorThreadSafe:
[legend]
Collaboration diagram for IG.Num.RandGeneratorThreadSafe:
[legend]

## Public Member Functions
| RandGeneratorThreadSafe ()
| Initializes a new instance of random generator, using a time-dependent default seed value. More...
| RandGeneratorThreadSafe (int seed)
| Initializes a new instance of random generator, using the specified seed value. More...
override double | NextDouble ()
| A double-precision floating point number greater than or equal to 0.0, and LESS THAN 1.0. More...
override double | NextDouble (double maxValue)
| A double-precision floating point number greater than or equal to 0.0, and LESS than the specified maximum. More...
override 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. More...
override double | NextDoubleInclusive ()
| A double-precision floating point number greater than or equal to 0.0, and LESS OR EQUAL than 1.0. More...
override 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. More...
override 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. More...
override int | Next ()
| Returns a nonnegative random number. More...
override int | Next (int maxValue)
| Returns a nonnegative random number LESS THAN the specified maximum. More...
override int | Next (int minValue, int maxValue)
| Returns a random number within a specified range (lower bound inclusive, UPPER BOUND EXCLUSIVE). More...
override int | NextInclusive (int maxValue)
| Returns a nonnegative random number LESS OR EQUAL the specified maximum. More...
override int | NextInclusive (int minValue, int maxValue)
| Returns a random number within a specified range (lower bound inclusive, upper bound INCLUSIVE). More...
override void | NextBytes (byte[] buffer)
| Fills the elements of a specified array of bytes with random numbers. More...
Public Member Functions inherited from IG.Num.RandomGeneratorSystem
| RandomGeneratorSystem ()
| Initializes a new instance of random generator, using a time-dependent default seed value. More...
| RandomGeneratorSystem (int seed)
| Initializes a new instance of random generator, using the specified seed value. More...
override double | NextDouble ()
| A double-precision floating point number greater than or equal to 0.0, and LESS THAN 1.0. More...
override int | Next ()
| Returns a nonnegative random number. More...
override int | Next (int maxValue)
| Returns a nonnegative random number LESS THAN the specified maximum. More...
override int | Next (int minValue, int maxValue)
| Returns a random number within a specified range (lower bound inclusive, UPPER BOUND EXCLUSIVE). More...
override void | NextBytes (byte[] buffer)
| Fills the elements of a specified array of bytes with random numbers. More...

## Protected Attributes
object | _lock = new Object()

## Properties
object | Lock`[get]`
| Gets an object used for locking of the current object. More...
Properties inherited from IG.Lib.ILockable
object | Lock`[get]`

## Detailed Description

Generator of uniformly distributed random numbers. Based on the default random generator. Instance members are thread safe!

## Constructor & Destructor Documentation

IG.Num.RandGeneratorThreadSafe.RandGeneratorThreadSafe | ( |  | ) |
| inline

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

IG.Num.RandGeneratorThreadSafe.RandGeneratorThreadSafe | ( | int | seed | ) |
| inline

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

Parameters

  seed | A 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.RandGeneratorThreadSafe.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.

override double IG.Num.RandGeneratorThreadSafe.NextDouble | ( | double | maxValue | ) |
| inline

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.

override double IG.Num.RandGeneratorThreadSafe.NextDouble | ( | double | minValue,
|  | double | maxValue
| ) |  |
| inline

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.

override double IG.Num.RandGeneratorThreadSafe.NextDoubleInclusive | ( |  | ) |
| inline

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.

override double IG.Num.RandGeneratorThreadSafe.NextDoubleInclusive | ( | double | maxValue | ) |
| inline

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.

override double IG.Num.RandGeneratorThreadSafe.NextDoubleInclusive | ( | double | minValue,
|  | double | maxValue
| ) |  |
| inline

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.

override int IG.Num.RandGeneratorThreadSafe.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.

override int IG.Num.RandGeneratorThreadSafe.Next | ( | int | maxValue | ) |
| inline

Returns a nonnegative random number LESS THAN the specified maximum.

Parameters

  maxValue | The 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.

override int IG.Num.RandGeneratorThreadSafe.Next | ( | int | minValue,
|  | int | maxValue
| ) |  |
| inline

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

Parameters

  minValue | The inclusive lower bound of the random number returned.
  maxValue | The 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.

override int IG.Num.RandGeneratorThreadSafe.NextInclusive | ( | int | maxValue | ) |
| inline

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

Parameters

  maxValue | The 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.

override int IG.Num.RandGeneratorThreadSafe.NextInclusive | ( | int | minValue,
|  | int | maxValue
| ) |  |
| inline

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

Parameters

  minValue | he inclusive lower bound of the random number returned.
  maxValue | The 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.

override void IG.Num.RandGeneratorThreadSafe.NextBytes | ( | byte[] | buffer | ) |
| inline

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

Parameters

  buffer | An array of bytes to contain random numbers.

Implements IG.Num.IRandomGenerator.

## Member Data Documentation

object IG.Num.RandGeneratorThreadSafe._lock = new Object()
| protected

## Property Documentation

object IG.Num.RandGeneratorThreadSafe.Lock
| get

Gets an object used for locking of the current object.

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

- igbase/numeric/Random.cs