mt19937#
Mersenne Twister pseudorandom number generator.
Description
The Mersenne Twister pseudorandom number generator, mt19937, is a modification of twisted generalized feedback shift register generator [Matsumoto98]. MT19937 has the period length of
Generation algorithm
Matrix
Where the 32-bit vector
class mt19937#
Syntax
namespace oneapi::math::rng {
class mt19937 {
public:
static constexpr std::uint32_t default_seed = 1;
mt19937(sycl::queue queue, std::uint32_t seed = default_seed);
mt19937(sycl::queue queue, std::initializer_list<std::uint32_t> seed);
mt19937(const mt19937& other);
mt19937(mt19937&& other);
mt19937& operator=(const mt19937& other);
mt19937& operator=(mt19937&& other);
~mt19937();
};
}
Class Members
Routine |
Description |
---|---|
mt19937(sycl::queue queue, std::uint32_t seed = default_seed) |
Constructor for common seed initialization of the engine |
mt19937(sycl::queue queue, std::initializer_list<std::uint32_t> seed) |
Constructor for extended seed initialization of the engine |
Copy constructor |
|
Move constructor |
|
Copy assignment operator |
|
Move assignment operator |
Constructors
mt19937::mt19937(sycl::queue queue, std::uint32_t seed = default_seed)
Input Parameters
- queue
Valid
sycl::queue
object, calls of the oneapi::math::rng::generate() routine submits kernels in this queue to obtain random numbers from a given engine.- seed
The initial conditions of the generator state. The initialization algorithm described in [MT2203].
mt19937::mt19937(sycl::queue queue, std::initializer_list<std::uint32_t> seed)
Input Parameters
- queue
Valid
sycl::queue
object, calls of the oneapi::math::rng::generate() routine submits kernels in this queue to obtain random numbers from a given engine.- seed
The initial conditions of the generator state. The initialization algorithm described in [MT2203].
mt19937::mt19937(const mt19937& other)
Input Parameters
- other
Valid
mt19937
object. Thequeue
and state of the other engine is copied and applied to the current engine.
mt19937::mt19937(mt19937&& other)
Input Parameters
- other
Valid
mt19937
object. Thequeue
and state of the other engine is moved to the current engine.
mt19937::mt19937& operator=(const mt19937& other)
Input Parameters
- other
Valid
mt19937
object. Thequeue
and state of the other engine is copied and applied to the current engine.
mt19937::mt19937& operator=(mt19937&& other)
Input Parameters
- other
Valid
mt19937
r-value object. Thequeue
and state of the other engine is moved to the current engine.
Parent topic: Host Engines (Basic Random Number Generators)