Random Number Engine Class Templates

/* A linear_congruential_engine random number engine produces unsigned integer random numbers using a linear congruential random number generation algorithm. */template <typename UIntType,   UIntType a,   UIntType c,   UIntType m> class thrust::random::linear_congruential_engine;
/* A linear_feedback_shift_engine random number engine produces unsigned integer random values using a linear feedback shift random number generation algorithm. */template <typename UIntType,   size_t w,   size_t k,   size_t q,   size_t s> class thrust::random::linear_feedback_shift_engine;
/* A subtract_with_carry_engine random number engine produces unsigned integer random numbers using the subtract with carry algorithm of Marsaglia & Zaman. */template <typename UIntType,   size_t w,   size_t s,   size_t r> class thrust::random::subtract_with_carry_engine;
template <typename UIntType_,   UIntType_ a_,   UIntType_ c_,   UIntType_ m_> _CCCL_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_> _CCCL_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_> _CCCL_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_> _CCCL_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 UIntType_,   size_t w_,   size_t s_,   size_t r_> _CCCL_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_> _CCCL_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);

Member Classes

Class thrust::random::linear_congruential_engine

A linear_congruential_engine random number engine produces unsigned integer random numbers using a linear congruential random number generation algorithm.

Class thrust::random::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.

Class thrust::random::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.

Functions

Function operator==

template <typename UIntType_,   UIntType_ a_,   UIntType_ c_,   UIntType_ m_> _CCCL_HOST_DEVICE bool operator==(const linear_congruential_engine< UIntType_, a_, c_, m_ > & lhs,   const linear_congruential_engine< UIntType_, a_, c_, m_ > & rhs); This function checks two linear_congruential_engines for equality.

Function Parameters:

Returns: true if lhs is equal to rhs; false, otherwise.

Function operator!=

template <typename UIntType_,   UIntType_ a_,   UIntType_ c_,   UIntType_ m_> _CCCL_HOST_DEVICE bool operator!=(const linear_congruential_engine< UIntType_, a_, c_, m_ > & lhs,   const linear_congruential_engine< UIntType_, a_, c_, m_ > & rhs); This function checks two linear_congruential_engines for inequality.

Function Parameters:

Returns: true if lhs is not equal to rhs; false, otherwise.

Function operator<<

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); This function streams a linear_congruential_engine to a std::basic_ostream.

Function Parameters:

Returns: os

Function operator>>

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); This function streams a linear_congruential_engine in from a std::basic_istream.

Function Parameters:

Returns: is

Function operator==

template <typename UIntType_,   size_t w_,   size_t k_,   size_t q_,   size_t s_> _CCCL_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); This function checks two linear_feedback_shift_engines for equality.

Function Parameters:

Returns: true if lhs is equal to rhs; false, otherwise.

Function operator!=

template <typename UIntType_,   size_t w_,   size_t k_,   size_t q_,   size_t s_> _CCCL_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); This function checks two linear_feedback_shift_engines for inequality.

Function Parameters:

Returns: true if lhs is not equal to rhs; false, otherwise.

Function operator<<

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); This function streams a linear_feedback_shift_engine to a std::basic_ostream.

Function Parameters:

Returns: os

Function operator>>

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); This function streams a linear_feedback_shift_engine in from a std::basic_istream.

Function Parameters:

Returns: is

Function operator==

template <typename UIntType_,   size_t w_,   size_t s_,   size_t r_> _CCCL_HOST_DEVICE bool operator==(const subtract_with_carry_engine< UIntType_, w_, s_, r_ > & lhs,   const subtract_with_carry_engine< UIntType_, w_, s_, r_ > & rhs); This function checks two subtract_with_carry_engines for equality.

Function Parameters:

Returns: true if lhs is equal to rhs; false, otherwise.

Function operator!=

template <typename UIntType_,   size_t w_,   size_t s_,   size_t r_> _CCCL_HOST_DEVICE bool operator!=(const subtract_with_carry_engine< UIntType_, w_, s_, r_ > & lhs,   const subtract_with_carry_engine< UIntType_, w_, s_, r_ > & rhs); This function checks two subtract_with_carry_engines for inequality.

Function Parameters:

Returns: true if lhs is not equal to rhs; false, otherwise.

Function operator<<

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); This function streams a subtract_with_carry_engine to a std::basic_ostream.

Function Parameters:

Returns: os

Function operator>>

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); This function streams a subtract_with_carry_engine in from a std::basic_istream.

Function Parameters:

Returns: is