class template
<random>

std::subtract_with_carry_engine

template <class UIntType, size_t w, size_t s, size_t r>class subtract_with_carry_engine;
Subtract-with-carry random number engine
A pseudo-random number generator engine that produces unsigned integer numbers.

The algorithm used by this engine is a lagged fibonacci generator, with a state sequence of r integer elements, plus one carry value.

Template parameters

UIntType
An unsigned integer type.
Values produced by the engine are of this type.
w
Word size: Number of bits of each word in the state sequence.
This parameter should be greater than zero and lower than numeric_limits<UIntType>::digits.
s
Short lag: Number of elements between advances.
This parameter should be greater than zero and lower than r.
r
Long lag: Distance between operand values. This determines the degree of recurrence in the generated series.

Template instantiations


Member types

The following alias is a member type of subtract_with_carry_engine:

member typedefinitionnotes
result_typeThe first template parameter (UIntType)The type of the numbers generated.

Member functions


Non-member functions


Member constexpr constants

member constantdefinitionnotes
word_sizeThe second template parameter (w)The number of bits of each word in the state sequence.
short_lagThe third template parameter (s)The short lag value.
long_lagThe fourth template parameter (r)The long lag value.
default_seed19780503uThe default seed used on construction or seeding.

See also