ExtendedRandom Class

Extends the functionality of Random.

Definition

Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
C#
public class ExtendedRandom : Random
Inheritance
Object  →  Random  →  ExtendedRandom
Derived

Remarks

Use the ExtendedRandom class to represent a random number generator with more functionality than the Random class supplied with the .NET Framework Base Class Libraries.

In particular, ExtendedRandom provides a [o:RandomExtensions.Fill] method which allows a sequence of pseudo-random numbers to be generated in one operation.

Constructors

ExtendedRandom Constructs a new ExtendedRandom object.

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetItems<T>(T[], Int32)Creates an array populated with items chosen at random from the provided set of choices.
(Inherited from Random)
GetItems<T>(ReadOnlySpan<T>, Int32)Creates an array populated with items chosen at random from the provided set of choices.
(Inherited from Random)
GetItems<T>(ReadOnlySpan<T>, Span<T>)Fills the elements of a specified span with items chosen at random from the provided set of choices.
(Inherited from Random)
GetItemsWithoutReplacement<T>(T[], Int32) Creates an array populated with items chosen at random from the provided set of choices without replacement.
GetItemsWithoutReplacement<T>(ReadOnlySpan<T>, Int32) Creates an array populated with items chosen at random from the provided set of choices without replacement.
GetItemsWithoutReplacement<T>(ReadOnlySpan<T>, Span<T>) Populates the specified span with items chosen at random from the provided set of choices without replacement.
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Next()Returns a non-negative random integer.
(Inherited from Random)
Next(Int32)Returns a non-negative random integer that is less than the specified maximum.
(Inherited from Random)
Next(Int32, Int32)Returns a random integer that is within a specified range.
(Inherited from Random)
NextBytes(Byte[])Fills the elements of a specified array of bytes with random numbers.
(Overrides Random.NextBytes(Byte[]))
NextBytes(Span<Byte>)Fills the elements of a specified span of bytes with random numbers.
(Inherited from Random)
NextDoubleReturns a random floating-point number that is greater than or equal to 0.0, and less than 1.0.
(Inherited from Random)
NextInt64()Returns a non-negative random integer.
(Inherited from Random)
NextInt64(Int64)Returns a non-negative random integer that is less than the specified maximum.
(Inherited from Random)
NextInt64(Int64, Int64)Returns a random integer that is within a specified range.
(Inherited from Random)
NextSingleReturns a random floating-point number that is greater than or equal to 0.0, and less than 1.0.
(Inherited from Random)
Restart() Restarts the random number generator using the original seed.
Restart(Int32) Restarts the random number generator using the specified seed.
SampleReturns a random floating-point number between 0.0 and 1.0.
(Inherited from Random)
Shuffle<T>(T[])Performs an in-place shuffle of an array.
(Inherited from Random)
Shuffle<T>(Span<T>)Performs an in-place shuffle of a span.
(Inherited from Random)
ToStringReturns a string that represents the current object.
(Inherited from Object)

Extension Methods

AsParallel Returns a thread-safe version of this random number generator.
(Defined by RandomExtensions)
CorrelatedSamples Generates a series of random variables with the specified correlation matrix.
(Defined by RandomExtensions)
Fill Fills a Double array with random numbers.
(Defined by RandomExtensions)
Fill Fills an Int32 array with random numbers.
(Defined by RandomExtensions)
Fill Fills a Double array with random samples from the specified distribution.
(Defined by RandomExtensions)
Fill Fills an Int32 array with random samples from the specified distribution.
(Defined by RandomExtensions)
Fill Fills a vector with random samples from the specified distribution.
(Defined by RandomExtensions)
Fill Fills a vector with random samples from the specified distribution.
(Defined by RandomExtensions)
Fill Fills a Double array with random samples from the specified distribution.
(Defined by RandomExtensions)
Fill Fills a Double array with random numbers.
(Defined by RandomExtensions)
Fill Fills an Int32 array with random numbers.
(Defined by RandomExtensions)
Fill Fills an Int32 array with random samples from the specified distribution.
(Defined by RandomExtensions)
Fill Fills a Double array with random samples from the specified distribution.
(Defined by RandomExtensions)
Fill Fills an Int32 array with random samples from the specified distribution.
(Defined by RandomExtensions)
FillNormal Fills a list with normal random numbers with zero mean and unit standard deviation.
(Defined by RandomExtensions)
FillNormal Fills a list with normal random numbers with zero mean and unit standard deviation.
(Defined by RandomExtensions)
GetItemsWithoutReplacement<T> Creates an array populated with items chosen at random from the provided set of choices without replacement.
(Defined by RandomExtensions)
GetItemsWithoutReplacement<T> Populates the specified span with items chosen at random from the provided set of choices without replacement.
(Defined by RandomExtensions)
GetItemsWithoutReplacement<T> Creates an array populated with items chosen at random from the provided set of choices without replacement.
(Defined by RandomExtensions)
Next Returns a sample from the specified distribution.
(Defined by RandomExtensions)
NextDouble Returns a sample from the specified distribution.
(Defined by RandomExtensions)

See Also