Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template independent_bits_engine

boost::random::independent_bits_engine

Synopsis

// In header: <boost/random/independent_bits.hpp>

template<typename Engine,  w, typename UIntType> 
class independent_bits_engine {
public:
  // types
  typedef               ;       
  typedef             ;     
  typedef  ;

  // construct/copy/destruct
  ();
  ();
  template<typename SeedSeq> ();
  ();
  template<typename It> (, );

  // public static functions
   ();
   ();

  // public member functions
   ();
   ();
  template<typename SeedSeq>  ();
  template<typename It>  (, );
   ();
  template<typename Iter>  (, );
   ();
   () ;

  // friend functions
  template<typename CharT, typename Traits> 
     
    (, 
               independent_bits_engine &);
  template<typename CharT, typename Traits> 
     
    (, 
               independent_bits_engine &);
   (independent_bits_engine &, 
                  independent_bits_engine &);
   (independent_bits_engine &, 
                  independent_bits_engine &);

  // public data members
  static  has_fixed_range;
};

Description

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

  1. ();

    Constructs an independent_bits_engine using the default constructor of the base generator.

  2. ( seed);

    Constructs an independent_bits_engine, using seed as the constructor argument for both base generators.

  3. template<typename SeedSeq> ( seq);

    Constructs an independent_bits_engine, using seq as the constructor argument for the base generator.

  4. ( base_arg);

    Constructs an independent_bits_engine by copying base.

  5. template<typename It> ( first,  last);

    Contructs an independent_bits_engine 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.

    Throws: std::invalid_argument if the input range is too small.

    Exception Safety: Basic

independent_bits_engine public static functions

  1.  ();

    Returns the smallest value that the generator can produce.

  2.  ();

    Returns the largest value that the generator can produce.

independent_bits_engine public member functions

  1.  ();

    Seeds an independent_bits_engine using the default seed of the base generator.

  2.  ( seed);

    Seeds an independent_bits_engine, using seed as the seed for the base generator.

  3. template<typename SeedSeq>  ( seq);

    Seeds an independent_bits_engine, using seq to seed the base generator.

  4. template<typename It>  ( first,  last);

    Seeds an independent_bits_engine 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.

    Throws: std::invalid_argument if the input range is too small.

    Exception Safety: Basic

  5.  ();

    Returns the next value of the generator.

  6. template<typename Iter>  ( first,  last);

    Fills a range with random values

  7.  ( z);

    Advances the state of the generator by z.

  8.  () ;

independent_bits_engine friend functions

  1. template<typename CharT, typename Traits> 
       
      ( os, 
                 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.

  2. template<typename CharT, typename Traits> 
       
      ( is, 
                 independent_bits_engine & r);

    Reads the state of an independent_bits_engine from a std::istream.

  3.  (independent_bits_engine & x, 
                    independent_bits_engine & y);

    Returns: true iff the two independent_bits_engines will produce the same sequence of values.

  4.  (independent_bits_engine & lhs, 
                    independent_bits_engine & rhs);

    Returns: true iff the two independent_bits_engines will produce different sequences of values.


PrevUpHomeNext