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::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 |
---|---|
Constructor for common seed initialization of the engine |
|
Copy constructor |
|
Move constructor |
|
Copy assignment operator |
|
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 \(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. Thequeue
and state of the other engine is copied and applied to the current engine.
mcg59::mcg59(mcg59&& other)
Input Parameters
- other
Valid
mcg59
object. Thequeue
and state of the other engine is moved to the current engine.
mcg59::mcg59& operator=(const mcg59& other)
Input Parameters
- other
Valid
mcg59
object. Thequeue
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. Thequeue
and state of the other engine is moved to the current engine.
Parent topic: Host Engines (Basic Random Number Generators)