# HG changeset patch # User Alpar Juttner # Date 1225205358 0 # Node ID 3e906e6c08a9621adf2dcb63610f911637d81c78 # Parent f8832dc16d459684b1740edb6b2b1840edaf4a7a# Parent 0badf3bb38c2a0ef9cb4c0dc1c2bd994979d043a Merge diff -r f8832dc16d45 -r 3e906e6c08a9 lemon/random.h --- a/lemon/random.h Tue Oct 28 15:37:46 2008 +0100 +++ b/lemon/random.h Tue Oct 28 14:49:18 2008 +0000 @@ -540,10 +540,6 @@ /// /// @{ - ///\name Initialization - /// - /// @{ - /// \brief Default constructor /// /// Constructor with constant seeding. @@ -708,12 +704,6 @@ return real() * (b - a) + a; } - /// @} - - ///\name Uniform distributions - /// - /// @{ - /// \brief Returns a random real number from the range [0, 1) /// /// It returns a random double from the range [0, 1). @@ -771,8 +761,6 @@ return _random_bits::IntConversion::convert(core); } - /// @} - unsigned int uinteger() { return uinteger(); } @@ -806,19 +794,18 @@ ///\name Non-uniform distributions /// - ///@{ - /// \brief Returns a random bool + /// \brief Returns a random bool with given probability of true result. /// /// It returns a random bool with given probability of true result. bool boolean(double p) { return operator()() < p; } - /// Standard Gauss distribution + /// Standard normal (Gauss) distribution - /// Standard Gauss distribution. + /// Standard normal (Gauss) distribution. /// \note The Cartesian form of the Box-Muller /// transformation is used to generate a random normal distribution. double gauss() @@ -831,9 +818,9 @@ } while(S>=1); return std::sqrt(-2*std::log(S)/S)*V1; } - /// Gauss distribution with given mean and standard deviation + /// Normal (Gauss) distribution with given mean and standard deviation - /// Gauss distribution with given mean and standard deviation. + /// Normal (Gauss) distribution with given mean and standard deviation. /// \sa gauss() double gauss(double mean,double std_dev) { @@ -864,7 +851,7 @@ /// standard deviation. The return value can direcly be passed to /// lognormal(). std::pair lognormalParamsFromMD(double mean, - double std_dev) + double std_dev) { double fr=std_dev/mean; fr*=fr; @@ -872,14 +859,14 @@ return std::pair(std::log(mean)-lg/2.0,std::sqrt(lg)); } /// Lognormal distribution with given mean and standard deviation - + /// Lognormal distribution with given mean and standard deviation. /// double lognormalMD(double mean,double std_dev) { return lognormal(lognormalParamsFromMD(mean,std_dev)); } - + /// Exponential distribution with given mean /// This function generates an exponential distribution random number @@ -983,7 +970,6 @@ ///\name Two dimensional distributions /// - ///@{ /// Uniform distribution on the full unit circle @@ -1000,7 +986,7 @@ } while(V1*V1+V2*V2>=1); return dim2::Point(V1,V2); } - /// A kind of two dimensional Gauss distribution + /// A kind of two dimensional normal (Gauss) distribution /// This function provides a turning symmetric two-dimensional distribution. /// Both coordinates are of standard normal distribution, but they are not