Simple random integer generator.
More...
#include <Math.h>
|
| RandInt (unsigned int seed, int imin, int imax) |
| Initialize the generator. More...
|
|
void | setRange (int imin, int imax) |
| Change the range over which integers are distributed to [imin, imax]. More...
|
|
int | operator() () |
| Return a randomly-generated integer in the current range. More...
|
|
int | operator() (int imin, int imax) |
| Return a randomly-generated integer in the new range [imin, imax], without changing the current range. More...
|
|
template<typename EngineType = boost::mt19937>
class openvdb::v2_3_0::math::RandInt< EngineType >
Simple random integer generator.
Thread-safe as long as each thread has its own RandInt instance
RandInt |
( |
unsigned int |
seed, |
|
|
int |
imin, |
|
|
int |
imax |
|
) |
| |
|
inline |
Initialize the generator.
- Parameters
-
seed | seed value for the random number generator |
imin,imax | generate integers that are uniformly distributed over [imin, imax] |
Return a randomly-generated integer in the current range.
int operator() |
( |
int |
imin, |
|
|
int |
imax |
|
) |
| |
|
inline |
Return a randomly-generated integer in the new range [imin, imax], without changing the current range.
void setRange |
( |
int |
imin, |
|
|
int |
imax |
|
) |
| |
|
inline |
Change the range over which integers are distributed to [imin, imax].
The documentation for this class was generated from the following file: