NMath Reference Guide

## Rand |

Class RandGenMTwist generates random numbers from a uniform distribution using
the Mersenne Twister algorithm.

Inheritance Hierarchy

Syntax

The RandGenMTwist type exposes the following members.

Constructors

Name | Description | |
---|---|---|

RandGenMTwist | Creates a random number generator using the time of day in milliseconds as the seed. | |

RandGenMTwist(Int32) | Creates a random number generator initialized with the given seed. | |

RandGenMTwist(Int32) | Creates a random number generator initialized with the given array. |

Properties

Name | Description | |
---|---|---|

MaxRandomInt | Gets the maximum random integer value. All random integers generated by instances of this class are less than or equal to this value. This value is 0x7fffffff (2,147,483,647). | |

UniformDeviateMethod |
Gets and sets the delegate method for generating uniform deviates between
zero and one.
(Inherited from RandomNumberGenerator) |

Methods

Name | Description | |
---|---|---|

Clone |
Creates a deep copy of this random number generator.
(Overrides RandomNumberGeneratorClone) | |

Fill(Double) |
Fills the given array of doubles with random values.
(Inherited from RandomNumberGenerator) | |

Fill(DoubleComplex) |
Fills the given array of double-precision complex numbers with random values.
(Inherited from RandomNumberGenerator) | |

Fill(DoubleDataBlock) |
Fills the given data block with random values.
(Inherited from RandomNumberGenerator) | |

Fill(FloatComplex) |
Fills the given array of single-precision complex numbers with random values.
(Inherited from RandomNumberGenerator) | |

Fill(Int32) | Fills the given array of integers with random values. | |

Fill(Single) |
Fills the given array of floats with random values.
(Inherited from RandomNumberGenerator) | |

Fill(Int32, Boolean) | Fills the given array of integers with random values. | |

Fill(Int32, Int32) | Fills the given array of integers with random values. | |

Fill(Int32, Int32, Boolean) | Fills the given array of integers with random values. | |

Fill(Int32, Int32, Int32) | Fills the given array of integers with random values. | |

Fill(Int32, Int32, Int32, Boolean) | Fills the given array of integers with random values. | |

Initialize | Reinitializes the random number generator using the time of day in milliseconds as the seed. | |

Initialize(Int32) | Reinitializes the random number generator with the given seed. | |

Initialize(Int32) | Reinitializes the random number generator with the given array. | |

Next | Returns a random integer greater than or equal to zero and less than or equal to MaxRandomInt. | |

Next(Int32) | Returns a positive random integer less than the specified maximum. | |

Next(Int32, Int32) | Returns a random integer within the specified range. | |

Next53BitRes | Generates a random number on [0,1) with 53-bit resolution. | |

NextDouble |
Returns a random number between 0.0 and 1.0.
(Overrides RandomNumberGeneratorNextDouble) | |

NextDouble(Boolean) | Returns a random number greater than or equal to zero, and either strictly less than one, or less than or equal to one, depending on the value of the given boolean parameter. | |

NextDoubleComplex |
Method for generating a double precision complex number random deviate.
(Inherited from RandomNumberGenerator) | |

NextDoubleComplex(Boolean) | Returns a complex number with double-precision real and imaginary parts set to random numbers between 0.0 and 1.0. The bounds are either strictly less than one, or less than or equal to one, depending on the value of the given boolean parameter. | |

NextDoubleComplexPositive | Returns a complex number with double-precision real and imaginary parts set to random numbers between 0.0 and 1.0. | |

NextDoublePositive | Returns a random number greater than 0.0 and less than 1.0. | |

NextFloat |
Returns a random number between 0.0 and 1.0.
(Overrides RandomNumberGeneratorNextFloat) | |

NextFloat(Boolean) | Returns a random number greater than or equal to zero, and either strictly less than one, or less than or equal to one, depending on the value of the given boolean parameter. | |

NextFloatComplex |
Method for generating a single precision complex number random deviate.
(Inherited from RandomNumberGenerator) | |

NextFloatComplex(Boolean) | Returns a complex number with single-precision real and imaginary parts set to random numbers between 0.0 and 1.0. The bounds are either strictly less than one, or less than or equal to one, depending on the value of the given boolean parameter. | |

NextFloatComplexPositive | Returns a complex number with single-precision real and imaginary parts set to random numbers between 0.0 and 1.0. | |

NextFloatPositive | Returns a random number greater than 0.0 and less than 1.0. | |

Reset |
Resets the random number generator using a random seed.
(Inherited from RandomNumberGenerator) | |

Reset(Int32) |
Resets the random number generator with the specified seed.
(Inherited from RandomNumberGenerator) |

Fields

Name | Description | |
---|---|---|

rand_ |
A delegate method for generating uniform deviates between zero and one.
(Inherited from RandomNumberGenerator) |

Remarks

Caution: MT is for MonteCarlo, and is NOT SECURE for CRYPTOGRAPHY
as it is.

See Also