Represents a generalized feedback shift register
pseudo-random number generator.
Namespace: Extreme.Statistics.Random
Assembly: Extreme.Numerics (Extreme.Numerics)
Syntax
| Visual Basic (Declaration) |
|---|
Public NotInheritable Class GfsrGenerator _ Inherits RandomWordGenerator |
| C# |
|---|
public sealed class GfsrGenerator : RandomWordGenerator |
| C++ |
|---|
public ref class GfsrGenerator sealed : public RandomWordGenerator |
Methods
| Icon | Type | Description |
|---|---|---|
| Equals(Object) | ||
| Fill(Double[]()) |
Fills a Double array with random numbers.
| |
| Fill(Vector) |
Fills a Vector with random numbers.
| |
| Fill(Double[](), Int32, Int32) |
Fills a Double array with random numbers.
| |
| Fill(Double[](), ContinuousDistribution) |
Fills a Double array with random samples from the specified distribution.
| |
| Fill(Vector, ContinuousDistribution) |
Fills a Vector with random samples from the specified distribution.
| |
| Fill(Double[](), Int32, Int32, ContinuousDistribution) |
Fills a Double array with random samples from the specified distribution.
| |
| Fill(Int32[]()) |
Fills an Int32 array with random numbers.
| |
| Fill(Int32[](), Int32, Int32) |
Fills an Int32 array with random numbers.
| |
| Fill(Int32[](), DiscreteDistribution) |
Fills an Int32 array with random samples from the specified distribution.
| |
| Fill(Vector, DiscreteDistribution) |
Fills a Vector with random samples from the specified distribution.
| |
| Fill(Int32[](), Int32, Int32, DiscreteDistribution) |
Fills an Int32 array with random samples from the specified distribution.
| |
| Finalize() | ||
| GenerateNextWord() |
Advances the sequence of random numbers by one and
updates the CurrentValue of the
random number generator.
| |
| GetHashCode() | Serves as a hash function for a particular type. | |
| GetType() | Gets the Type of the current instance. | |
| MemberwiseClone() | Creates a shallow copy of the current Object. | |
| Next() |
Returns a nonnegative random number.
| |
| Next(DiscreteDistribution) |
Returns a sample from the specified distribution.
| |
| Next(Int32, Int32) | Returns a random number within a specified range. | |
| Next(Int32) | Returns a nonnegative random number less than the specified maximum. | |
| NextBytes(Byte[]()) |
Fills the elements of a specified array of bytes with random numbers.
| |
| NextDouble() |
Returns a random number between 0 and 1.
| |
| NextDouble(ContinuousDistribution) |
Returns a sample from the specified distribution.
| |
| Sample() |
Returns a random number between 0 and 1.
| |
| ToString() |
Constructors
| Icon | Type | Description |
|---|---|---|
| GfsrGeneratorNew() |
Initializes a new instance of the GfsrGenerator class
using a time-dependent default seed value.
| |
| GfsrGeneratorNew(Int32) |
Initializes a new instance of the GfsrGenerator class
using the specified seed value.
| |
| GfsrGeneratorNew(Int32[]()) |
Initializes a new instance of the GfsrGenerator class
using the specified seed array of seed values.
|
Properties
| Icon | Type | Description |
|---|---|---|
| CurrentValue |
Gets or sets the current random 32-bit word.
|
Remarks
Use the GfsrGenerator class to represent a pseudo-_random
number generator that uses a fourth order generalized feedback shift register algorithm.
This generalized feedback shift register generator has a very long period of 29689-1. Thanks to its simplicity, it is very fast. On the down side, the start-up time is significant.
GfsrGenerator can be used in place of the Random class to obtain pseudo-random numbers of a higher quality.
Reference: Robert M. Ziff, "Four-tap shift-register-sequence _random-number generators," Computers in Physics 12(4), Jul/Aug 1998, pp 385-392.
Inheritance Hierarchy
System.Object
System.Random
Extreme.Statistics.Random.ExtendedRandom
Extreme.Statistics.Random.RandomWordGenerator
Extreme.Statistics.Random.GfsrGenerator
System.Random
Extreme.Statistics.Random.ExtendedRandom
Extreme.Statistics.Random.RandomWordGenerator
Extreme.Statistics.Random.GfsrGenerator