...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::compute::threefry_engine — Threefry pseudorandom number generator.
// In header: <boost/compute/random/threefry_engine.hpp> template<typename T = uint_> class threefry_engine { public: // types typedef T result_type; // construct/copy/destruct explicit threefry_engine(command_queue &); threefry_engine(const threefry_engine< T > &); threefry_engine< T > & operator=(const threefry_engine< T > &); ~threefry_engine(); // public member functions template<typename OutputIterator> void generate(OutputIterator, OutputIterator, OutputIterator, OutputIterator, command_queue &); template<typename OutputIterator> void generate(OutputIterator, OutputIterator, command_queue &); // public data members static const size_t threads; };
threefry_engine
public
construct/copy/destructexplicit threefry_engine(command_queue & queue);Creates a new
threefry_engine
and seeds it with value
. threefry_engine(const threefry_engine< T > & other);Creates a new
threefry_engine
object as a copy of other
. threefry_engine< T > & operator=(const threefry_engine< T > & other);Copies
other
to *this
. ~threefry_engine();Destroys the
threefry_engine
object. threefry_engine
public member functionstemplate<typename OutputIterator> void generate(OutputIterator first_ctr, OutputIterator last_ctr, OutputIterator first_key, OutputIterator last_key, command_queue & queue);
Generates Threefry random numbers using both the counter and key values, and then stores them to the range [first_ctr
, last_ctr
).
template<typename OutputIterator> void generate(OutputIterator first_ctr, OutputIterator last_ctr, command_queue & queue);