![]() |
Home | Libraries | People | FAQ | More |
boost::random::lagged_fibonacci_engine
// In header: <boost/random/lagged_fibonacci.hpp> template<typename UIntType, w, p, q> class lagged_fibonacci_engine { public: // types typedef ; // construct/copy/destruct (); (); template<typename SeedSeq> (); template<typename It> (, ); // public static functions (); (); // public member functions (); (); template<typename SeedSeq> (); template<typename It> (, ); (); template<typename Iter> (, ); (); // friend functions template<typename CharT, typename Traits> (, lagged_fibonacci_engine &); template<typename CharT, typename Traits> (, lagged_fibonacci_engine &); (lagged_fibonacci_engine &, lagged_fibonacci_engine &); (lagged_fibonacci_engine &, lagged_fibonacci_engine &); // public data members static has_fixed_range; static word_size; static long_lag; static short_lag; static default_seed; };
Instantiations of class template lagged_fibonacci_engine model a pseudo-random number generator . It uses a lagged Fibonacci algorithm with two lags p
and q:
x(i) = x(i-p) + x(i-q) (mod 2w) with p > q.
lagged_fibonacci_engine
public
construct/copy/destruct();
Creates a new
and calls lagged_fibonacci_engine
seed()
.
( value);
Creates a new
and calls lagged_fibonacci_engine
seed(value)
.
template<typename SeedSeq> ( seq);
Creates a new
and calls lagged_fibonacci_engine
seed(seq)
.
template<typename It> ( first, last);
Creates a new
and calls lagged_fibonacci_engine
seed(first, last)
.
lagged_fibonacci_engine
public member functions();
Calls seed(default_seed)
.
( value);
Sets the state of the generator to values produced by a minstd_rand0
generator.
template<typename SeedSeq> ( seq);
Sets the state of the generator using values produced by seq.
template<typename It> ( first, last);
Sets the state of the generator to values from the iterator range [first, last). If there are not enough elements in the range [first, last) throws std::invalid_argument
.
();
Returns the next value of the generator.
template<typename Iter> ( first, last);
Fills a range with random values
( z);
Advances the state of the generator by z
.
lagged_fibonacci_engine
friend functionstemplate<typename CharT, typename Traits> ( os, lagged_fibonacci_engine & f);
Writes the textual representation of the generator to a std::ostream
.
template<typename CharT, typename Traits> ( is, lagged_fibonacci_engine & f);
Reads the textual representation of the generator from a std::istream
.
(lagged_fibonacci_engine & x_, lagged_fibonacci_engine & y_);
Returns true if the two generators will produce identical sequences of outputs.
(lagged_fibonacci_engine & lhs, lagged_fibonacci_engine & rhs);
Returns true if the two generators will produce different sequences of outputs.