mt2203

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\):

\(x_{n, j} =x_{n - (69 - 34), j} \oplus ( (x_{n - 69, j} \& 0xFFFFFFE0) | (x_{n + 69 + 1, j} \& 0x1F) ) A_{j}\)

\(y_{n, j} = x_{n, j}\)

\(y_{n, j} = y_{n, j} \oplus (y_{n, j} >> 12)\)

\(y_{n, j} = y_{n, j} \oplus ( (y_{n, j} << 7) \& b_j)\)

\(y_{n, j} = y_{n, j} \oplus ( (y_{n, j} << 15) \& c_j)\)

\(y_{n, j} = y_{n, j} \oplus (y_{n, j} >> 18)\)

Matrix \(A_j(32x32)\) has the following format:

\[\begin{split}\left [ \begin{array}{ccccc} 0 & 1 & 0 & ... & ... \\ 0 & 0 & ... & 0 & ... \\ ... & ... & ... & ... & ... \\ 0 & ... & 0 & 0 & 1 \\ a_{31, j} & a_{30, j} & ... & ... & a_{0, 1} \end{array}\right ]\end{split}\]

class mt2203

Syntax

namespace oneapi::mkl::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::mkl::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::mkl::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::mkl::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::mkl::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::mkl::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: Engines (Basic Random Number Generators)