Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template mixmax_engine

boost::random::mixmax_engine

Synopsis

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

template< Ndim,  SPECIALMUL,  SPECIAL> 
class mixmax_engine {
public:
  // types
  typedef  ;

  // member classes/structs/unions

  struct rng_state_st {

    // public data members
    Ndim > V;
     sumtot;
    int counter;
  };

  // public member functions
  BOOST_STATIC_CONSTEXPR  ();
  BOOST_STATIC_CONSTEXPR  ();
  ();
  ();
  (uint32_t, uint32_t, uint32_t, uint32_t);
  void ( = );
  template<typename It> (It &, It);
  template<typename SeedSeq> (SeedSeq &);
  template<typename It> void (It &, It);
  template<typename SeeqSeq> void (SeeqSeq &);
   ();
  template<typename Iter> void (Iter, Iter);
  void ();

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

  // private member functions
   ();
   ();
  void (, unsigned  int);
  void (, uint32_t, uint32_t, uint32_t, 
                         uint32_t);
   (, );
   
  (, , uint32_t, uint32_t, 
                uint32_t, uint32_t);
   (, );
   (, , );

  // public data members
  static const  mixmax_min;
  static const  mixmax_max;
  static const  bool has_fixed_range;
  static const  int N;  // The main internal parameter, size of the defining MIXMAX matrix. 
};

Description

Instantiations of class template mixmax_engine model, pseudo-random number generator . It uses the MIXMAX generator algorithms from:

G.K.Savvidy and N.G.Ter-Arutyunian, On the Monte Carlo simulation of physical systems, J.Comput.Phys. 97, 566 (1991); Preprint EPI-865-16-86, Yerevan, Jan. 1986 http://dx.doi.org/10.1016/0021-9991(91)90015-D

K.Savvidy The MIXMAX random number generator Comp. Phys. Commun. 196 (2015), pp 161–165 http://dx.doi.org/10.1016/j.cpc.2015.06.003

K.Savvidy and G.Savvidy Spectrum and Entropy of C-systems. MIXMAX random number generator Chaos, Solitons & Fractals, Volume 91, (2016) pp. 33–38 http://dx.doi.org/10.1016/j.chaos.2016.05.003

The generator crucially depends on the choice of the parameters. The valid sets of parameters are from the published papers above.

mixmax_engine public member functions

  1. BOOST_STATIC_CONSTEXPR  ();
  2. BOOST_STATIC_CONSTEXPR  ();
  3. ();
    Constructor, unit vector as initial state, acted on by A^2^512.
  4. ();
    Constructor, one 64-bit seed.

    < constructor, one uint64_t seed, random numbers are statistically independent from any two distinct seeds, e.g. consecutive seeds are ok

  5. (uint32_t clusterID, uint32_t machineID, uint32_t runID, 
                           uint32_t streamID);
    Constructor, four 32-bit seeds for 128-bit seeding flexibility.
  6. void ( seedval = );
    seed with one 64-bit seed
  7. template<typename It> (It & first, It last);
  8. template<typename SeedSeq> (SeedSeq & seq);
  9. template<typename It> void (It & first, It last);

    Sets the state of the generator using values from an iterator range.

  10. template<typename SeeqSeq> void (SeeqSeq & seq);

    Sets the state of the generator using values from a seed_seq.

  11.  ();

    return one uint64 between min=0 and max=2^61-1

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

    Fills a range with random values

  13. void ( nsteps);
    discard n steps, required in boost::random

mixmax_engine friend functions

  1. template<typename CharT, typename Traits> 
      CharT, Traits > & 
      (CharT, Traits > & ost, 
                 const  mixmax_engine & me);

    save the state of the RNG to a stream

  2. template<typename CharT, typename Traits> 
      CharT, Traits > & 
      (CharT, Traits > & in, mixmax_engine & me);

    read the state of the RNG from a stream

mixmax_engine private member functions

  1.  ( k);
  2.  ( k);
  3. void ( X, unsigned  int i);
  4. void ( Xin, uint32_t clusterID, 
                           uint32_t machineID, uint32_t runID, uint32_t streamID);
  5.  ( Y,  sumtotOld);
  6.  
    ( Vout,  Vin, uint32_t clusterID, 
                  uint32_t machineID, uint32_t runID, uint32_t streamID);
  7.  ( foo,  bar);
  8.  ( cum,  s,  a);

PrevUpHomeNext