ars5¶
The ars5 counter-based pseudorandom number generator.
Description
The ars5 engine is a keyed family of counter-based BRNG. The state consists of a 128-bit integer counter
Generation algorithm
The generator has a 32-bit integer output obtained in the following way [Salmon11]:
The i-th number is defined by the following formula
- Function
takes a 128-bit argument and returns a 128-bit number. The returned number is obtained as follows: 2.1.
and .2.2. The following recurrence is calculated N = 5 times:
, this step is omitted ifSpecification for
functions can be found in [FIPS-197].2.3. Put
, where
- Function
Real output:
class ars5¶
Syntax
namespace oneapi::mkl::rng {
class ars5 {
public:
static constexpr std::uint64_t default_seed = 0;
ars5(sycl::queue queue, std::uint64_t seed = default_seed);
ars5(sycl::queue queue, std::initializer_list<std::uint64_t> seed);
ars5(const ars5& other);
ars5(ars5&& other);
ars5& operator=(const ars5& other);
ars5& operator=(ars5&& other);
~ars5();
};
}
Class Members
Routine |
Description |
---|---|
Constructor for common seed initialization of the engine |
|
ars5(sycl::queue queue, std::initializer_list<std::uint64_t> seed) |
Constructor for extended seed initialization of the engine |
Copy constructor |
|
Move constructor |
|
Copy assignment operator |
|
Move assignment operator |
Constructors
ars5::ars5(sycl::queue queue, std::uint64_t 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
, where is 128-bit key, is 128-bit counter.
ars5::ars5(sycl::queue queue, std::initializer_list<std::uint64_t> 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 if
if
if
if
if
for
following arguments are ignored
ars5::ars5(const ars5& other)
Input Parameters
- other
Valid
ars5
object. Thequeue
and state of the other engine is copied and applied to the current engine.
ars5::ars5(ars5&& other)
Input Parameters
- other
Valid
ars5
r-value object. Thequeue
and state of the other engine is moved to the current engine.
ars5::ars5& operator=(const ars5& other)
Input Parameters
- other
Valid
ars5
object. Thequeue
and state of the other engine is copied and applied to the current engine.
ars5::ars5& operator=(ars5&& other)
Input Parameters
- other
Valid
ars5
r-value object. Thequeue
and state of the other engine is moved to the current engine.
Parent topic: Engines (Basic Random Number Generators)