Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 > Class Template Reference

Instantiations of xor_combine_engine model a . More...

#include <xor_combine.hpp>

Public Types

typedef URNG1 base1_type
 
typedef URNG2 base2_type
 
typedef base1_type::result_type result_type
 

Public Member Functions

 BOOST_STATIC_CONSTANT (bool, has_fixed_range=false)
 
 BOOST_STATIC_CONSTANT (int, shift1=s1)
 
 BOOST_STATIC_CONSTANT (int, shift2=s2)
 
 xor_combine_engine ()
 Constructors a xor_combine_engine by default constructing both base generators. More...
 
 xor_combine_engine (const base1_type &rng1, const base2_type &rng2)
 Constructs a xor_combine by copying two base generators. More...
 
 BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR (xor_combine_engine, result_type, v)
 Constructs a xor_combine_engine, seeding both base generators with v. More...
 
 BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR (xor_combine_engine, SeedSeq, seq)
 Constructs a xor_combine_engine, seeding both base generators with values produced by seq. More...
 
template<class It >
 xor_combine_engine (It &first, It last)
 Constructs a xor_combine_engine, 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. More...
 
void seed ()
 Calls seed() for both base generators. More...
 
 BOOST_RANDOM_DETAIL_ARITHMETIC_SEED (xor_combine_engine, result_type, v)
 seeds both base generators with v. More...
 
 BOOST_RANDOM_DETAIL_SEED_SEQ_SEED (xor_combine_engine, SeedSeq, seq)
 seeds both base generators with values produced by seq. More...
 
template<class It >
void seed (It &first, It 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. More...
 
const base1_typebase1 () const
 Returns the first base generator. More...
 
const base2_typebase2 () const
 Returns the second base generator. More...
 
result_type operator() ()
 Returns the next value of the generator. More...
 
template<class Iter >
void generate (Iter first, Iter last)
 Fills a range with random values. More...
 
void discard (boost::uintmax_t z)
 Advances the state of the generator by z. More...
 
 BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR (os, xor_combine_engine, s)
 Writes the textual representation of the generator to a std::ostream. More...
 
 BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR (is, xor_combine_engine, s)
 Reads the textual representation of the generator from a std::istream. More...
 
 BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR (xor_combine_engine, x, y)
 Returns true if the two generators will produce identical sequences. More...
 

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

Detailed Description

template<class URNG1, int s1, class URNG2, int s2>
class boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >

Instantiations of xor_combine_engine model a .

To produce its output it invokes each of the base generators, shifts their results and xors them together.

Member Typedef Documentation

template<class URNG1 , int s1, class URNG2 , int s2>
typedef URNG1 boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::base1_type
template<class URNG1 , int s1, class URNG2 , int s2>
typedef URNG2 boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::base2_type
template<class URNG1 , int s1, class URNG2 , int s2>
typedef base1_type::result_type boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::result_type

Constructor & Destructor Documentation

template<class URNG1 , int s1, class URNG2 , int s2>
boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::xor_combine_engine ( )
inline

Constructors a xor_combine_engine by default constructing both base generators.

template<class URNG1 , int s1, class URNG2 , int s2>
boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::xor_combine_engine ( const base1_type rng1,
const base2_type rng2 
)
inline

Constructs a xor_combine by copying two base generators.

template<class URNG1 , int s1, class URNG2 , int s2>
template<class It >
boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::xor_combine_engine ( It &  first,
It  last 
)
inline

Constructs a xor_combine_engine, 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 std::invalid_argument.

Member Function Documentation

template<class URNG1 , int s1, class URNG2 , int s2>
const base1_type& boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::base1 ( ) const
inline

Returns the first base generator.

template<class URNG1 , int s1, class URNG2 , int s2>
const base2_type& boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::base2 ( ) const
inline

Returns the second base generator.

template<class URNG1 , int s1, class URNG2 , int s2>
static result_type min boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::BOOST_PREVENT_MACRO_SUBSTITUTION ( )
inlinestatic

Returns the smallest value that the generator can produce.

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

template<class URNG1 , int s1, class URNG2 , int s2>
static result_type max boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::BOOST_PREVENT_MACRO_SUBSTITUTION ( )
inlinestatic

Returns the largest value that the generator can produce.

References boost::accumulators::extract::max, and boost::accumulators::extract::min.

template<class URNG1 , int s1, class URNG2 , int s2>
boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR ( xor_combine_engine< URNG1, s1, URNG2, s2 >  ,
result_type  ,
 
)
inline

Constructs a xor_combine_engine, seeding both base generators with v.

The exact algorithm used by this function may change in the future.

References boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::seed().

template<class URNG1 , int s1, class URNG2 , int s2>
boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::BOOST_RANDOM_DETAIL_ARITHMETIC_SEED ( xor_combine_engine< URNG1, s1, URNG2, s2 >  ,
result_type  ,
 
)
inline

seeds both base generators with v.

template<class URNG1 , int s1, class URNG2 , int s2>
boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR ( xor_combine_engine< URNG1, s1, URNG2, s2 >  ,
,
 
)
inline

Returns true if the two generators will produce identical sequences.

References boost::flyweights::x, and boost::polygon::y().

template<class URNG1 , int s1, class URNG2 , int s2>
boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR ( is  ,
xor_combine_engine< URNG1, s1, URNG2, s2 >  ,
 
)
inline

Reads the textual representation of the generator from a std::istream.

References boost::asio::s.

template<class URNG1 , int s1, class URNG2 , int s2>
boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR ( os  ,
xor_combine_engine< URNG1, s1, URNG2, s2 >  ,
 
)
inline

Writes the textual representation of the generator to a std::ostream.

References boost::asio::s.

template<class URNG1 , int s1, class URNG2 , int s2>
boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR ( xor_combine_engine< URNG1, s1, URNG2, s2 >  ,
SeedSeq  ,
seq   
)
inline

Constructs a xor_combine_engine, seeding both base generators with values produced by seq.

References boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::seed().

template<class URNG1 , int s1, class URNG2 , int s2>
boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::BOOST_RANDOM_DETAIL_SEED_SEQ_SEED ( xor_combine_engine< URNG1, s1, URNG2, s2 >  ,
SeedSeq  ,
seq   
)
inline

seeds both base generators with values produced by seq.

template<class URNG1 , int s1, class URNG2 , int s2>
boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::BOOST_STATIC_CONSTANT ( bool  ,
has_fixed_range  = false 
)
template<class URNG1 , int s1, class URNG2 , int s2>
boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::BOOST_STATIC_CONSTANT ( int  ,
shift1  = s1 
)
template<class URNG1 , int s1, class URNG2 , int s2>
boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::BOOST_STATIC_CONSTANT ( int  ,
shift2  = s2 
)
template<class URNG1 , int s1, class URNG2 , int s2>
void boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::discard ( boost::uintmax_t  z)
inline

Advances the state of the generator by z.

template<class URNG1 , int s1, class URNG2 , int s2>
template<class Iter >
void boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::generate ( Iter  first,
Iter  last 
)
inline

Fills a range with random values.

template<class URNG1 , int s1, class URNG2 , int s2>
result_type boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::operator() ( )
inline

Returns the next value of the generator.

References boost::xpressive::s1, and boost::xpressive::s2.

template<class URNG1 , int s1, class URNG2 , int s2>
template<class It >
void boost::random::xor_combine_engine< URNG1, s1, URNG2, s2 >::seed ( It &  first,
It  last 
)
inline

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.


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