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_01_engine< RealType, w, p, q > Class Template Reference

Instantiations of class template lagged_fibonacci_01 model a . More...

#include <lagged_fibonacci.hpp>

Public Types

typedef RealType 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 (boost::uint32_t, default_seed=331u)
 
 lagged_fibonacci_01_engine ()
 Constructs a lagged_fibonacci_01 generator and calls seed(). More...
 
 BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR (lagged_fibonacci_01_engine, uint32_t, value)
 Constructs a lagged_fibonacci_01 generator and calls seed(value). More...
 
 BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR (lagged_fibonacci_01_engine, SeedSeq, seq)
 Constructs a lagged_fibonacci_01 generator and calls seed(gen). More...
 
template<class It >
 lagged_fibonacci_01_engine (It &first, It last)
 
void seed ()
 Calls seed(default_seed). More...
 
 BOOST_RANDOM_DETAIL_ARITHMETIC_SEED (lagged_fibonacci_01_engine, boost::uint32_t, value)
 Constructs a generator with the constructor parameter value and calls seed with it. More...
 
 BOOST_RANDOM_DETAIL_SEED_SEQ_SEED (lagged_fibonacci_01_engine, SeedSeq, seq)
 Seeds this lagged_fibonacci_01_engine using values produced by seq.generate. More...
 
template<class It >
void seed (It &first, It last)
 Seeds this lagged_fibonacci_01_engine using 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_01_engine, f)
 Writes the textual representation of the generator to a std::ostream. More...
 
 BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR (is, lagged_fibonacci_01_engine, f)
 Reads the textual representation of the generator from a std::istream. More...
 
 BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR (lagged_fibonacci_01_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 upper bound of the generators outputs. More...
 

Detailed Description

template<class RealType, int w, unsigned int p, unsigned int q>
class boost::random::lagged_fibonacci_01_engine< RealType, w, p, q >

Instantiations of class template lagged_fibonacci_01 model a .

It uses a lagged Fibonacci algorithm with two lags p and q, evaluated in floating-point arithmetic: x(i) = x(i-p) + x(i-q) (mod 1) with p > q. See

"Uniform random number generators for supercomputers", Richard Brent, Proc. of Fifth Australian Supercomputer Conference, Melbourne, Dec. 1992, pp. 704-706.

The quality of the generator crucially depends on the choice of the parameters. User code should employ one of the sensibly parameterized generators such as instead.

The generator requires considerable amounts of memory for the storage of its state array. For example, requires about 4856 bytes and requires about 350 KBytes.

Member Typedef Documentation

template<class RealType , int w, unsigned int p, unsigned int q>
typedef RealType boost::random::lagged_fibonacci_01_engine< RealType, w, p, q >::result_type

Constructor & Destructor Documentation

template<class RealType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_01_engine< RealType, w, p, q >::lagged_fibonacci_01_engine ( )
inline

Constructs a lagged_fibonacci_01 generator and calls seed().

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

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

Member Function Documentation

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

Returns the smallest value that the generator can produce.

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

Returns the upper bound of the generators outputs.

template<class RealType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_01_engine< RealType, w, p, q >::BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR ( lagged_fibonacci_01_engine< RealType, w, p, q >  ,
uint32_t  ,
value   
)
inline

Constructs a lagged_fibonacci_01 generator and calls seed(value).

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

template<class RealType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_01_engine< RealType, w, p, q >::BOOST_RANDOM_DETAIL_ARITHMETIC_SEED ( lagged_fibonacci_01_engine< RealType, w, p, q >  ,
boost::uint32_t  ,
value   
)
inline

Constructs a generator with the constructor parameter value and calls seed with it.

Distinct seeds in the range [1, 2147483647) will produce generators with different states. Other seeds will be equivalent to some seed within this range. See for details.

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

template<class RealType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_01_engine< RealType, w, p, q >::BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR ( lagged_fibonacci_01_engine< RealType, 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 RealType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_01_engine< RealType, w, p, q >::BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR ( is  ,
lagged_fibonacci_01_engine< RealType, w, p, q >  ,
 
)
inline

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

References boost::program_options::value().

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

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

References pow().

template<class RealType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_01_engine< RealType, w, p, q >::BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR ( lagged_fibonacci_01_engine< RealType, w, p, q >  ,
SeedSeq  ,
seq   
)
inline

Constructs a lagged_fibonacci_01 generator and calls seed(gen).

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

template<class RealType , int w, unsigned int p, unsigned int q>
boost::random::lagged_fibonacci_01_engine< RealType, w, p, q >::BOOST_RANDOM_DETAIL_SEED_SEQ_SEED ( lagged_fibonacci_01_engine< RealType, w, p, q >  ,
SeedSeq  ,
seq   
)
inline

Seeds this lagged_fibonacci_01_engine using values produced by seq.generate.

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

Advances the state of the generator by z.

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

Fills a range with random values.

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

Returns the next value of the generator.

References std::fill().

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

Seeds this lagged_fibonacci_01_engine using values from the iterator range [first, last).

If there are not enough elements in the range, throws std::invalid_argument.

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


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