| Home | Libraries | People | FAQ | More

## Class template threefry_engine

boost::compute::threefry_engine — Threefry pseudorandom number generator.

## Synopsis

    // 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;
    };

## Description

### `threefry_engine` public construct/copy/destruct

1.     explicit threefry_engine(command_queue & queue);

   Creates a new `threefry_engine` and seeds it with `value`.

2.     threefry_engine(const threefry_engine< T > & other);

   Creates a new `threefry_engine` object as a copy of `other`.

3.     threefry_engine< T > & operator=(const threefry_engine< T > & other);

   Copies `other` to `*this`.

4.     ~threefry_engine();

   Destroys the `threefry_engine` object.

### `threefry_engine` public member functions

1.     template<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`).

2.     template<typename OutputIterator>
         void generate(OutputIterator first_ctr, OutputIterator last_ctr,
                       command_queue & queue);