![]() |
Home | Libraries | People | FAQ | More |
boost::random::niederreiter_base2_engine
// In header: <boost/random/niederreiter_base2.hpp> template<typename UIntType, w, typename Nb2Table> class niederreiter_base2_engine { public: // types typedef ; // construct/copy/destruct (); // public member functions () ; (); (); (); (); // public static functions (); (); // friend functions (, ); (, ); template<typename CharT, typename Traits> (, ); template<typename CharT, typename Traits> (, ); };
Instantiations of class template niederreiter_base2_engine model a quasi-random number generator . The niederreiter_base2_engine uses the algorithm described in
Bratley, Fox, Niederreiter, ACM Trans. Model. Comp. Sim. 2, 195 (1992).
![]() |
Note |
|---|---|
|
niederreiter_base2_engine skips trivial zeroes at the start of the sequence. For example, the beginning of the 2-dimensional Niederreiter base 2 sequence in |
In the following documentation X denotes the concrete class of the template niederreiter_base2_engine returning objects of type UIntType, u and v are the values of X.
Some member functions may throw exceptions of type std::range_error. This happens when the quasi-random domain is exhausted and the generator cannot produce any more values. The length of the low discrepancy sequence is given by
.
niederreiter_base2_engine public member functions() ;
Returns: The dimension of of the quasi-random domain.
Throws: nothing.
();Throws: nothing.
Effects: Resets the quasi-random number generator state to the one given by the default construction. Equivalent to u.seed(0).
( init);Throws: range_error.
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().
();
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.
niederreiter_base2_engine friend functions( x, y);Returns true if the two generators will produce identical sequences of outputs.
( lhs, rhs);Returns true if the two generators will produce different sequences of outputs.
template<typename CharT, typename Traits> ( os, s);Writes the textual representation of the generator to a
std::ostream. template<typename CharT, typename Traits> ( is, s);Reads the textual representation of the generator from a
std::istream.