By way of initialization,
set each element of the range to the value
0x8b8b8b8b. Additionally,
for use in subsequent steps,
let p=(n−t)/2
and let q=p+t,
where
t=(n≥623) ? 11 : (n≥68) ? 7 : (n≥39) ? 5 : (n≥7) ? 3 : (n−1)/2;
With
m as the larger of
s+1 and n,
transform the elements of the range:
iteratively for k=0,…,m−1,
calculate values
r1=1664525⋅T(begin[k]xorbegin[k+p]xorbegin[k−1])r2=r1+⎧⎪⎨⎪⎩s, k=0kmodn+v[k−1], 0<k≤skmodn, s<k
and, in order,
increment begin[k+p] by r1,
increment begin[k+q] by r2,
and
set begin[k] to r2.Transform the elements of the range again,
beginning where the previous step ended:
iteratively for
k=m,…,m+n−1,
calculate values
r3=1566083941⋅T(begin[k]+begin[k+p]+begin[k−1])r4=r3−(kmodn)
and, in order,
update begin[k+p] by xoring it with r3,
update begin[k+q] by xoring it with r4,
and
set begin[k] to r4.Throws: What and when
RandomAccessIterator operations of
begin
and
end throw
. size_t size() const noexcept;
Returns: The number of 32-bit units
that would be returned
by a call to
param(). Complexity: Constant time
. template<class OutputIterator>
void param(OutputIterator dest) const;
Effects: Copies the sequence of prepared 32-bit units
to the given destination,
as if by executing the following statement:
copy(v.begin(), v.end(), dest);
Throws: What and when
OutputIterator operations of
dest throw
.