mrg32k3a#
The combined multiple recursive pseudorandom number generator MRG32k3a.
Description
MRG32k3a engine is a 32-bit combined multiple recursive generator with two components of order 3
[L’Ecuyer99a]. MRG32k3a combined generator meets the requirements for
modern RNGs, such as good multidimensional uniformity, or a long period (
Generation algorithm
class mrg32k3a#
Syntax
namespace oneapi::math::rng::device {
template<std::int32_t VecSize = 1>
class mrg32k3a {
public:
static constexpr std::uint32_t default_seed = 1;
static constexpr std::int32_t vec_size = VecSize;
mrg32k3a();
mrg32k3a(std::uint32_t seed, std::uint64_t offset = 0);
mrg32k3a(std::initializer_list<std::uint32_t> seed, std::uint64_t offset = 0);
mrg32k3a(std::uint32_t seed, std::initializer_list<std::uint64_t> offset);
mrg32k3a(std::initializer_list<std::uint32_t> seed, std::initializer_list<std::uint64_t> offset);
};
}
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 |
|
mrg32k3a(std::initializer_list<std::uint32_t> seed, std::uint64_t offset = 0) |
Constructor for extended seed initialization of the engine and common number of skipped elements |
mrg32k3a(std::uint32_t seed, std::initializer_list<std::uint64_t> offset) |
Constructor for common seed initialization of the engine and extended number of skipped elements |
mrg32k3a(std::initializer_list<std::uint32_t> seed, std::initializer_list<std::uint64_t> offset) |
Constructor for extended seed initialization of the engine and extended number of skipped elements |
Constructors
mrg32k3a::mrg32k3a()
mrg32k3a::mrg32k3a(std::uint32_t seed, std::uint64_t offset = 0)
Input Parameters
- seed
The initial conditions of the generator state, assume if
if
if
if
if
if
if
if the values prove to be
, assumeif the values prove to be
, assume .- offset
Number of skipped elements.
mrg32k3a::mrg32k3a(std::initializer_list<std::uint32_t> seed, std::uint64_t offset = 0)
Input Parameters
- seed
Initial conditions of the engine state.
- offset
Number of skipped elements.
mrg32k3a::mrg32k3a(std::uint32_t seed, std::initializer_list<std::uint64_t> offset)
Input Parameters
- seed
The initial conditions of the generator state, assume if
if
if
if
if
if
if
if the values prove to be
, assumeif the values prove to be
, assume .- offset
Number of skipped elements. Offset is calculated as:
num_to_skip[0]+num_to_skip[1]*264 +num_to_skip[2]* 2128 + … +num_to_skip[n-1]*264 *(n-1).
mrg32k3a::mrg32k3a(std::initializer_list<std::uint32_t> seed, std::initializer_list<std::uint64_t> offset)
Input Parameters
- seed
Initial conditions of the engine state.
- offset
Number of skipped elements. Offset is calculated as:
num_to_skip[0]+num_to_skip[1]*264 +num_to_skip[2]* 2128 + … +num_to_skip[n-1]*264 *(n-1).
Parent topic: Device Engines (Basic Random Number Generators)