[Lemon-commits] Peter Kovacs: Minor doc improvements
Lemon HG
hg at lemon.cs.elte.hu
Tue Oct 28 15:22:26 CET 2008
details: http://lemon.cs.elte.hu/hg/lemon/rev/0badf3bb38c2
changeset: 352:0badf3bb38c2
user: Peter Kovacs <kpeter [at] inf.elte.hu>
date: Tue Oct 28 14:47:57 2008 +0100
description:
Minor doc improvements
diffstat:
1 file changed, 9 insertions(+), 23 deletions(-)
lemon/random.h | 32 +++++++++-----------------------
diffs (114 lines):
diff -r 2593e163e407 -r 0badf3bb38c2 lemon/random.h
--- a/lemon/random.h Thu Jun 19 17:33:06 2008 +0100
+++ b/lemon/random.h Tue Oct 28 14:47:57 2008 +0100
@@ -540,10 +540,6 @@
///
/// @{
- ///\name Initialization
- ///
- /// @{
-
/// \brief Default constructor
///
/// Constructor with constant seeding.
@@ -708,12 +704,6 @@
return real<Number>() * (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<Number, Word>::convert(core);
}
- /// @}
-
unsigned int uinteger() {
return uinteger<unsigned int>();
}
@@ -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<double,double> lognormalParamsFromMD(double mean,
- double std_dev)
+ double std_dev)
{
double fr=std_dev/mean;
fr*=fr;
@@ -872,14 +859,14 @@
return std::pair<double,double>(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<double>(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
More information about the Lemon-commits
mailing list