lemon/random.h
changeset 178 d2bac07f1742
parent 177 b685e12e08c0
child 209 765619b7cbb2
     1.1 --- a/lemon/random.h	Thu Jun 19 10:59:22 2008 +0200
     1.2 +++ b/lemon/random.h	Tue Apr 15 14:12:10 2008 +0200
     1.3 @@ -540,6 +540,10 @@
     1.4      ///
     1.5      /// @{
     1.6  
     1.7 +    ///\name Initialization
     1.8 +    ///
     1.9 +    /// @{
    1.10 +
    1.11      /// \brief Default constructor
    1.12      ///
    1.13      /// Constructor with constant seeding.
    1.14 @@ -611,7 +615,7 @@
    1.15      /// \brief Seeding from file or from process id and time
    1.16      ///
    1.17      /// By default, this function calls the \c seedFromFile() member
    1.18 -    /// function with the <tt>/dev/urandom</tt> file. If it is not success,
    1.19 +    /// function with the <tt>/dev/urandom</tt> file. If it does not success,
    1.20      /// it uses the \c seedFromTime().
    1.21      /// \return Currently always true.
    1.22      bool seed() {
    1.23 @@ -634,7 +638,7 @@
    1.24      /// entropy).
    1.25      /// \param file The source file
    1.26      /// \param offset The offset, from the file read.
    1.27 -    /// \return True when the seeding is success.
    1.28 +    /// \return True when the seeding successes.
    1.29  #ifndef WIN32
    1.30      bool seedFromFile(const std::string& file = "/dev/urandom", int offset = 0) 
    1.31  #else
    1.32 @@ -704,6 +708,12 @@
    1.33        return real<Number>() * (b - a) + a; 
    1.34      }
    1.35  
    1.36 +    /// @}
    1.37 +
    1.38 +    ///\name Uniform distributions
    1.39 +    ///
    1.40 +    /// @{
    1.41 +
    1.42      /// \brief Returns a random real number from the range [0, 1)
    1.43      ///
    1.44      /// It returns a random double from the range [0, 1).
    1.45 @@ -761,6 +771,8 @@
    1.46        return _random_bits::IntConversion<Number, Word>::convert(core);
    1.47      }
    1.48  
    1.49 +    /// @}
    1.50 +
    1.51      unsigned int uinteger() {
    1.52        return uinteger<unsigned int>();
    1.53      }