![]() |
Home | Libraries | People | FAQ | More |
boost::random::discard_block_engine
// In header: <boost/random/discard_block.hpp> template<typename UniformRandomNumberGenerator, p, r> class discard_block_engine { public: // types typedef UniformRandomNumberGenerator ; typedef base_type::result_type ; // construct/copy/destruct (); (const base_type &); (base_type &&); (); template<typename SeedSeq> (SeedSeq &); template<typename It> (It &, It); // public member functions void (); void (); template<typename SeedSeq> void (SeedSeq &); template<typename It> void (It &, It); const base_type & () ; result_type (); void (boost::uintmax_t); template<typename It> void (It, It); // public static functions constexpr result_type (); constexpr result_type (); // friend functions template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const discard_block_engine &); template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, discard_block_engine &); bool (const discard_block_engine &, const discard_block_engine &); bool (const discard_block_engine &, const discard_block_engine &); // public data members static const block_size; static const used_block; static const bool has_fixed_range; static const total_block; static const returned_block; };
The class template discard_block_engine is a model of pseudo-random number generator . 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
discard_block_engine
public
construct/copy/destruct();
Uses the default seed for the base generator.
(const base_type & rng);
Constructs a new discard_block_engine
with a copy of rng.
(base_type && rng);
Constructs a new discard_block_engine
with rng.
( value);
Creates a new discard_block_engine
and seeds the underlying generator with value
template<typename SeedSeq> (SeedSeq & seq);
Creates a new discard_block_engine
and seeds the underlying generator with seq
template<typename It> (It & first, It last);
Creates a new discard_block_engine
and seeds the underlying generator with first and last.
discard_block_engine
public member functionsvoid ();
default seeds the underlying generator.
void ( s);
Seeds the underlying generator with s.
template<typename SeedSeq> void (SeedSeq & seq);
Seeds the underlying generator with seq.
template<typename It> void (It & first, It last);
Seeds the underlying generator with first and last.
const base_type & () ;
Returns the underlying engine.
result_type ();
Returns the next value of the generator.
void (boost::uintmax_t z);
template<typename It> void (It first, It last);
discard_block_engine
public static functionsconstexpr result_type ();
Returns the smallest value that the generator can produce. This is the same as the minimum of the underlying generator.
constexpr result_type ();
Returns the largest value that the generator can produce. This is the same as the maximum of the underlying generator.
discard_block_engine
friend functionstemplate<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > & os, const discard_block_engine & s);
Writes a discard_block_engine
to a std::ostream
.
template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > & is, discard_block_engine & s);
Reads a discard_block_engine
from a std::istream
.
bool (const discard_block_engine & x, const discard_block_engine & y);
Returns true if the two generators will produce identical sequences.
bool (const discard_block_engine & x, const discard_block_engine & y);
Returns true if the two generators will produce different sequences.