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_> __host__ __device__ bool thrust::random::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 thrust::random::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 > & thrust::random::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 > & thrust::random::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 thrust::random::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 thrust::random::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 > & thrust::random::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 > & thrust::random::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_> __host__ __device__ bool thrust::random::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 thrust::random::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 > & thrust::random::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 > & thrust::random::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 thrust::random::operator==
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);
This function checks two linear_congruential_engines
for equality.
Function Parameters:
lhs
The firstlinear_congruential_engine
to test.rhs
The secondlinear_congruential_engine
to test.
Returns: true
if lhs
is equal to rhs
; false
, otherwise.
Function thrust::random::operator!=
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);
This function checks two linear_congruential_engines
for inequality.
Function Parameters:
lhs
The firstlinear_congruential_engine
to test.rhs
The secondlinear_congruential_engine
to test.
Returns: true
if lhs
is not equal to rhs
; false
, otherwise.
Function thrust::random::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:
os
Thebasic_ostream
to stream out to.e
Thelinear_congruential_engine
to stream out.
Returns: os
Function thrust::random::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:
is
Thebasic_istream
to stream from.e
Thelinear_congruential_engine
to stream in.
Returns: is
Function thrust::random::operator==
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);
This function checks two linear_feedback_shift_engines
for equality.
Function Parameters:
lhs
The firstlinear_feedback_shift_engine
to test.rhs
The secondlinear_feedback_shift_engine
to test.
Returns: true
if lhs
is equal to rhs
; false
, otherwise.
Function thrust::random::operator!=
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);
This function checks two linear_feedback_shift_engines
for inequality.
Function Parameters:
lhs
The firstlinear_feedback_shift_engine
to test.rhs
The secondlinear_feedback_shift_engine
to test.
Returns: true
if lhs
is not equal to rhs
; false
, otherwise.
Function thrust::random::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:
os
Thebasic_ostream
to stream out to.e
Thelinear_feedback_shift_engine
to stream out.
Returns: os
Function thrust::random::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:
is
Thebasic_istream
to stream from.e
Thelinear_feedback_shift_engine
to stream in.
Returns: is
Function thrust::random::operator==
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);
This function checks two subtract_with_carry_engines
for equality.
Function Parameters:
lhs
The firstsubtract_with_carry_engine
to test.rhs
The secondsubtract_with_carry_engine
to test.
Returns: true
if lhs
is equal to rhs
; false
, otherwise.
Function thrust::random::operator!=
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);
This function checks two subtract_with_carry_engines
for inequality.
Function Parameters:
lhs
The firstsubtract_with_carry_engine
to test.rhs
The secondsubtract_with_carry_engine
to test.
Returns: true
if lhs
is not equal to rhs
; false
, otherwise.
Function thrust::random::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:
os
Thebasic_ostream
to stream out to.e
Thesubtract_with_carry_engine
to stream out.
Returns: os
Function thrust::random::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:
is
Thebasic_istream
to stream from.e
Thesubtract_with_carry_engine
to stream in.
Returns: is