Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template linear_feedback_shift_engine

boost::random::linear_feedback_shift_engine

Synopsis

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

template<typename UIntType,  w,  k,  q,  s> 
class linear_feedback_shift_engine {
public:
  // types
  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> 
     
    (, 
               linear_feedback_shift_engine &);
  template<typename CharT, typename Traits> 
     
    (, 
               linear_feedback_shift_engine &);
   (linear_feedback_shift_engine &, 
                  linear_feedback_shift_engine &);
   (linear_feedback_shift_engine &, 
                  linear_feedback_shift_engine &);

  // public data members
  static  has_fixed_range;
  static  word_size;
  static  exponent1;
  static  exponent2;
  static  step_size;
  static  default_seed;
};

Description

Instatiations of linear_feedback_shift model a pseudo-random number generator . It was originally proposed in

"Random numbers generated by linear recurrence modulo two.", Tausworthe, R. C.(1965), Mathematics of Computation 19, 201-209.

linear_feedback_shift_engine public construct/copy/destruct

  1. ();

    Constructs a linear_feedback_shift_engine, using the default seed.

  2. ( s0);

    Constructs a linear_feedback_shift_engine, seeding it with s0.

  3. template<typename SeedSeq> 
      ( seq);

    Constructs a linear_feedback_shift_engine, seeding it with seq.

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

    Constructs a linear_feedback_shift_engine, seeding it with values from the range [first, last).

linear_feedback_shift_engine public static functions

  1.  ();

    Returns the smallest value that the generator can produce.

  2.  ();

    Returns the largest value that the generator can produce.

linear_feedback_shift_engine public member functions

  1.  ();

    Seeds a linear_feedback_shift_engine with the default seed.

  2.  ( s0);

    Seeds a linear_feedback_shift_engine with s0.

  3. template<typename SeedSeq>  ( seq);

    Seeds a linear_feedback_shift_engine with values produced by seq.generate().

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

    Seeds a linear_feedback_shift_engine with values from the range [first, last).

  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.

linear_feedback_shift_engine friend functions

  1. template<typename CharT, typename Traits> 
       
      ( os, 
                 linear_feedback_shift_engine & x);

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

  2. template<typename CharT, typename Traits> 
       
      ( is, 
                 linear_feedback_shift_engine & x);

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

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

    Returns true if the two generators will produce identical sequences of outputs.

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

    Returns true if the two generators will produce different sequences of outputs.


PrevUpHomeNext