Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::random::lagged_fibonacci_engine< UIntType, w, p, q > Class Template Reference

Instantiations of class template model a . More...

#include <lagged_fibonacci.hpp>

Public Types

typedef UIntType result_type
 

Public Member Functions

 BOOST_STATIC_CONSTANT (bool, has_fixed_range=false)
 
 BOOST_STATIC_CONSTANT (int, word_size=w)
 
 BOOST_STATIC_CONSTANT (unsigned int, long_lag=p)
 
 BOOST_STATIC_CONSTANT (unsigned int, short_lag=q)
 
 BOOST_STATIC_CONSTANT (UIntType, default_seed=331u)
 
 lagged_fibonacci_engine ()
 Creates a new lagged_fibonacci_engine and calls seed(). More...
 
 BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR (lagged_fibonacci_engine, UIntType, value)
 Creates a new lagged_fibonacci_engine and calls seed(value). More...
 
 BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR (lagged_fibonacci_engine, SeedSeq, seq)
 Creates a new lagged_fibonacci_engine and calls seed(seq). More...
 
template<class It >
 lagged_fibonacci_engine (It &first, It last)
 Creates a new lagged_fibonacci_engine and calls seed(first, last). More...
 
void seed ()
 Calls seed(default_seed). More...
 
 BOOST_RANDOM_DETAIL_ARITHMETIC_SEED (lagged_fibonacci_engine, UIntType, value)
 Sets the state of the generator to values produced by a generator. More...
 
 BOOST_RANDOM_DETAIL_SEED_SEQ_SEED (lagged_fibonacci_engine, SeedSeq, seq)
 Sets the state of the generator using values produced by seq. More...
 
template<class It >
void seed (It &first, It last)
 Sets the state of the generator to values from the iterator range [first, last). More...
 
result_type operator() ()
 Returns the next value of the generator. More...
 
template<class Iter >
void generate (Iter first, Iter last)
 Fills a range with random values. More...
 
void discard (boost::uintmax_t z)
 Advances the state of the generator by z. More...
 
 BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR (os, lagged_fibonacci_engine, f)
 Writes the textual representation of the generator to a std::ostream. More...
 
 BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR (is, lagged_fibonacci_engine, f)
 Reads the textual representation of the generator from a std::istream. More...
 
 BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR (lagged_fibonacci_engine, x_, y_)
 Returns true if the two generators will produce identical sequences of outputs. More...
 

Static Public Member Functions

static result_type min BOOST_PREVENT_MACRO_SUBSTITUTION ()
 Returns the smallest value that the generator can produce. More...
 
static result_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
 Returns the largest value that the generator can produce. More...
 

Detailed Description

template<class UIntType, int w, unsigned int p, unsigned int q>
class boost::random::lagged_fibonacci_engine< UIntType, w, p, q >

Instantiations of class template model a .

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.

Member Typedef Documentation

template<class UIntType , int w, unsigned int p, unsigned int q>
typedef UIntType boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::result_type

Constructor & Destructor Documentation

template<class UIntType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::lagged_fibonacci_engine ( )
inline
template<class UIntType , int w, unsigned int p, unsigned int q>
template<class It >
boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::lagged_fibonacci_engine ( It &  first,
It  last 
)
inline

Member Function Documentation

template<class UIntType , int w, unsigned int p, unsigned int q>
static result_type min boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::BOOST_PREVENT_MACRO_SUBSTITUTION ( )
inlinestatic

Returns the smallest value that the generator can produce.

template<class UIntType , int w, unsigned int p, unsigned int q>
static result_type max boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::BOOST_PREVENT_MACRO_SUBSTITUTION ( )
inlinestatic

Returns the largest value that the generator can produce.

template<class UIntType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR ( lagged_fibonacci_engine< UIntType, w, p, q >  ,
UIntType  ,
value   
)
inline
template<class UIntType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::BOOST_RANDOM_DETAIL_ARITHMETIC_SEED ( lagged_fibonacci_engine< UIntType, w, p, q >  ,
UIntType  ,
value   
)
inline

Sets the state of the generator to values produced by a generator.

References boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::seed(), and boost::program_options::value().

template<class UIntType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR ( lagged_fibonacci_engine< UIntType, w, p, q >  ,
x_  ,
y_   
)
inline

Returns true if the two generators will produce identical sequences of outputs.

References boost::algorithm::detail::equal().

template<class UIntType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR ( is  ,
lagged_fibonacci_engine< UIntType, w, p, q >  ,
 
)
inline

Reads the textual representation of the generator from a std::istream.

template<class UIntType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR ( os  ,
lagged_fibonacci_engine< UIntType, w, p, q >  ,
 
)
inline

Writes the textual representation of the generator to a std::ostream.

template<class UIntType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR ( lagged_fibonacci_engine< UIntType, w, p, q >  ,
SeedSeq  ,
seq   
)
inline
template<class UIntType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::BOOST_RANDOM_DETAIL_SEED_SEQ_SEED ( lagged_fibonacci_engine< UIntType, w, p, q >  ,
SeedSeq  ,
seq   
)
inline

Sets the state of the generator using values produced by seq.

template<class UIntType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::BOOST_STATIC_CONSTANT ( bool  ,
has_fixed_range  = false 
)
template<class UIntType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::BOOST_STATIC_CONSTANT ( int  ,
word_size  = w 
)
template<class UIntType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::BOOST_STATIC_CONSTANT ( unsigned  int,
long_lag  = p 
)
template<class UIntType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::BOOST_STATIC_CONSTANT ( unsigned  int,
short_lag  = q 
)
template<class UIntType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::BOOST_STATIC_CONSTANT ( UIntType  ,
default_seed  = 331u 
)
template<class UIntType , int w, unsigned int p, unsigned int q>
void boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::discard ( boost::uintmax_t  z)
inline

Advances the state of the generator by z.

template<class UIntType , int w, unsigned int p, unsigned int q>
template<class Iter >
void boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::generate ( Iter  first,
Iter  last 
)
inline

Fills a range with random values.

template<class UIntType , int w, unsigned int p, unsigned int q>
result_type boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::operator() ( )
inline

Returns the next value of the generator.

References std::fill().

template<class UIntType , int w, unsigned int p, unsigned int q>
template<class It >
void boost::random::lagged_fibonacci_engine< UIntType, w, p, q >::seed ( It &  first,
It  last 
)
inline

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.

References boost::xpressive::first, and boost::last.


The documentation for this class was generated from the following file: