mcg31m1#
The 31-bit multiplicative congruential pseudorandom number generator MCG(1132489760, 231 -1).
Description
The mcg31m1 engine is a 31-bit multiplicative congruential generator [L’Ecuyer99]. The mcg31m1 generator belongs to linear congruential generators with the period length of approximately
Generation algorithm
class mcg31m1#
Syntax
namespace oneapi::math::rng {
class mcg31m1 {
public:
static constexpr std::uint32_t default_seed = 1;
mcg31m1(sycl::queue queue, std::uint32_t seed = default_seed);
mcg31m1(const mcg31m1& other);
mcg31m1(mcg31m1&& other);
mcg31m1& operator=(const mcg31m1& other);
mcg31m1& operator=(mcg31m1&& other);
~mcg31m1();
};
}
Class Members
Routine |
Description |
---|---|
mcg31m1(sycl::queue queue, std::uint32_t seed = default_seed) |
Constructor for common seed initialization of the engine |
Copy constructor |
|
Move constructor |
|
Copy assignment operator |
|
Move assignment operator |
Constructors
mcg31m1::mcg31m1(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, assume
, if , assume .
mcg31m1::mcg31m1(const mcg31m1& other)
Input Parameters
- other
Valid
mcg31m1
object. Thequeue
and state of the other engine is copied and applied to the current engine.
mcg31m1::mcg31m1(mcg31m1&& other)
Input Parameters
- other
Valid
mcg31m1
object. Thequeue
and state of the other engine is moved to the current engine.
mcg31m1::mcg31m1& operator=(const mcg31m1& other)
Input Parameters
- other
Valid
mcg31m1
object. Thequeue
and state of the other engine is copied and applied to the current engine.
mcg31m1::mcg31m1& operator=(mcg31m1&& other)
Input Parameters
- other
Valid
mcg31m1
r-value object. Thequeue
and state of the other engine is moved to the current engine.
Parent topic: Host Engines (Basic Random Number Generators)