thrust
Classes | Typedefs | Functions
thrust::random Namespace Reference

thrust::random is the namespace which contains random number engine class templates, random number engine adaptor class templates, engines with predefined parameters, and random number distribution class templates. They are provided in a separate namespace for import convenience but are also aliased in the top-level thrust namespace for easy access. More...

Classes

class  discard_block_engine
 A discard_block_engine adapts an existing base random number engine and produces random values by discarding some of the values returned by its base engine. Each cycle of the compound engine begins by returning r values successively produced by the base engine and ends by discarding p-r such values. The engine's state is the state of its base engine followed by the number of calls to operator() that have occurred since the beginning of the current cycle. More...
 
class  linear_congruential_engine
 A linear_congruential_engine random number engine produces unsigned integer random numbers using a linear congruential random number generation algorithm. More...
 
class  linear_feedback_shift_engine
 A linear_feedback_shift_engine random number engine produces unsigned integer random values using a linear feedback shift random number generation algorithm. More...
 
class  normal_distribution
 A normal_distribution random number distribution produces floating point Normally distributed random numbers. More...
 
class  subtract_with_carry_engine
 A subtract_with_carry_engine random number engine produces unsigned integer random numbers using the subtract with carry algorithm of Marsaglia & Zaman. More...
 
class  uniform_int_distribution
 A uniform_int_distribution random number distribution produces signed or unsigned integer uniform random numbers from a given range. More...
 
class  uniform_real_distribution
 A uniform_real_distribution random number distribution produces floating point uniform random numbers from a half-open interval. More...
 
class  xor_combine_engine
 An xor_combine_engine adapts two existing base random number engines and produces random values by combining the values produced by each. More...
 

Typedefs

typedef linear_congruential_engine< thrust::detail::uint32_t, 16807, 0, 2147483647 > minstd_rand0
 A random number engine with predefined parameters which implements a version of the Minimal Standard random number generation algorithm. More...
 
typedef linear_congruential_engine< thrust::detail::uint32_t, 48271, 0, 2147483647 > minstd_rand
 A random number engine with predefined parameters which implements a version of the Minimal Standard random number generation algorithm. More...
 
typedef subtract_with_carry_engine< thrust::detail::uint32_t, 24, 10, 24 > ranlux24_base
 A random number engine with predefined parameters which implements the base engine of the ranlux24 random number engine. More...
 
typedef subtract_with_carry_engine< thrust::detail::uint64_t, 48, 5, 12 > ranlux48_base
 A random number engine with predefined parameters which implements the base engine of the ranlux48 random number engine. More...
 
typedef discard_block_engine< ranlux24_base, 223, 23 > ranlux24
 A random number engine with predefined parameters which implements the RANLUX level-3 random number generation algorithm. More...
 
typedef discard_block_engine< ranlux48_base, 389, 11 > ranlux48
 A random number engine with predefined parameters which implements the RANLUX level-4 random number generation algorithm. More...
 
typedef xor_combine_engine< linear_feedback_shift_engine< thrust::detail::uint32_t, 32u, 31u, 13u, 12u >, 0, xor_combine_engine< linear_feedback_shift_engine< thrust::detail::uint32_t, 32u, 29u, 2u, 4u >, 0, linear_feedback_shift_engine< thrust::detail::uint32_t, 32u, 28u, 3u, 17u >, 0 >, 0 > taus88
 A random number engine with predefined parameters which implements L'Ecuyer's 1996 three-component Tausworthe random number generator. More...
 
typedef minstd_rand default_random_engine
 An implementation-defined "default" random number engine. More...
 

Functions

template<typename Engine , size_t p, size_t r>
__host__ __device__ bool operator== (const discard_block_engine< Engine, p, r > &lhs, const discard_block_engine< Engine, p, r > &rhs)
 
template<typename Engine , size_t p, size_t r>
__host__ __device__ bool operator!= (const discard_block_engine< Engine, p, r > &lhs, const discard_block_engine< Engine, p, r > &rhs)
 
template<typename Engine , size_t p, size_t r, typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, const discard_block_engine< Engine, p, r > &e)
 
template<typename Engine , size_t p, size_t r, typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &is, discard_block_engine< Engine, p, r > &e)
 
template<typename UIntType_ , UIntType_ a_, UIntType_ c_, UIntType_ m_>
__host__ __device__ bool operator== (const linear_congruential_engine< UIntType_, a_, c_, m_ > &lhs, const linear_congruential_engine< UIntType_, a_, c_, m_ > &rhs)
 
template<typename UIntType_ , UIntType_ a_, UIntType_ c_, UIntType_ m_>
__host__ __device__ bool operator!= (const linear_congruential_engine< UIntType_, a_, c_, m_ > &lhs, const linear_congruential_engine< UIntType_, a_, c_, m_ > &rhs)
 
template<typename UIntType_ , UIntType_ a_, UIntType_ c_, UIntType_ m_, typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, const linear_congruential_engine< UIntType_, a_, c_, m_ > &e)
 
template<typename UIntType_ , UIntType_ a_, UIntType_ c_, UIntType_ m_, typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &is, linear_congruential_engine< UIntType_, a_, c_, m_ > &e)
 
template<typename UIntType_ , size_t w_, size_t k_, size_t q_, size_t s_>
__host__ __device__ bool operator== (const linear_feedback_shift_engine< UIntType_, w_, k_, q_, s_ > &lhs, const linear_feedback_shift_engine< UIntType_, w_, k_, q_, s_ > &rhs)
 
template<typename UIntType_ , size_t w_, size_t k_, size_t q_, size_t s_>
__host__ __device__ bool operator!= (const linear_feedback_shift_engine< UIntType_, w_, k_, q_, s_ > &lhs, const linear_feedback_shift_engine< UIntType_, w_, k_, q_, s_ > &rhs)
 
template<typename UIntType_ , size_t w_, size_t k_, size_t q_, size_t s_, typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, const linear_feedback_shift_engine< UIntType_, w_, k_, q_, s_ > &e)
 
template<typename UIntType_ , size_t w_, size_t k_, size_t q_, size_t s_, typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &is, linear_feedback_shift_engine< UIntType_, w_, k_, q_, s_ > &e)
 
template<typename RealType >
__host__ __device__ bool operator== (const normal_distribution< RealType > &lhs, const normal_distribution< RealType > &rhs)
 
template<typename RealType >
__host__ __device__ bool operator!= (const normal_distribution< RealType > &lhs, const normal_distribution< RealType > &rhs)
 
template<typename RealType , typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, const normal_distribution< RealType > &d)
 
template<typename RealType , typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &is, normal_distribution< RealType > &d)
 
template<typename UIntType_ , size_t w_, size_t s_, size_t r_>
__host__ __device__ bool operator== (const subtract_with_carry_engine< UIntType_, w_, s_, r_ > &lhs, const subtract_with_carry_engine< UIntType_, w_, s_, r_ > &rhs)
 
template<typename UIntType_ , size_t w_, size_t s_, size_t r_>
__host__ __device__ bool operator!= (const subtract_with_carry_engine< UIntType_, w_, s_, r_ > &lhs, const subtract_with_carry_engine< UIntType_, w_, s_, r_ > &rhs)
 
template<typename UIntType_ , size_t w_, size_t s_, size_t r_, typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, const subtract_with_carry_engine< UIntType_, w_, s_, r_ > &e)
 
template<typename UIntType_ , size_t w_, size_t s_, size_t r_, typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &is, subtract_with_carry_engine< UIntType_, w_, s_, r_ > &e)
 
template<typename IntType >
__host__ __device__ bool operator== (const uniform_int_distribution< IntType > &lhs, const uniform_int_distribution< IntType > &rhs)
 
template<typename IntType >
__host__ __device__ bool operator!= (const uniform_int_distribution< IntType > &lhs, const uniform_int_distribution< IntType > &rhs)
 
template<typename IntType , typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, const uniform_int_distribution< IntType > &d)
 
template<typename IntType , typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &is, uniform_int_distribution< IntType > &d)
 
template<typename RealType >
__host__ __device__ bool operator== (const uniform_real_distribution< RealType > &lhs, const uniform_real_distribution< RealType > &rhs)
 
template<typename RealType >
__host__ __device__ bool operator!= (const uniform_real_distribution< RealType > &lhs, const uniform_real_distribution< RealType > &rhs)
 
template<typename RealType , typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, const uniform_real_distribution< RealType > &d)
 
template<typename RealType , typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &is, uniform_real_distribution< RealType > &d)
 
template<typename Engine1_ , size_t s1_, typename Engine2_ , size_t s2_>
__host__ __device__ bool operator== (const xor_combine_engine< Engine1_, s1_, Engine2_, s2_ > &lhs, const xor_combine_engine< Engine1_, s1_, Engine2_, s2_ > &rhs)
 
template<typename Engine1_ , size_t s1_, typename Engine2_ , size_t s2_>
__host__ __device__ bool operator!= (const xor_combine_engine< Engine1_, s1_, Engine2_, s2_ > &lhs, const xor_combine_engine< Engine1_, s1_, Engine2_, s2_ > &rhs)
 
template<typename Engine1_ , size_t s1_, typename Engine2_ , size_t s2_, typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, const xor_combine_engine< Engine1_, s1_, Engine2_, s2_ > &e)
 
template<typename Engine1_ , size_t s1_, typename Engine2_ , size_t s2_, typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &is, xor_combine_engine< Engine1_, s1_, Engine2_, s2_ > &e)
 

Detailed Description

thrust::random is the namespace which contains random number engine class templates, random number engine adaptor class templates, engines with predefined parameters, and random number distribution class templates. They are provided in a separate namespace for import convenience but are also aliased in the top-level thrust namespace for easy access.