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

Generation algorithm

xn=axn1(mod m)

un=xn/m

a=1313,m=259

class mcg59#

Syntax

namespace oneapi::mkl::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::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, assume x0=seed mod 259, if x0=0, assume x0=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: Engines (Basic Random Number Generators)