wichmann_hill

wichmann_hill#

The wichmann_hill engine is the set of 273 Wichmann-Hill’s combined multiplicative congruential generators from NAG Numerical Libraries [NAG].

Description

The set of 372 different basic pseudorandom number generators wichmann_hill is the second basic generator in the NAG libraries.

Generation algorithm

xn=a1,jxn1(mod m1,j)

yn=a2,jyn1(mod m2,j)

zn=a3,jzn1(mod m3,j)

wn=a4,jwn1(mod m4,j)

un=(xn/m1,j+yn/m2,j+zn/m3,j+wn/m4,j)mod 1

The constants ai,j range from 112 to 127, the constants mi,j are prime numbers ranging from 16718909 to 16776917, close to 224.

class wichmann_hill#

Syntax

namespace oneapi::mkl::rng {
class wichmann_hill {
public:
    static constexpr std::uint32_t default_seed = 1;

    wichmann_hill(sycl::queue queue, std::uint32_t seed = default_seed);

    wichmann_hill(sycl::queue queue, std::uint32_t seed, std::uint32_t engine_idx);

    wichmann_hill(sycl::queue queue, std::initializer_list<std::uint32_t> seed);

    wichmann_hill(sycl::queue queue, std::initializer_list<std::uint32_t> seed, std::uint32_t engine_idx);

    wichmann_hill(const wichmann_hill& other);

    wichmann_hill(wichmann_hill&& other);

    wichmann_hill& operator=(const wichmann_hill& other);

    wichmann_hill& operator=(wichmann_hill&& other);

    ~wichmann_hill();
};
}

Class Members

Routine

Description

wichmann_hill(sycl::queue queue, std::uint32_t seed = default_seed)

Constructor for common seed initialization of the engine (for this case multiple generators of the set would be used)

wichmann_hill(sycl::queue queue, std::uint32_t seed, std::uint32_t engine_idx)

Constructor for common seed initialization of the engine (for this case single generator of the set would be used)

wichmann_hill(sycl::queue& queue, std::initializer_list<std::uint32_t> seed)

Constructor for extended seed initialization of the engine (for this case multiple generators of the set would be used)

wichmann_hill(sycl::queue& queue, std::initializer_list<std::uint32_t> seed, std::uint32_t engine_idx)

Constructor for extended seed initialization of the engine (for this case single generator of the set would be used)

wichmann_hill(const wichmann_hill& other)

Copy constructor

wichmann_hill(wichmann_hill&& other)

Move constructor

wichmann_hill& operator=(const wichmann_hill& other)

Copy assignment operator

wichmann_hill& operator=(wichmann_hill&& other)

Move assignment operator

Constructors

wichmann_hill::wichmann_hill(sycl::queue queue, std::uint32_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 x0=seed mod m1,y0=z0=w0=1. If x0=0, assume x0=1.

wichmann_hill::wichmann_hill(sycl::queue queue, std::uint32_t seed, std::uint32_t engine_idx)

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 x0=seed mod m1,y0=z0=w0=1. If x0=0, assume x0=1.

engine_idx

The index of the set 1, …, 273.

Throws

oneapi::mkl::invalid_argument

Exception is thrown when idx>273

wichmann_hill::wichmann_hill(sycl::queue& queue, std::initializer_list<std::uint32_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 n=0:x0=y0=z0=w0=1

if n=1:x0=seed[0] mod m1,y0=z0=w0=1. If x0=0, assume x0=1.

if n=2:x0=seed[0] mod m1,y0=seed[1] mod m2,z0=w0=1.

if n=3:x0=seed[0] mod m1,y0=seed[1] mod m2,z0=seed[2] mod m3,w0=1.

if n4:x0=seed[0] mod m1,y0=seed[1] mod m2

z0=seed[2] mod m3,w0=seed[3] mod m4.

wichmann_hill::wichmann_hill(sycl::queue& queue, std::initializer_list<std::uint32_t> seed, std::uint32_t engine_idx)

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 n=0:x0=y0=z0=w0=1

if n=1:x0=seed[0] mod m1,y0=z0=w0=1. If x0=0, assume x0=1.

if n=2:x0=seed[0] mod m1,y0=seed[1] mod m2,z0=w0=1.

if n=3:x0=seed[0] mod m1,y0=seed[1] mod m2,z0=seed[2] mod m3,w0=1.

if n4:x0=seed[0] mod m1,y0=seed[1] mod m2

z0=seed[2] mod m3,w0=seed[3] mod m4.

engine_idx

The index of the set 1, …, 273.

wichmann_hill::wichmann_hill(const wichmann_hill& other)

Input Parameters

other

Valid wichmann_hill object. The queue and state of the other engine is copied and applied to the current engine.

wichmann_hill::wichmann_hill(wichmann_hill&& other)

Input Parameters

other

Valid wichmann_hill object. The queue and state of the other engine is moved to the current engine.

wichmann_hill::wichmann_hill& operator=(const wichmann_hill& other)

Input Parameters

other

Valid wichmann_hill object. The queue and state of the other engine is copied and applied to the current engine.

wichmann_hill::wichmann_hill& operator=(wichmann_hill&& other)

Input Parameters

other

Valid wichmann_hill r-value object. The queue and state of the other engine is moved to the current engine.

Parent topic: Host Engines (Basic Random Number Generators)