Muesli
 All Classes Namespaces Files Functions Typedefs Enumerations
Public Member Functions | List of all members
msl::Rng Class Reference

Class Rng represents a pseudo random number generator that can be called by both the CPU and the GPU. Uses std::default_random_engine and std::uniform_real_distribution for the CPU side, and thrust::default_random_engine and thrust::uniform_real_distribution on the GPU side. More...

#include <rng.h>

Public Member Functions

MSL_USERFUNC Rng ()
 Default constructor.
 
MSL_USERFUNC Rng (float minVal, float maxVal)
 Creates a pseudo random number generator with minimum value minVal and maximum value maxVal. More...
 
MSL_USERFUNC Rng (float minVal, float maxVal, size_t seed)
 Creates a pseudo random number generator with minimum value minVal and maximum value maxVal and sets a new seed seed. More...
 
MSL_USERFUNC float operator() ()
 

Detailed Description

Class Rng represents a pseudo random number generator that can be called by both the CPU and the GPU. Uses std::default_random_engine and std::uniform_real_distribution for the CPU side, and thrust::default_random_engine and thrust::uniform_real_distribution on the GPU side.

Constructor & Destructor Documentation

MSL_USERFUNC msl::Rng::Rng ( float  minVal,
float  maxVal 
)
inline

Creates a pseudo random number generator with minimum value minVal and maximum value maxVal.

Parameters
minValThe minimum value.
maxValThe maximum value.
MSL_USERFUNC msl::Rng::Rng ( float  minVal,
float  maxVal,
size_t  seed 
)
inline

Creates a pseudo random number generator with minimum value minVal and maximum value maxVal and sets a new seed seed.

Parameters
minValThe minimum value.
maxValThe maximum value.
seedThe new seed.

Member Function Documentation

MSL_USERFUNC float msl::Rng::operator() ( )
inline

Returns the next pseudo random number.

Returns
The next pseudo random number.

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