![]() |
Home | Libraries | People | FAQ | More |
boost::random::independent_bits_engine
// In header: <boost/random/independent_bits.hpp> template<typename Engine, w, typename UIntType> class independent_bits_engine { public: // types typedef Engine ; typedef UIntType ; typedef ; // construct/copy/destruct (); (); template<typename SeedSeq> (SeedSeq &); (const base_type &); template<typename It> (It &, It); // public static functions constexpr result_type (); constexpr result_type (); // public member functions void (); void (); template<typename SeedSeq> void (SeedSeq &); template<typename It> void (It &, It); result_type (); template<typename Iter> void (Iter, Iter); void (boost::uintmax_t); const base_type & () ; // friend functions template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const independent_bits_engine &); template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const independent_bits_engine &); bool (const independent_bits_engine &, const independent_bits_engine &); bool (const independent_bits_engine &, const independent_bits_engine &); // public data members static const bool has_fixed_range; };
An instantiation of class template independent_bits_engine
model a pseudo-random number generator . It generates random numbers distributed between [0, 2^w) by combining one or more invocations of the base engine.
Requires: 0 < w <= std::numeric_limits<UIntType>::digits
independent_bits_engine
public
construct/copy/destruct();
Constructs an
using the default constructor of the base generator. independent_bits_engine
( seed);
Constructs an
, using seed as the constructor argument for both base generators. independent_bits_engine
template<typename SeedSeq> (SeedSeq & seq);
Constructs an
, using seq as the constructor argument for the base generator. independent_bits_engine
(const base_type & base_arg);
Constructs an
by copying independent_bits_engine
base
.
template<typename It> (It & first, It last);
Contructs an
with values from the range defined by the input iterators first and last. first will be modified to point to the element after the last one used.independent_bits_engine
Throws: std::invalid_argument
if the input range is too small.
Exception Safety: Basic
independent_bits_engine
public static functionsconstexpr result_type ();
Returns the smallest value that the generator can produce.
constexpr result_type ();
Returns the largest value that the generator can produce.
independent_bits_engine
public member functionsvoid ();
Seeds an
using the default seed of the base generator. independent_bits_engine
void ( seed);
Seeds an
, using independent_bits_engine
seed
as the seed for the base generator.
template<typename SeedSeq> void (SeedSeq & seq);
Seeds an
, using independent_bits_engine
seq
to seed the base generator.
template<typename It> void (It & first, It last);
Seeds an
with values from the range defined by the input iterators first and last. first will be modified to point to the element after the last one used.independent_bits_engine
Throws: std::invalid_argument
if the input range is too small.
Exception Safety: Basic
result_type ();
Returns the next value of the generator.
template<typename Iter> void (Iter first, Iter last);
Fills a range with random values
void (boost::uintmax_t z);
Advances the state of the generator by z
.
const base_type & () ;
independent_bits_engine
friend functionstemplate<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > & os, const independent_bits_engine & r);
Writes the textual representation if the generator to a std::ostream
. The textual representation of the engine is the textual representation of the base engine.
template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > & is, const independent_bits_engine & r);
Reads the state of an
from a independent_bits_engine
std::istream
.
bool (const independent_bits_engine & x, const independent_bits_engine & y);
Returns: true iff the two independent_bits_engines
will produce the same sequence of values.
bool (const independent_bits_engine & lhs, const independent_bits_engine & rhs);
Returns: true iff the two independent_bits_engines
will produce different sequences of values.