COIN-OR::LEMON - Graph Library

Changeset 1164:04f57dad1b07 in lemon-main


Ignore:
Timestamp:
02/17/18 23:55:16 (7 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Improve API doc of Random classes (#602)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/random.h

    r1163 r1164  
    111111      static const Word loMask = (1u << 31) - 1;
    112112      static const Word hiMask = ~loMask;
    113 
    114113
    115114      static Word tempering(Word rnd) {
     
    243242
    244243    private:
    245 
    246244
    247245      void fillState() {
     
    272270      }
    273271
    274 
    275272      Word *current;
    276273      Word state[length];
     
    472469    /// The Mersenne Twister is a twisted generalized feedback
    473470    /// shift-register generator of Matsumoto and Nishimura. The period
    474     /// of this generator is \f$ 2^{19937} - 1 \f$ and it is
     471    /// of this generator is \f$ 2^{19937} - 1\f$ and it is
    475472    /// equi-distributed in 623 dimensions for 32-bit numbers. The time
    476473    /// performance of this generator is comparable to the commonly used
    477474    /// generators.
    478475    ///
    479     /// This is a template version implementation both 32-bit and
     476    /// This is a template implementation of both 32-bit and
    480477    /// 64-bit architecture optimized versions. The generators differ
    481478    /// sligthly in the initialization and generation phase so they
     
    486483    ///
    487484    /// The generator gives back random numbers of serveral types. To
    488     /// get a random number from a range of a floating point type you
     485    /// get a random number from a range of a floating point type, you
    489486    /// can use one form of the \c operator() or the \c real() member
    490487    /// function. If you want to get random number from the {0, 1, ...,
    491     /// n-1} integer range use the \c operator[] or the \c integer()
     488    /// n-1} integer range, use the \c operator[] or the \c integer()
    492489    /// method. And to get random number from the whole range of an
    493     /// integer type you can use the argumentless \c integer() or \c
    494     /// uinteger() functions. After all you can get random bool with
    495     /// equal chance of true and false or given probability of true
    496     /// result with the \c boolean() member functions.
     490    /// integer type, you can use the argumentless \c integer() or
     491    /// \c uinteger() functions. Finally, you can get random bool with
     492    /// equal chance of true and false or with given probability of true
     493    /// result using the \c boolean() member functions.
     494    ///
     495    /// Various non-uniform distributions are also supported: normal (Gauss),
     496    /// exponential, gamma, Poisson, etc.; and a few two-dimensional
     497    /// distributions, too.
    497498    ///
    498499    ///\code
     
    514515    ///\endcode
    515516    ///
    516     /// LEMON provides a global instance of the random number
    517     /// generator which name is \ref lemon::rnd "rnd". Usually it is a
    518     /// good programming convenience to use this global generator to get
    519     /// random numbers.
     517    /// LEMON provides a global instance of the random number generator:
     518    /// \ref lemon::rnd "rnd". In most cases, it is a good practice
     519    /// to use this global generator to get random numbers.
    520520    ///
    521521    /// \sa \ref Random, \ref Random32 or \ref Random64.
    522     ///
    523522    template<class Word>
    524523    class Random {
     
    645644      }
    646645
    647       /// \brief Seding from process id and time
    648       ///
    649       /// Seding from process id and time. This function uses the
     646      /// \brief Seeding from process id and time
     647      ///
     648      /// Seeding from process id and time. This function uses the
    650649      /// current process id and the current time for initialize the
    651650      /// random sequence.
     
    943942      ///@}
    944943
    945       ///\name Two Dimensional Distributions
     944      ///\name Two-Dimensional Distributions
    946945      ///
    947946      ///@{
     
    961960        return dim2::Point<double>(V1,V2);
    962961      }
    963       /// A kind of two dimensional normal (Gauss) distribution
     962      /// A kind of two-dimensional normal (Gauss) distribution
    964963
    965964      /// This function provides a turning symmetric two-dimensional distribution.
     
    980979        return dim2::Point<double>(W*V1,W*V2);
    981980      }
    982       /// A kind of two dimensional exponential distribution
     981      /// A kind of two-dimensional exponential distribution
    983982
    984983      /// This function provides a turning symmetric two-dimensional distribution.
     
    10091008  /// \brief Mersenne Twister random number generator
    10101009  ///
    1011   /// This class implements either the 32 bit or the 64 bit version of
     1010  /// This class implements either the 32-bit or the 64-bit version of
    10121011  /// the Mersenne Twister random number generator algorithm
    1013   /// depending the the system architecture.
     1012  /// depending on the system architecture.
    10141013  ///
    1015   /// For the API description, see its base class \ref
    1016   /// _random_bits::Random
     1014  /// For the API description, see its base class
     1015  /// \ref _random_bits::Random.
    10171016  ///
    10181017  /// \sa \ref _random_bits::Random
    10191018  typedef _random_bits::Random<unsigned long> Random;
     1019
    10201020  /// \ingroup misc
    10211021  ///
    1022   /// \brief Mersenne Twister random number generator (32 bit version)
     1022  /// \brief Mersenne Twister random number generator (32-bit version)
    10231023  ///
    1024   /// This class implements the 32 bit version of the Mersenne Twister
     1024  /// This class implements the 32-bit version of the Mersenne Twister
    10251025  /// random number generator algorithm. It is recommended to be used
    10261026  /// when someone wants to make sure that the \e same pseudo random
    10271027  /// sequence will be generated on every platfrom.
    10281028  ///
    1029   /// For the API description, see its base class \ref
    1030   /// _random_bits::Random
     1029  /// For the API description, see its base class
     1030  /// \ref _random_bits::Random.
    10311031  ///
    10321032  /// \sa \ref _random_bits::Random
    1033 
    10341033  typedef _random_bits::Random<unsigned int> Random32;
     1034
    10351035  /// \ingroup misc
    10361036  ///
    1037   /// \brief Mersenne Twister random number generator (64 bit version)
     1037  /// \brief Mersenne Twister random number generator (64-bit version)
    10381038  ///
    1039   /// This class implements the 64 bit version of the Mersenne Twister
    1040   /// random number generator algorithm. (Even though it will run
    1041   /// on 32 bit architectures, too.) It is recommended to ber used when
     1039  /// This class implements the 64-bit version of the Mersenne Twister
     1040  /// random number generator algorithm. (Even though it runs
     1041  /// on 32-bit architectures, too.) It is recommended to be used when
    10421042  /// someone wants to make sure that the \e same pseudo random sequence
    10431043  /// will be generated on every platfrom.
    10441044  ///
    1045   /// For the API description, see its base class \ref
    1046   /// _random_bits::Random
     1045  /// For the API description, see its base class
     1046  /// \ref _random_bits::Random.
    10471047  ///
    10481048  /// \sa \ref _random_bits::Random
    10491049  typedef _random_bits::Random<unsigned long long> Random64;
    10501050
    1051 
    10521051  extern Random rnd;
    1053 
    10541052 
    10551053}
Note: See TracChangeset for help on using the changeset viewer.