HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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

typedef FloatType ValueType
 

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 = hboost::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 143 of file Math.h.

Member Typedef Documentation

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

Definition at line 150 of file Math.h.

Constructor & Destructor Documentation

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

Initialize the generator.

Parameters
enginerandom number generator

Definition at line 154 of file Math.h.

template<typename FloatType = double, typename EngineType = hboost::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 158 of file Math.h.

Member Function Documentation

template<typename FloatType = double, typename EngineType = hboost::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 167 of file Math.h.

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

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

Definition at line 170 of file Math.h.

template<typename FloatType = double, typename EngineType = hboost::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 161 of file Math.h.


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