![]() |
Home | Libraries | People | FAQ | More |
boost::random::faure_engine
// In header: <boost/random/faure.hpp> template<typename RealType, typename SeqSizeT, typename PrimeTable> class faure_engine { public: // types typedef ; // construct/copy/destruct (); // friend functions (faure_engine &, faure_engine &); (faure_engine &, faure_engine &); template<typename CharT, typename Traits> (, faure_engine &); template<typename CharT, typename Traits> (, faure_engine &); // public static functions (); (); // public member functions ( = ); () ; (); (); };
Instantiations of class template faure_engine model a quasi-random number generator . The faure_engine uses the algorithm described in
Henri Faure, Discrepance de suites associees a un systeme de numeration (en dimension s), Acta Arithmetica, Volume 41, 1982, pages 337-351.
Bennett Fox, Algorithm 647: Implementation and Relative Efficiency of Quasirandom Sequence Generators, ACM Transactions on Mathematical Software, Volume 12, Number 4, December 1986, pages 362-376.
In the following documentation X
denotes the concrete class of the template faure_engine returning objects of type RealType
, u and v are the values of X
.
Some member functions may throw exceptions of type std::bad_alloc
.
faure_engine
friend functions(faure_engine & x, faure_engine & y);
Returns true if the two generators will produce identical sequences of outputs.
(faure_engine & lhs, faure_engine & rhs);
Returns true if the two generators will produce different sequences of outputs.
template<typename CharT, typename Traits> ( os, faure_engine & s);
Writes the textual representation of the generator to a std::ostream
.
template<typename CharT, typename Traits> ( is, faure_engine & s);
Reads the textual representation of the generator from a std::istream
.
faure_engine
public member functions( init = );
Effects: Effectively sets the quasi-random number generator state to the init
-th vector in the s
-dimensional quasi-random domain, where s
== X::dimension().
Throws: bad_alloc.
() ;
Returns: The dimension of of the quasi-random domain.
Throws: nothing.
();
Returns: Returns a successive element of an s
-dimensional (s = X::dimension()) vector at each invocation. When all elements are exhausted, X::operator() begins anew with the starting element of a subsequent s
-dimensional vector.
Throws: range_error.
( z);
Effects: Advances *this state as if z
consecutive X::operator() invocations were executed.
Throws: range_error. Throws: bad_alloc.