Public Member Functions | |
| range () | |
| Construct the object by calling default constructors for min and max. | |
| range (const T_ &mn, const T_ &mx) | |
| Construct and initialize min and max directly. | |
| void | set (const T_ &mn, const T_ &mx) |
| Set min and max. | |
| T_ | get_random () const |
| Get a random value between min and max. | |
| T_ | get_random_sqrtf () const |
| Get a random square root value between min and max. | |
Public Attributes | |
| T_ | minimum |
| Lower bound. | |
| T_ | maximum |
| Higher bound. | |
T_ is the type of values to be stored, and it must support operations T_ + T_, T_ - T_, and T_ * float, otherwise the get_random() method will not compile. This struct could be extended to customize the random number generator (now it uses only std::rand()).
|
|||||||||
|
Construct the object by calling default constructors for min and max.
|
|
||||||||||||||||
|
Construct and initialize min and max directly.
|
|
|||||||||
|
Get a random value between min and max.
|
|
|||||||||
|
Get a random square root value between min and max.
|
|
||||||||||||||||
|
Set min and max.
|
|
|||||
|
Higher bound.
|
|
|||||
|
Lower bound.
|
1.4.2