A philox_engine random number engine produces
unsigned integer random numbers in the closed interval [0, m],
where m=2w−1 and
the template parameter w defines the range of the produced numbers.
The state of a philox_engine object consists of
a sequence X of n unsigned integer values of width w,
a sequence K of n/2 values of result_type,
a sequence Y of n values of result_type, and
a scalar i, where
The output sequence X′ of the previous round
(X in case of the first round)
is permuted to obtain the intermediate state V:
Vj=X′fn(j)
where j=0,…,n−1 and
fn(j) is defined in Table 101.
Effects: With p=⌈w/32⌉ and
an array (or equivalent) a of length (n/2)⋅p,
invokes q.generate(a +0, a + n /2*p) and
then iteratively for k=0,…,n/2−1,
sets Kk to
(∑p−1j=0akp+j⋅232j)mod2w.