mt2203

Contents

mt2203#

The mt2203 engine is the set of 6024 Mersenne Twister pseudorandom number generators MT2203 [Matsumoto98], [Matsumoto00].

Description

The set of 6024 basic pseudorandom number generators MT2203 is a natural addition to the MT19937 generator. MT2203 generators are intended for use in large scale Monte Carlo simulations performed on multi-processor computer systems.

Generation algorithm

For j=1,...,6024:

xn,j=xn(6934),j((xn69,j&0xFFFFFFE0)|(xn+69+1,j&0x1F))Aj

yn,j=xn,j

yn,j=yn,j(yn,j>>12)

yn,j=yn,j((yn,j<<7)&bj)

yn,j=yn,j((yn,j<<15)&cj)

yn,j=yn,j(yn,j>>18)

Matrix Aj(32x32) has the following format:

[010......00...0..................0...001a31,ja30,j......a0,1]

class mt2203#

Syntax

namespace oneapi::math::rng {
class mt2203 {
public:
    static constexpr std::uint32_t default_seed = 1;

    mt2203(sycl::queue queue, std::uint32_t seed = default_seed);

    mt2203(sycl::queue queue, std::uint32_t seed, std::uint32_t engine_idx);

    mt2203(sycl::queue queue, std::initializer_list<std::uint32_t> seed);

    mt2203(sycl::queue queue, std::initializer_list<std::uint32_t> seed, std::uint32_t engine_idx);

    mt2203(const mt2203& other);

    mt2203(mt2203&& other);

    mt2203& operator=(const mt2203& other);

    mt2203& operator=(mt2203&& other);

    ~mt2203();
};
}

Class Members

Routine

Description

mt2203(sycl::queue queue, std::uint32_t seed = default_seed)

Constructor for common seed initialization of the engine (for this case multiple generators of the set would be used)

mt2203(sycl::queue queue, std::uint32_t seed, std::uint32_t engine_idx)

Constructor for common seed initialization of the engine (for this case single generator of the set would be used)

mt2203(sycl::queue queue, std::initializer_list<std::uint32_t> seed)

Constructor for extended seed initialization of the engine (for this case multiple generators of the set would be used)

mt2203(sycl::queue queue, std::initializer_list<std::uint32_t> seed, std::uint32_t engine_idx)

Constructor for extended seed initialization of the engine (for this case single generator of the set would be used)

mt2203(const mt2203& other)

Copy constructor

mt2203(mt2203&& other)

Move constructor

mt2203& operator=(const mt2203& other)

Copy assignment operator

mt2203& operator=(mt2203&& other)

Move assignment operator

Constructors

mt2203::mt2203(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].

mt2203::mt2203(sycl::queue queue, std::uint32_t seed, std::uint32_t engine_idx)

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].

engine_idx

The index of the set 1, …, 6024.

Throws

oneapi::math::invalid_argument

Exception is thrown when idx>6024

mt2203::mt2203(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].

mt2203::mt2203(sycl::queue queue, std::initializer_list<std::uint32_t> seed, std::uint32_t engine_idx)

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].

engine_idx

The index of the set 1, …, 6024.

mt2203::mt2203(const mt2203& other)

Input Parameters

other

Valid mt2203 object. The queue and state of the other engine is copied and applied to the current engine.

mt2203::mt2203(mt2203&& other)

Input Parameters

other

Valid mt2203 object. The queue and state of the other engine is moved to the current engine.

mt2203::mt2203& operator=(const mt2203& other)

Input Parameters

other

Valid mt2203 object. The queue and state of the other engine is copied and applied to the current engine.

mt2203::mt2203& operator=(mt2203&& other)

Input Parameters

other

Valid mt2203 r-value object. The queue and state of the other engine is moved to the current engine.

Parent topic: Host Engines (Basic Random Number Generators)