![]() |
Home | Libraries | People | FAQ | More |
boost::random::subtract_with_carry_01_engine
// In header: <boost/random/subtract_with_carry.hpp> template<typename RealType, w, s, r> class subtract_with_carry_01_engine { public: // types typedef RealType ; // construct/copy/destruct (); (boost::uint32_t); template<typename SeedSeq> (SeedSeq &); template<typename It> (It &, It); // public member functions void (); void (boost::uint32_t); template<typename SeedSeq> void (SeedSeq &); template<typename It> void (It &, It); result_type (); void (boost::uintmax_t); template<typename Iter> void (Iter, Iter); // public static functions constexpr result_type (); constexpr result_type (); // friend functions template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const subtract_with_carry_01_engine &); template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const subtract_with_carry_01_engine &); bool (const subtract_with_carry_01_engine &, const subtract_with_carry_01_engine &); bool (const subtract_with_carry_01_engine &, const subtract_with_carry_01_engine &); // public data members static const bool has_fixed_range; static const word_size; static const long_lag; static const short_lag; static const boost::uint32_t default_seed; };
Instantiations of subtract_with_carry_01_engine model a pseudo-random number generator . 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.
subtract_with_carry_01_engine
public
construct/copy/destruct();
Creates a new subtract_with_carry_01_engine
using the default seed.
(boost::uint32_t value);
Creates a new subtract_with_carry_01_engine
and seeds it with value.
template<typename SeedSeq> (SeedSeq & seq);
Creates a new subtract_with_carry_01_engine
and seeds with values produced by seq.generate().
template<typename It> (It & first, It last);
Creates a new subtract_with_carry_01_engine
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
.
subtract_with_carry_01_engine
public member functionsvoid ();
Seeds the generator with the default seed.
void (boost::uint32_t value);
Seeds the generator with value
.
template<typename SeedSeq> void (SeedSeq & seq);
Seeds the generator with values produced by seq.generate()
.
template<typename It> void (It & first, It last);
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
.
result_type ();
Returns the next value of the generator.
void (boost::uintmax_t z);
Advances the state of the generator by z
.
template<typename Iter> void (Iter first, Iter last);
Fills a range with random values.
subtract_with_carry_01_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.
subtract_with_carry_01_engine
friend functionstemplate<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > & os, const subtract_with_carry_01_engine & f);
Writes a subtract_with_carry_01_engine
to a std::ostream
.
template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > & is, const subtract_with_carry_01_engine & f);
Reads a subtract_with_carry_01_engine
from a std::istream
.
bool (const subtract_with_carry_01_engine & x, const subtract_with_carry_01_engine & y);
Returns true if the two generators will produce identical sequences.
bool (const subtract_with_carry_01_engine & lhs, const subtract_with_carry_01_engine & rhs);
Returns true if the two generators will produce different sequences.