OpenVDB 7.0.0

Public Types | Public Member Functions | List of all members
Rand01< FloatType, EngineType > Class Template Reference

Simple generator of random numbers over the range [0, 1) More...

`#include <Math.h>`

## Public Types
using | ValueType = FloatType

## Public Member Functions
| Rand01 (const EngineType &engine)
| Initialize the generator. More...
| Rand01 (unsigned int seed)
| Initialize the generator. More...
void | setSeed (unsigned int seed)
| Set the seed value for the random number generator. More...
const EngineType & | engine () const
| Return a const reference to the random number generator. More...
FloatType | operator() ()
| Return a uniformly distributed random number in the range [0, 1). More...

## Detailed Description

### template<typename FloatType = double, typename EngineType = std::mt19937>
class openvdb::v7_0::math::Rand01< FloatType, EngineType >

Simple generator of random numbers over the range [0, 1)

Thread-safe as long as each thread has its own Rand01 instance

## Member Typedef Documentation

## ◆ ValueType

using ValueType = FloatType

## Constructor & Destructor Documentation

## ◆ Rand01() [1/2]

Rand01 | ( | const EngineType & | engine | ) |
| inline

Initialize the generator.

Parameters

  engine | random number generator

## ◆ Rand01() [2/2]

Rand01 | ( | unsigned int | seed | ) |
| inline

Initialize the generator.

Parameters

  seed | seed value for the random number generator

## Member Function Documentation

## ◆ engine()

const EngineType& engine | ( |  | ) | const
| inline

Return a const reference to the random number generator.

## ◆ operator()()

FloatType operator() | ( |  | ) |
| inline

Return a uniformly distributed random number in the range [0, 1).

## ◆ setSeed()

void setSeed | ( | unsigned int | seed | ) |
| inline

Set the seed value for the random number generator.

The documentation for this class was generated from the following file:

- Math.h