Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::random::subtract_with_carry_01_engine< RealType, w, s, r > Class Template Reference

Instantiations of model a . More...

#include <subtract_with_carry.hpp>

Public Types

typedef RealType result_type
 

Public Member Functions

 BOOST_STATIC_CONSTANT (bool, has_fixed_range=false)
 
 BOOST_STATIC_CONSTANT (std::size_t, word_size=w)
 
 BOOST_STATIC_CONSTANT (std::size_t, long_lag=r)
 
 BOOST_STATIC_CONSTANT (std::size_t, short_lag=s)
 
 BOOST_STATIC_CONSTANT (boost::uint32_t, default_seed=19780503u)
 
 BOOST_STATIC_ASSERT (!std::numeric_limits< result_type >::is_integer)
 
 subtract_with_carry_01_engine ()
 Creates a new using the default seed. More...
 
 BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR (subtract_with_carry_01_engine, boost::uint32_t, value)
 Creates a new subtract_with_carry_01_engine and seeds it with value. More...
 
 BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR (subtract_with_carry_01_engine, SeedSeq, seq)
 Creates a new and seeds with values produced by seq.generate(). More...
 
template<class It >
 subtract_with_carry_01_engine (It &first, It last)
 Creates a new and seeds it with values from a range. More...
 
void seed ()
 Seeds the generator with the default seed. More...
 
 BOOST_RANDOM_DETAIL_ARITHMETIC_SEED (subtract_with_carry_01_engine, boost::uint32_t, value)
 Seeds the generator with value. More...
 
 BOOST_RANDOM_DETAIL_SEED_SEQ_SEED (subtract_with_carry_01_engine, SeedSeq, seq)
 Seeds the generator with values produced by seq.generate(). More...
 
template<class It >
void seed (It &first, It last)
 Seeds the generator with values from a range. More...
 
result_type operator() ()
 Returns the next value of the generator. More...
 
void discard (boost::uintmax_t z)
 Advances the state of the generator by z. More...
 
template<class Iter >
void generate (Iter first, Iter last)
 Fills a range with random values. More...
 
 BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR (os, subtract_with_carry_01_engine, f)
 Writes a to a std::ostream. More...
 
 BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR (is, subtract_with_carry_01_engine, f)
 Reads a from a std::istream. More...
 
 BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR (subtract_with_carry_01_engine, x, y)
 Returns true if the two generators will produce identical sequences. 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 RealType, std::size_t w, std::size_t s, std::size_t r>
class boost::random::subtract_with_carry_01_engine< RealType, w, s, r >

Instantiations of model a .

The algorithm is described in

"A New Class of Random Number Generators", George Marsaglia and Arif Zaman, Annals of Applied Probability, Volume 1, Number 3 (1991), 462-480.

Member Typedef Documentation

template<class RealType , std::size_t w, std::size_t s, std::size_t r>
typedef RealType boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::result_type

Constructor & Destructor Documentation

template<class RealType , std::size_t w, std::size_t s, std::size_t r>
boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::subtract_with_carry_01_engine ( )
inline

Creates a new using the default seed.

References boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::seed().

template<class RealType , std::size_t w, std::size_t s, std::size_t r>
template<class It >
boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::subtract_with_carry_01_engine ( It &  first,
It  last 
)
inline

Creates a new and seeds it with values from a range.

Advances first to point one past the last consumed value. If the range does not contain enough elements to fill the entire state, throws std::invalid_argument.

References boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::seed().

Member Function Documentation

template<class RealType , std::size_t w, std::size_t s, std::size_t r>
static result_type min boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::BOOST_PREVENT_MACRO_SUBSTITUTION ( )
inlinestatic

Returns the smallest value that the generator can produce.

template<class RealType , std::size_t w, std::size_t s, std::size_t r>
static result_type max boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::BOOST_PREVENT_MACRO_SUBSTITUTION ( )
inlinestatic

Returns the largest value that the generator can produce.

template<class RealType , std::size_t w, std::size_t s, std::size_t r>
boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR ( subtract_with_carry_01_engine< RealType, w, s, r >  ,
boost::uint32_t  ,
value   
)
inline
template<class RealType , std::size_t w, std::size_t s, std::size_t r>
boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::BOOST_RANDOM_DETAIL_ARITHMETIC_SEED ( subtract_with_carry_01_engine< RealType, w, s, r >  ,
boost::uint32_t  ,
value   
)
inline
template<class RealType , std::size_t w, std::size_t s, std::size_t r>
boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR ( subtract_with_carry_01_engine< RealType, w, s, r >  ,
,
 
)
inline

Returns true if the two generators will produce identical sequences.

References boost::polygon::y().

template<class RealType , std::size_t w, std::size_t s, std::size_t r>
boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR ( is  ,
subtract_with_carry_01_engine< RealType, w, s, r >  ,
 
)
inline

Reads a from a std::istream.

References boost::program_options::value().

template<class RealType , std::size_t w, std::size_t s, std::size_t r>
boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR ( os  ,
subtract_with_carry_01_engine< RealType, w, s, r >  ,
 
)
inline

Writes a to a std::ostream.

template<class RealType , std::size_t w, std::size_t s, std::size_t r>
boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR ( subtract_with_carry_01_engine< RealType, w, s, r >  ,
SeedSeq  ,
seq   
)
inline

Creates a new and seeds with values produced by seq.generate().

References boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::seed().

template<class RealType , std::size_t w, std::size_t s, std::size_t r>
boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::BOOST_RANDOM_DETAIL_SEED_SEQ_SEED ( subtract_with_carry_01_engine< RealType, w, s, r >  ,
SeedSeq  ,
seq   
)
inline

Seeds the generator with values produced by seq.generate().

template<class RealType , std::size_t w, std::size_t s, std::size_t r>
boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::BOOST_STATIC_ASSERT ( !std::numeric_limits< result_type >::is_integer  )
template<class RealType , std::size_t w, std::size_t s, std::size_t r>
boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::BOOST_STATIC_CONSTANT ( bool  ,
has_fixed_range  = false 
)
template<class RealType , std::size_t w, std::size_t s, std::size_t r>
boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::BOOST_STATIC_CONSTANT ( std::size_t  ,
word_size  = w 
)
template<class RealType , std::size_t w, std::size_t s, std::size_t r>
boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::BOOST_STATIC_CONSTANT ( std::size_t  ,
long_lag  = r 
)
template<class RealType , std::size_t w, std::size_t s, std::size_t r>
boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::BOOST_STATIC_CONSTANT ( std::size_t  ,
short_lag  = s 
)
template<class RealType , std::size_t w, std::size_t s, std::size_t r>
boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::BOOST_STATIC_CONSTANT ( boost::uint32_t  ,
default_seed  = 19780503u 
)
template<class RealType , std::size_t w, std::size_t s, std::size_t r>
void boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::discard ( boost::uintmax_t  z)
inline

Advances the state of the generator by z.

References boost::random::detail::subtract_with_carry_discard::apply().

template<class RealType , std::size_t w, std::size_t s, std::size_t r>
template<class Iter >
void boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::generate ( Iter  first,
Iter  last 
)
inline

Fills a range with random values.

template<class RealType , std::size_t w, std::size_t s, std::size_t r>
result_type boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::operator() ( )
inline

Returns the next value of the generator.

template<class RealType , std::size_t w, std::size_t s, std::size_t r>
template<class It >
void boost::random::subtract_with_carry_01_engine< RealType, w, s, r >::seed ( It &  first,
It  last 
)
inline

Seeds the generator with values from a range.

Updates first to point one past the last consumed element. If there are not enough elements in the range to fill the entire state, throws std::invalid_argument.

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


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