|
DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
|
Represents a pseudo-random number generator, which is an algorithm that produces a sequence of numbers that meet certain statistical requirements for randomness. More...
#include <Random.h>
Public Member Functions | |
| Random () | |
| Initializes a new instance of the Random class, using a time-dependent default seed value. | |
| Random (int seed) | |
| Initializes a new instance of the Random class, using the specified seed value. | |
| virtual int | Next () |
| Returns a non-negative random integer. | |
| virtual int | Next (int maxValue) |
| Returns a non-negative random integer that is less than the specified maximum. | |
| virtual int | Next (int minValue, int maxValue) |
| Returns a random integer that is within a specified range. | |
| virtual void | NextBytes (unsigned char *buffer, int bufferSize) |
| Fills the elements of a specified array of bytes with random numbers. | |
| virtual double | NextDouble () |
| Returns a random floating-point number that is greater than or equal to 0.0, and less than 1.0. | |
| Public Member Functions inherited from DotNetDupe::System::Object | |
| virtual | ~Object ()=default |
| Virtual destructor ensuring polymorphic cleanup. | |
| virtual bool | Equals (const Object &obj) const |
| Determines whether the specified Object is equal to the current Object. | |
| virtual int | GetHashCode () const |
| Serves as the default hash function. | |
| bool | operator== (const Object &obj) const |
| Determines reference equality between two objects. | |
| char * | ToStringA () const |
| Returns narrow-character string representation. | |
| wchar_t * | ToStringW () const |
| Returns wide-character string representation. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from DotNetDupe::System::Object | |
| static bool | Equals (const Object &obj1, const Object &obj2) |
| Static helper determining whether two object instances are equal. | |
Represents a pseudo-random number generator, which is an algorithm that produces a sequence of numbers that meet certain statistical requirements for randomness.
| DotNetDupe::System::Random::Random | ( | ) |
Initializes a new instance of the Random class, using a time-dependent default seed value.
Definition at line 7 of file Random.cpp.
| DotNetDupe::System::Random::Random | ( | int | seed | ) |
Initializes a new instance of the Random class, using the specified seed value.
| seed | A number used to calculate a starting value for the pseudo-random number sequence. |
Definition at line 9 of file Random.cpp.
|
virtual |
Returns a non-negative random integer.
Initialize Mersenne Twister engine with current seed and draw non-negative integer.
Definition at line 11 of file Random.cpp.
|
virtual |
Returns a non-negative random integer that is less than the specified maximum.
| maxValue | The exclusive upper bound of the random number to be generated. |
Sample uniform distribution across [0, maxValue].
Definition at line 18 of file Random.cpp.
|
virtual |
Returns a random integer that is within a specified range.
| minValue | The inclusive lower bound of the random number returned. |
| maxValue | The exclusive upper bound of the random number returned. |
Sample uniform distribution across [minValue, maxValue].
Definition at line 25 of file Random.cpp.
|
virtual |
Fills the elements of a specified array of bytes with random numbers.
| buffer | An array of bytes to contain random numbers. |
| bufferSize | The number of bytes to fill. |
Generate random bytes across entire buffer span.
Definition at line 32 of file Random.cpp.
|
virtual |
Returns a random floating-point number that is greater than or equal to 0.0, and less than 1.0.
Sample uniform real distribution in interval [0.0, 1.0).
Definition at line 41 of file Random.cpp.