Random Number Engine Adaptor Class Templates

/* 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. */template <typename Engine,   size_t p,   size_t r> class thrust::random::discard_block_engine;
/* An xor_combine_engine adapts two existing base random number engines and produces random values by combining the values produced by each. */template <typename Engine1,   size_t s1,   typename Engine2,   size_t s2 = 0u> class thrust::random::xor_combine_engine;
template <typename Engine,   size_t p,   size_t r> _CCCL_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> _CCCL_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 Engine1_,   size_t s1_,   typename Engine2_,   size_t s2_> _CCCL_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_> _CCCL_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);

Member Classes

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

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

Functions

Function operator==

template <typename Engine,   size_t p,   size_t r> _CCCL_HOST_DEVICE bool operator==(const discard_block_engine< Engine, p, r > & lhs,   const discard_block_engine< Engine, p, r > & rhs); This function checks two discard_block_engines for equality.

Function Parameters:

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

Function operator!=

template <typename Engine,   size_t p,   size_t r> _CCCL_HOST_DEVICE bool operator!=(const discard_block_engine< Engine, p, r > & lhs,   const discard_block_engine< Engine, p, r > & rhs); This function checks two discard_block_engines for inequality.

Function Parameters:

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

Function operator<<

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

Function Parameters:

Returns: os

Function operator>>

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

Function Parameters:

Returns: is

Function operator==

template <typename Engine1_,   size_t s1_,   typename Engine2_,   size_t s2_> _CCCL_HOST_DEVICE bool operator==(const xor_combine_engine< Engine1_, s1_, Engine2_, s2_ > & lhs,   const xor_combine_engine< Engine1_, s1_, Engine2_, s2_ > & rhs); This function checks two xor_combine_engines for equality.

Function Parameters:

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

Function operator!=

template <typename Engine1_,   size_t s1_,   typename Engine2_,   size_t s2_> _CCCL_HOST_DEVICE bool operator!=(const xor_combine_engine< Engine1_, s1_, Engine2_, s2_ > & lhs,   const xor_combine_engine< Engine1_, s1_, Engine2_, s2_ > & rhs); This function checks two xor_combine_engines for inequality.

Function Parameters:

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

Function operator<<

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

Function Parameters:

Returns: os

Function operator>>

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

Function Parameters:

Returns: is