Random Number Distributions Class Templates
/* A
normal_distribution
random number distribution produces floating point Normally distributed random numbers. */template <typename RealType = double> class thrust::random::normal_distribution;
/* A uniform_int_distribution
random number distribution produces signed or unsigned integer uniform random numbers from a given range. */template <typename IntType = int> class thrust::random::uniform_int_distribution;
/* A uniform_real_distribution
random number distribution produces floating point uniform random numbers from a half-open interval. */template <typename RealType = double> class thrust::random::uniform_real_distribution;
template <typename RealType> __host__ __device__ bool thrust::random::operator==(const normal_distribution< RealType > & lhs, const normal_distribution< RealType > & rhs);
template <typename RealType> __host__ __device__ bool thrust::random::operator!=(const normal_distribution< RealType > & lhs, const normal_distribution< RealType > & rhs);
template <typename RealType, typename CharT, typename Traits> std::basic_ostream< CharT, Traits > & thrust::random::operator<<(std::basic_ostream< CharT, Traits > & os, const normal_distribution< RealType > & d);
template <typename RealType, typename CharT, typename Traits> std::basic_istream< CharT, Traits > & thrust::random::operator>>(std::basic_istream< CharT, Traits > & is, normal_distribution< RealType > & d);
template <typename IntType> __host__ __device__ bool thrust::random::operator==(const uniform_int_distribution< IntType > & lhs, const uniform_int_distribution< IntType > & rhs);
template <typename IntType> __host__ __device__ bool thrust::random::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 > & thrust::random::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 > & thrust::random::operator>>(std::basic_istream< CharT, Traits > & is, uniform_int_distribution< IntType > & d);
template <typename RealType> __host__ __device__ bool thrust::random::operator==(const uniform_real_distribution< RealType > & lhs, const uniform_real_distribution< RealType > & rhs);
template <typename RealType> __host__ __device__ bool thrust::random::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 > & thrust::random::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 > & thrust::random::operator>>(std::basic_istream< CharT, Traits > & is, uniform_real_distribution< RealType > & d);
Member Classes
Class thrust::random::normal_distribution
A normal_distribution
random number distribution produces floating point Normally distributed random numbers.
Inherits From: detail::normal_distribution_base::type
Class thrust::random::uniform_int_distribution
A uniform_int_distribution
random number distribution produces signed or unsigned integer uniform random numbers from a given range.
Class thrust::random::uniform_real_distribution
A uniform_real_distribution
random number distribution produces floating point uniform random numbers from a half-open interval.
Functions
Function thrust::random::operator==
template <typename RealType> __host__ __device__ bool operator==(const normal_distribution< RealType > & lhs, const normal_distribution< RealType > & rhs);
This function checks two normal_distributions
for equality.
Function Parameters:
lhs
The firstnormal_distribution
to test.rhs
The secondnormal_distribution
to test.
Returns: true
if lhs
is equal to rhs
; false
, otherwise.
Function thrust::random::operator!=
template <typename RealType> __host__ __device__ bool operator!=(const normal_distribution< RealType > & lhs, const normal_distribution< RealType > & rhs);
This function checks two normal_distributions
for inequality.
Function Parameters:
lhs
The firstnormal_distribution
to test.rhs
The secondnormal_distribution
to test.
Returns: true
if lhs
is not equal to rhs
; false
, otherwise.
Function thrust::random::operator<<
template <typename RealType, typename CharT, typename Traits> std::basic_ostream< CharT, Traits > & operator<<(std::basic_ostream< CharT, Traits > & os, const normal_distribution< RealType > & d);
This function streams a normal_distribution to a std::basic_ostream
.
Function Parameters:
os
Thebasic_ostream
to stream out to.d
Thenormal_distribution
to stream out.
Returns: os
Function thrust::random::operator>>
template <typename RealType, typename CharT, typename Traits> std::basic_istream< CharT, Traits > & operator>>(std::basic_istream< CharT, Traits > & is, normal_distribution< RealType > & d);
This function streams a normal_distribution in from a std::basic_istream.
Function Parameters:
is
Thebasic_istream
to stream from.d
Thenormal_distribution
to stream in.
Returns: is
Function thrust::random::operator==
template <typename IntType> __host__ __device__ bool operator==(const uniform_int_distribution< IntType > & lhs, const uniform_int_distribution< IntType > & rhs);
This function checks two uniform_int_distributions
for equality.
Function Parameters:
lhs
The firstuniform_int_distribution
to test.rhs
The seconduniform_int_distribution
to test.
Returns: true
if lhs
is equal to rhs
; false
, otherwise.
Function thrust::random::operator!=
template <typename IntType> __host__ __device__ bool operator!=(const uniform_int_distribution< IntType > & lhs, const uniform_int_distribution< IntType > & rhs);
This function checks two uniform_int_distributions
for inequality.
Function Parameters:
lhs
The firstuniform_int_distribution
to test.rhs
The seconduniform_int_distribution
to test.
Returns: true
if lhs
is not equal to rhs
; false
, otherwise.
Function thrust::random::operator<<
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);
This function streams a uniform_int_distribution to a std::basic_ostream
.
Function Parameters:
os
Thebasic_ostream
to stream out to.d
Theuniform_int_distribution
to stream out.
Returns: os
Function thrust::random::operator>>
template <typename IntType, typename CharT, typename Traits> std::basic_istream< CharT, Traits > & operator>>(std::basic_istream< CharT, Traits > & is, uniform_int_distribution< IntType > & d);
This function streams a uniform_int_distribution in from a std::basic_istream.
Function Parameters:
is
Thebasic_istream
to stream from.d
Theuniform_int_distribution
to stream in.
Returns: is
Function thrust::random::operator==
template <typename RealType> __host__ __device__ bool operator==(const uniform_real_distribution< RealType > & lhs, const uniform_real_distribution< RealType > & rhs);
This function checks two uniform_real_distributions
for equality.
Function Parameters:
lhs
The firstuniform_real_distribution
to test.rhs
The seconduniform_real_distribution
to test.
Returns: true
if lhs
is equal to rhs
; false
, otherwise.
Function thrust::random::operator!=
template <typename RealType> __host__ __device__ bool operator!=(const uniform_real_distribution< RealType > & lhs, const uniform_real_distribution< RealType > & rhs);
This function checks two uniform_real_distributions
for inequality.
Function Parameters:
lhs
The firstuniform_real_distribution
to test.rhs
The seconduniform_real_distribution
to test.
Returns: true
if lhs
is not equal to rhs
; false
, otherwise.
Function thrust::random::operator<<
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);
This function streams a uniform_real_distribution to a std::basic_ostream
.
Function Parameters:
os
Thebasic_ostream
to stream out to.d
Theuniform_real_distribution
to stream out.
Returns: os
Function thrust::random::operator>>
template <typename RealType, typename CharT, typename Traits> std::basic_istream< CharT, Traits > & operator>>(std::basic_istream< CharT, Traits > & is, uniform_real_distribution< RealType > & d);
This function streams a uniform_real_distribution in from a std::basic_istream.
Function Parameters:
is
Thebasic_istream
to stream from.d
Theuniform_real_distribution
to stream in.
Returns: is