![]() |
Default implementation of the Rand class for integral data types.This default implementation of the Rand class creates random, integral numbers in the range , where max is the maximal value of the given data type T.
More...
#include <Random.h>
Public Member Functions | |
Generate functions | |
T | generate () const |
Generation of a random value in the range ![]() | |
T | generate (T min, T max) const |
Generation of a random value in the range ![]() | |
Randomize functions | |
void | randomize (T &value) const |
Randomization of the given variable with a new value in the range ![]() | |
void | randomize (T &value, T min, T max) const |
Randomization of the given variable with a new value in the range ![]() | |
Default implementation of the Rand class for integral data types.
This default implementation of the Rand class creates random, integral numbers in the range , where max is the maximal value of the given data type T.
|
inline |
Generation of a random value in the range .
This generate function creates a random number in the range , where max is the maximal value of the given data type T.
|
inline |
Generation of a random value in the range .
min | The smallest possible random value. |
max | The largest possible random value. |
This generate function creates a random number in the range , where min must be smaller or equal to max. Note that this requirement is only checked in debug mode. In release mode, no check is performed to enforce the validity of the values. Therefore the returned value is undefined if min is larger than max.
|
inline |
Randomization of the given variable with a new value in the range .
value | The variable to be randomized. |
This function randomizes the given variable to a new value in the range , where max is the maximal value of the given data type T.
|
inline |
Randomization of the given variable with a new value in the range .
value | The variable to be randomized. |
min | The smallest possible random value. |
max | The largest possible random value. |
This function randomizes the given variable to a new value in the range , where min must be smaller or equal to max. Note that this requirement is only checked in debug mode. In release mode, no check is performed to enforce the validity of the values. Therefore the returned value is undefined if min is larger than max.