ALPS Home Libraries License Support People ALPS Web Site

PrevUpHomeNext

Class template buffered_rng

alps::buffered_rng

Synopsis

// In header: <alps/random/buffered_rng.h>

template<typename RNG> 
class buffered_rng : public alps::buffered_rng_base {
public:
  // construct/copy/destruct
  buffered_rng();
  buffered_rng(RNG);

  // private member functions
   BOOST_STATIC_ASSERT((::boost::is_same< typename RNG::result_type, uint32_t >::value));

  // public member functions
  template<typename IT> void seed(IT, IT);
  void seed(uint32_t);
  void seed();
  void seed(pseudo_des &);
  result_type min BOOST_PREVENT_MACRO_SUBSTITUTION() const;
  result_type max BOOST_PREVENT_MACRO_SUBSTITUTION() const;
  void write(std::ostream &) const;
  void read(std::istream &);
  void write_all(std::ostream &) const;
  void read_all(std::istream &);

  // protected member functions
  void fill_buffer();
};

Description

a concrete implementation of a buffered random number generator

buffered_rng public construct/copy/destruct

  1. buffered_rng();
    constructs a default-seeded generator
  2. buffered_rng(RNG rng);

    constructs a generator by copying the argument

    Parameters:

    rng

    generator to be copied

buffered_rng private member functions

  1.  BOOST_STATIC_ASSERT((::boost::is_same< typename RNG::result_type, uint32_t >::value));

buffered_rng public member functions

  1. template<typename IT> void seed(IT start, IT end);
  2. void seed(uint32_t s);

    seed from an integer using seed_with_sequence

    seed_with_sequence()

  3. void seed();
    seed with the default value
  4. void seed(pseudo_des & inigen);
    seed with the pseudo_des generator
  5. result_type min BOOST_PREVENT_MACRO_SUBSTITUTION() const;
  6. result_type max BOOST_PREVENT_MACRO_SUBSTITUTION() const;
  7. void write(std::ostream &) const;
    write the state to a std::ostream
  8. void read(std::istream &);
    read the state from a std::istream
  9. void write_all(std::ostream & os) const;
    write the full state (including buffer) to a std::ostream
  10. void read_all(std::istream &);
    read the full state (including buffer) from a std::istream

buffered_rng protected member functions

  1. void fill_buffer();
    refills the buffer
Copyright © 2006-2008 Brigitte Surer, Matthias Troyer

PrevUpHomeNext