![]() |
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> (, ); template<typename CharT, typename Traits> (, ); (, ); (, ); // 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_engineseed().
( value);
Creates a new and calls lagged_fibonacci_engineseed(value).
template<typename SeedSeq> ( seq);
Creates a new and calls lagged_fibonacci_engineseed(seq).
template<typename It> ( first, last);
Creates a new and calls lagged_fibonacci_engineseed(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, f);
Writes the textual representation of the generator to a std::ostream.
template<typename CharT, typename Traits> ( is, f);
Reads the textual representation of the generator from a std::istream.
( x_, y_);
Returns true if the two generators will produce identical sequences of outputs.
( lhs, rhs);
Returns true if the two generators will produce different sequences of outputs.