![]() |
Home | Libraries | People | FAQ | More |
boost::random::linear_feedback_shift_engine
// In header: <boost/random/linear_feedback_shift.hpp> template<typename UIntType, w, k, q, s> class linear_feedback_shift_engine { public: // types typedef UIntType ; // construct/copy/destruct (); (UIntType); template<typename SeedSeq> (SeedSeq &); template<typename It> (It &, It); // public static functions constexpr result_type (); constexpr result_type (); // public member functions void (); void (UIntType); template<typename SeedSeq> void (SeedSeq &); template<typename It> void (It &, It); result_type (); template<typename Iter> void (Iter, Iter); void (boost::uintmax_t); // friend functions template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const linear_feedback_shift_engine &); template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const linear_feedback_shift_engine &); bool (const linear_feedback_shift_engine &, const linear_feedback_shift_engine &); bool (const linear_feedback_shift_engine &, const linear_feedback_shift_engine &); // public data members static const bool has_fixed_range; static const int word_size; static const int exponent1; static const int exponent2; static const int step_size; static const UIntType default_seed; };
Instatiations of linear_feedback_shift
model a pseudo-random number generator . It was originally proposed in
"Random numbers generated by linear recurrence modulo two.", Tausworthe, R. C.(1965), Mathematics of Computation 19, 201-209.
linear_feedback_shift_engine
public
construct/copy/destruct();
Constructs a
, using the default seed. linear_feedback_shift_engine
(UIntType s0);
Constructs a
, seeding it with s0. linear_feedback_shift_engine
template<typename SeedSeq> (SeedSeq & seq);
Constructs a
, seeding it with seq. linear_feedback_shift_engine
template<typename It> (It & first, It last);
Constructs a
, seeding it with values from the range [first, last). linear_feedback_shift_engine
linear_feedback_shift_engine
public static functionsconstexpr result_type ();
Returns the smallest value that the generator can produce.
constexpr result_type ();
Returns the largest value that the generator can produce.
linear_feedback_shift_engine
public member functionsvoid ();
Seeds a
with the default seed. linear_feedback_shift_engine
void (UIntType s0);
Seeds a
with linear_feedback_shift_engine
s0
.
template<typename SeedSeq> void (SeedSeq & seq);
Seeds a
with values produced by linear_feedback_shift_engine
seq.generate()
.
template<typename It> void (It & first, It last);
Seeds a
with values from the range [first, last). linear_feedback_shift_engine
result_type ();
Returns the next value of the generator.
template<typename Iter> void (Iter first, Iter last);
Fills a range with random values
void (boost::uintmax_t z);
Advances the state of the generator by z
.
linear_feedback_shift_engine
friend functionstemplate<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > & os, const linear_feedback_shift_engine & x);
Writes the textual representation of the generator to a std::ostream
.
template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > & is, const linear_feedback_shift_engine & x);
Reads the textual representation of the generator from a std::istream
.
bool (const linear_feedback_shift_engine & x, const linear_feedback_shift_engine & y);
Returns true if the two generators will produce identical sequences of outputs.
bool (const linear_feedback_shift_engine & lhs, const linear_feedback_shift_engine & rhs);
Returns true if the two generators will produce different sequences of outputs.