Ignore:
Timestamp:
02/17/18 23:55:16 (20 months ago)
Branch:
default
Phase:
public
Message:

Improve API doc of Random classes (#602)

File:
1 edited

### Legend:

Unmodified
 r1379 static const Word loMask = (1u << 31) - 1; static const Word hiMask = ~loMask; static Word tempering(Word rnd) { private: void fillState() { } Word *current; Word state[length]; /// The Mersenne Twister is a twisted generalized feedback /// shift-register generator of Matsumoto and Nishimura. The period /// of this generator is \f$2^{19937} - 1 \f$ and it is /// of this generator is \f$2^{19937} - 1\f$ and it is /// equi-distributed in 623 dimensions for 32-bit numbers. The time /// performance of this generator is comparable to the commonly used /// generators. /// /// This is a template version implementation both 32-bit and /// This is a template implementation of both 32-bit and /// 64-bit architecture optimized versions. The generators differ /// sligthly in the initialization and generation phase so they /// /// The generator gives back random numbers of serveral types. To /// get a random number from a range of a floating point type you /// get a random number from a range of a floating point type, you /// can use one form of the \c operator() or the \c real() member /// function. If you want to get random number from the {0, 1, ..., /// n-1} integer range use the \c operator[] or the \c integer() /// n-1} integer range, use the \c operator[] or the \c integer() /// method. And to get random number from the whole range of an /// integer type you can use the argumentless \c integer() or \c /// uinteger() functions. After all you can get random bool with /// equal chance of true and false or given probability of true /// result with the \c boolean() member functions. /// integer type, you can use the argumentless \c integer() or /// \c uinteger() functions. Finally, you can get random bool with /// equal chance of true and false or with given probability of true /// result using the \c boolean() member functions. /// /// Various non-uniform distributions are also supported: normal (Gauss), /// exponential, gamma, Poisson, etc.; and a few two-dimensional /// distributions, too. /// ///\code ///\endcode /// /// LEMON provides a global instance of the random number /// generator which name is \ref lemon::rnd "rnd". Usually it is a /// good programming convenience to use this global generator to get /// random numbers. /// LEMON provides a global instance of the random number generator: /// \ref lemon::rnd "rnd". In most cases, it is a good practice /// to use this global generator to get random numbers. /// /// \sa \ref Random, \ref Random32 or \ref Random64. /// template class Random { } /// \brief Seding from process id and time /// /// Seding from process id and time. This function uses the /// \brief Seeding from process id and time /// /// Seeding from process id and time. This function uses the /// current process id and the current time for initialize the /// random sequence. ///@} ///\name Two Dimensional Distributions ///\name Two-Dimensional Distributions /// ///@{ return dim2::Point(V1,V2); } /// A kind of two dimensional normal (Gauss) distribution /// A kind of two-dimensional normal (Gauss) distribution /// This function provides a turning symmetric two-dimensional distribution. return dim2::Point(W*V1,W*V2); } /// A kind of two dimensional exponential distribution /// A kind of two-dimensional exponential distribution /// This function provides a turning symmetric two-dimensional distribution. /// \brief Mersenne Twister random number generator /// /// This class implements either the 32 bit or the 64 bit version of /// This class implements either the 32-bit or the 64-bit version of /// the Mersenne Twister random number generator algorithm /// depending the the system architecture. /// depending on the system architecture. /// /// For the API description, see its base class \ref /// _random_bits::Random /// For the API description, see its base class /// \ref _random_bits::Random. /// /// \sa \ref _random_bits::Random typedef _random_bits::Random Random; /// \ingroup misc /// /// \brief Mersenne Twister random number generator (32 bit version) /// \brief Mersenne Twister random number generator (32-bit version) /// /// This class implements the 32 bit version of the Mersenne Twister /// This class implements the 32-bit version of the Mersenne Twister /// random number generator algorithm. It is recommended to be used /// when someone wants to make sure that the \e same pseudo random /// sequence will be generated on every platfrom. /// /// For the API description, see its base class \ref /// _random_bits::Random /// For the API description, see its base class /// \ref _random_bits::Random. /// /// \sa \ref _random_bits::Random typedef _random_bits::Random Random32; /// \ingroup misc /// /// \brief Mersenne Twister random number generator (64 bit version) /// \brief Mersenne Twister random number generator (64-bit version) /// /// This class implements the 64 bit version of the Mersenne Twister /// random number generator algorithm. (Even though it will run /// on 32 bit architectures, too.) It is recommended to ber used when /// This class implements the 64-bit version of the Mersenne Twister /// random number generator algorithm. (Even though it runs /// on 32-bit architectures, too.) It is recommended to be used when /// someone wants to make sure that the \e same pseudo random sequence /// will be generated on every platfrom. /// /// For the API description, see its base class \ref /// _random_bits::Random /// For the API description, see its base class /// \ref _random_bits::Random. /// /// \sa \ref _random_bits::Random typedef _random_bits::Random Random64; extern Random rnd; }