HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::math::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::OPENVDB_VERSION_NAME::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

Definition at line 166 of file Math.h.

Member Typedef Documentation

template<typename FloatType = double, typename EngineType = std::mt19937>
using openvdb::OPENVDB_VERSION_NAME::math::Rand01< FloatType, EngineType >::ValueType = FloatType

Definition at line 173 of file Math.h.

Constructor & Destructor Documentation

template<typename FloatType = double, typename EngineType = std::mt19937>
openvdb::OPENVDB_VERSION_NAME::math::Rand01< FloatType, EngineType >::Rand01 ( const EngineType &  engine)
inline

Initialize the generator.

Parameters
enginerandom number generator

Definition at line 177 of file Math.h.

template<typename FloatType = double, typename EngineType = std::mt19937>
openvdb::OPENVDB_VERSION_NAME::math::Rand01< FloatType, EngineType >::Rand01 ( unsigned int  seed)
inline

Initialize the generator.

Parameters
seedseed value for the random number generator

Definition at line 181 of file Math.h.

Member Function Documentation

template<typename FloatType = double, typename EngineType = std::mt19937>
const EngineType& openvdb::OPENVDB_VERSION_NAME::math::Rand01< FloatType, EngineType >::engine ( ) const
inline

Return a const reference to the random number generator.

Definition at line 190 of file Math.h.

template<typename FloatType = double, typename EngineType = std::mt19937>
FloatType openvdb::OPENVDB_VERSION_NAME::math::Rand01< FloatType, EngineType >::operator() ( void  )
inline

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

Definition at line 193 of file Math.h.

template<typename FloatType = double, typename EngineType = std::mt19937>
void openvdb::OPENVDB_VERSION_NAME::math::Rand01< FloatType, EngineType >::setSeed ( unsigned int  seed)
inline

Set the seed value for the random number generator.

Definition at line 184 of file Math.h.


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