mcg31m1#
The 31-bit multiplicative congruential pseudorandom number generator MCG(
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::device {
template<std::int32_t VecSize = 1>
class mcg31m1 {
public:
static constexpr std::uint32_t default_seed = 1;
static constexpr std::int32_t vec_size = VecSize;
mcg31m1();
mcg31m1(std::uint32_t seed, std::uint64_t offset = 0);
};
}
Class Template Parameters
- VecSize
Describes the size of vector which will be produced by generate function by this engine. VecSize values may be 1, 2, 3, 4, 8, 16 as
sycl::vecclass size. By default VecSize = 1, for this case, a single random number is returned by thegeneratefunction.
Class Members
Routine |
Description |
|---|---|
Default constructor |
|
Constructor for common seed initialization of the engine and common number of skipped elements |
Constructors
mcg31m1::mcg31m1()
mcg31m1::mcg31m1(std::uint32_t seed, std::uint64_t offset = 0)
Input Parameters
- seed
The initial conditions of the generator state, assume
, if , assume .- offset
Number of skipped elements.
Parent topic: Device Engines (Basic Random Number Generators)