![]() |
Home | Libraries | People | FAQ | More |
boost::random::xor_combine_engine
// In header: <boost/random/xor_combine.hpp> template<typename URNG1, s1, typename URNG2, s2> class xor_combine_engine { public: // types typedef ; typedef ; typedef ; // construct/copy/destruct (); (, ); (); template<typename SeedSeq> (); template<typename It> (, ); // public member functions (); (); template<typename SeedSeq> (); template<typename It> (, ); () ; () ; (); template<typename Iter> (, ); (); // public static functions (); (); // friend functions template<typename CharT, typename Traits> (, ); template<typename CharT, typename Traits> (, ); (, ); (, ); // public data members static has_fixed_range; static shift1; static shift2; };
Instantiations of xor_combine_engine model a pseudo-random number generator . To produce its output it invokes each of the base generators, shifts their results and xors them together.
xor_combine_engine
public
construct/copy/destruct();
Constructors a by default constructing both base generators. xor_combine_engine
( rng1, rng2);
Constructs a xor_combine by copying two base generators.
( v);
Constructs a , seeding both base generators with xor_combine_enginev.
![]() |
Warning |
|---|---|
The exact algorithm used by this function may change in the future. |
template<typename SeedSeq> ( seq);
Constructs a , seeding both base generators with values produced by xor_combine_engineseq.
template<typename It> ( first, last);
Constructs a , seeding both base generators with values from the iterator range [first, last) and changes first to point to the element after the last one used. If there are not enough elements in the range to seed both generators, throws xor_combine_enginestd::invalid_argument.
xor_combine_engine public member functions();
Calls seed() for both base generators.
( v);
seeds both base generators with v.
template<typename SeedSeq> ( seq);
seeds both base generators with values produced by seq.
template<typename It> ( first, last);
seeds both base generators with values from the iterator range [first, last) and changes first to point to the element after the last one used. If there are not enough elements in the range to seed both generators, throws std::invalid_argument.
() ;
Returns the first base generator.
() ;
Returns the second base generator.
();
Returns the next value of the generator.
template<typename Iter> ( first, last);
Fills a range with random values
( z);
Advances the state of the generator by z.
xor_combine_engine friend functionstemplate<typename CharT, typename Traits> ( os, s);
Writes the textual representation of the generator to a std::ostream.
template<typename CharT, typename Traits> ( is, s);
Reads the textual representation of the generator from a std::istream.
( x, y);
Returns true if the two generators will produce identical sequences.
( lhs, rhs);
Returns true if the two generators will produce different sequences.