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

The class template is a model of . More...

#include <discard_block.hpp>

Public Types

typedef
UniformRandomNumberGenerator 
base_type
 
typedef base_type::result_type result_type
 

Public Member Functions

 BOOST_STATIC_CONSTANT (std::size_t, block_size=p)
 
 BOOST_STATIC_CONSTANT (std::size_t, used_block=r)
 
 BOOST_STATIC_CONSTANT (bool, has_fixed_range=false)
 
 BOOST_STATIC_CONSTANT (std::size_t, total_block=p)
 
 BOOST_STATIC_CONSTANT (std::size_t, returned_block=r)
 
 BOOST_STATIC_ASSERT (total_block >=returned_block)
 
 discard_block_engine ()
 Uses the default seed for the base generator. More...
 
 discard_block_engine (const base_type &rng)
 Constructs a new with a copy of rng. More...
 
 discard_block_engine (base_type &&rng)
 Constructs a new with rng. More...
 
 BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR (discard_block_engine, seed_type, value)
 Creates a new and seeds the underlying generator with value. More...
 
 BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR (discard_block_engine, SeedSeq, seq)
 Creates a new and seeds the underlying generator with seq. More...
 
template<class It >
 discard_block_engine (It &first, It last)
 Creates a new and seeds the underlying generator with first and last. More...
 
void seed ()
 default seeds the underlying generator. More...
 
 BOOST_RANDOM_DETAIL_ARITHMETIC_SEED (discard_block_engine, seed_type, s)
 Seeds the underlying generator with s. More...
 
 BOOST_RANDOM_DETAIL_SEED_SEQ_SEED (discard_block_engine, SeedSeq, seq)
 Seeds the underlying generator with seq. More...
 
template<class It >
void seed (It &first, It last)
 Seeds the underlying generator with first and last. More...
 
const base_typebase () const
 Returns the underlying engine. More...
 
result_type operator() ()
 Returns the next value of the generator. More...
 
void discard (boost::uintmax_t z)
 
template<class It >
void generate (It first, It last)
 

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...
 

Friends

template<class CharT , class Traits >
std::basic_ostream< CharT,
Traits > & 
operator<< (std::basic_ostream< CharT, Traits > &os, const discard_block_engine &s)
 Writes a to a std::ostream. More...
 
template<class CharT , class Traits >
std::basic_istream< CharT,
Traits > & 
operator>> (std::basic_istream< CharT, Traits > &is, discard_block_engine &s)
 Reads a from a std::istream. More...
 
bool operator== (const discard_block_engine &x, const discard_block_engine &y)
 Returns true if the two generators will produce identical sequences. More...
 
bool operator!= (const discard_block_engine &x, const discard_block_engine &y)
 Returns true if the two generators will produce different sequences. More...
 

Detailed Description

template<class UniformRandomNumberGenerator, std::size_t p, std::size_t r>
class boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >

The class template is a model of .

It modifies another generator by discarding parts of its output. Out of every block of p results, the first r will be returned and the rest discarded.

Requires: 0 < p <= r

Member Typedef Documentation

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
typedef UniformRandomNumberGenerator boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::base_type
template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
typedef base_type::result_type boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::result_type

Constructor & Destructor Documentation

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::discard_block_engine ( )
inline

Uses the default seed for the base generator.

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::discard_block_engine ( const base_type rng)
inlineexplicit

Constructs a new with a copy of rng.

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::discard_block_engine ( base_type &&  rng)
inlineexplicit

Constructs a new with rng.

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
template<class It >
boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::discard_block_engine ( It &  first,
It  last 
)
inline

Creates a new and seeds the underlying generator with first and last.

Member Function Documentation

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
const base_type& boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::base ( ) const
inline

Returns the underlying engine.

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
static result_type min boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::BOOST_PREVENT_MACRO_SUBSTITUTION ( )
inlinestatic

Returns the smallest value that the generator can produce.

This is the same as the minimum of the underlying generator.

References boost::accumulators::extract::min.

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
static result_type max boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::BOOST_PREVENT_MACRO_SUBSTITUTION ( )
inlinestatic

Returns the largest value that the generator can produce.

This is the same as the maximum of the underlying generator.

References boost::accumulators::extract::max.

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR ( discard_block_engine< UniformRandomNumberGenerator, p, r >  ,
seed_type  ,
value   
)
inline

Creates a new and seeds the underlying generator with value.

References boost::program_options::value().

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::BOOST_RANDOM_DETAIL_ARITHMETIC_SEED ( discard_block_engine< UniformRandomNumberGenerator, p, r >  ,
seed_type  ,
 
)
inline

Seeds the underlying generator with s.

References boost::asio::s.

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR ( discard_block_engine< UniformRandomNumberGenerator, p, r >  ,
SeedSeq  ,
seq   
)
inline

Creates a new and seeds the underlying generator with seq.

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::BOOST_RANDOM_DETAIL_SEED_SEQ_SEED ( discard_block_engine< UniformRandomNumberGenerator, p, r >  ,
SeedSeq  ,
seq   
)
inline

Seeds the underlying generator with seq.

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::BOOST_STATIC_ASSERT ( total_block >=  returned_block)
template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::BOOST_STATIC_CONSTANT ( std::size_t  ,
block_size  = p 
)
template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::BOOST_STATIC_CONSTANT ( std::size_t  ,
used_block  = r 
)
template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::BOOST_STATIC_CONSTANT ( bool  ,
has_fixed_range  = false 
)
template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::BOOST_STATIC_CONSTANT ( std::size_t  ,
total_block  = p 
)
template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::BOOST_STATIC_CONSTANT ( std::size_t  ,
returned_block  = r 
)
template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
void boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::discard ( boost::uintmax_t  z)
inline
template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
template<class It >
void boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::generate ( It  first,
It  last 
)
inline
template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
result_type boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::operator() ( )
inline

Returns the next value of the generator.

References boost::multiprecision::backends::i.

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
void boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::seed ( )
inline

default seeds the underlying generator.

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
template<class It >
void boost::random::discard_block_engine< UniformRandomNumberGenerator, p, r >::seed ( It &  first,
It  last 
)
inline

Seeds the underlying generator with first and last.

Friends And Related Function Documentation

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
bool operator!= ( const discard_block_engine< UniformRandomNumberGenerator, p, r > &  x,
const discard_block_engine< UniformRandomNumberGenerator, p, r > &  y 
)
friend

Returns true if the two generators will produce different sequences.

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
template<class CharT , class Traits >
std::basic_ostream<CharT,Traits>& operator<< ( std::basic_ostream< CharT, Traits > &  os,
const discard_block_engine< UniformRandomNumberGenerator, p, r > &  s 
)
friend

Writes a to a std::ostream.

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
bool operator== ( const discard_block_engine< UniformRandomNumberGenerator, p, r > &  x,
const discard_block_engine< UniformRandomNumberGenerator, p, r > &  y 
)
friend

Returns true if the two generators will produce identical sequences.

template<class UniformRandomNumberGenerator , std::size_t p, std::size_t r>
template<class CharT , class Traits >
std::basic_istream<CharT,Traits>& operator>> ( std::basic_istream< CharT, Traits > &  is,
discard_block_engine< UniformRandomNumberGenerator, p, r > &  s 
)
friend

Reads a from a std::istream.


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