mcg59

Contents

mcg59#

The 59-bit multiplicative congruential pseudorandom number generator.

Description

The mcg59 engine is a 59-bit multiplicative congruential generator from NAG Numerical Libraries NAG. The mcg59 generator belongs to linear congruential generators with the period length of approximately \(2^{57}\).

Generation algorithm

\(x_n=ax_{n-1}(mod \ m)\)

\(u_n = x_n / m\)

\(a = 13^{13}, m=2^{59}\)

class mcg59#

Syntax

namespace oneapi::math::rng {
class mcg59 {
public:
    static constexpr std::uint64_t default_seed = 1;

    mcg59(sycl::queue queue, std::uint64_t seed = default_seed);

    mcg59(const mcg59& other);

    mcg59(mcg59&& other);

    mcg59& operator=(const mcg59& other);

    mcg59& operator=(mcg59&& other);

    ~mcg59();
};
}

Class Members

Routine

Description

mcg59(sycl::queue queue, std::uint64_t seed = default_seed)

Constructor for common seed initialization of the engine

mcg59(const mcg59& other)

Copy constructor

mcg59(mcg59&& other)

Move constructor

mcg59& operator=(const mcg59& other)

Copy assignment operator

mcg59& operator=(mcg59&& other)

Move assignment operator

Constructors

mcg59::mcg59(sycl::queue queue, std::uint64_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, assume \(x_0 = seed \ mod \ 2^{59}\), if \(x_0 = 0\), assume \(x_0 = 1\).

mcg59::mcg59(const mcg59& other)

Input Parameters

other

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

mcg59::mcg59(mcg59&& other)

Input Parameters

other

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

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

Input Parameters

other

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

mcg59::mcg59& operator=(mcg59&& other)

Input Parameters

other

Valid mcg59 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)