| ... | ... |
@@ -540,10 +540,6 @@ |
| 540 | 540 |
/// |
| 541 | 541 |
/// @{
|
| 542 | 542 |
|
| 543 |
///\name Initialization |
|
| 544 |
/// |
|
| 545 |
/// @{
|
|
| 546 |
|
|
| 547 | 543 |
/// \brief Default constructor |
| 548 | 544 |
/// |
| 549 | 545 |
/// Constructor with constant seeding. |
| ... | ... |
@@ -708,12 +704,6 @@ |
| 708 | 704 |
return real<Number>() * (b - a) + a; |
| 709 | 705 |
} |
| 710 | 706 |
|
| 711 |
/// @} |
|
| 712 |
|
|
| 713 |
///\name Uniform distributions |
|
| 714 |
/// |
|
| 715 |
/// @{
|
|
| 716 |
|
|
| 717 | 707 |
/// \brief Returns a random real number from the range [0, 1) |
| 718 | 708 |
/// |
| 719 | 709 |
/// It returns a random double from the range [0, 1). |
| ... | ... |
@@ -771,8 +761,6 @@ |
| 771 | 761 |
return _random_bits::IntConversion<Number, Word>::convert(core); |
| 772 | 762 |
} |
| 773 | 763 |
|
| 774 |
/// @} |
|
| 775 |
|
|
| 776 | 764 |
unsigned int uinteger() {
|
| 777 | 765 |
return uinteger<unsigned int>(); |
| 778 | 766 |
} |
| ... | ... |
@@ -806,19 +794,18 @@ |
| 806 | 794 |
|
| 807 | 795 |
///\name Non-uniform distributions |
| 808 | 796 |
/// |
| 809 |
|
|
| 810 | 797 |
///@{
|
| 811 | 798 |
|
| 812 |
/// \brief Returns a random bool |
|
| 799 |
/// \brief Returns a random bool with given probability of true result. |
|
| 813 | 800 |
/// |
| 814 | 801 |
/// It returns a random bool with given probability of true result. |
| 815 | 802 |
bool boolean(double p) {
|
| 816 | 803 |
return operator()() < p; |
| 817 | 804 |
} |
| 818 | 805 |
|
| 819 |
/// Standard Gauss distribution |
|
| 806 |
/// Standard normal (Gauss) distribution |
|
| 820 | 807 |
|
| 821 |
/// Standard Gauss distribution. |
|
| 808 |
/// Standard normal (Gauss) distribution. |
|
| 822 | 809 |
/// \note The Cartesian form of the Box-Muller |
| 823 | 810 |
/// transformation is used to generate a random normal distribution. |
| 824 | 811 |
double gauss() |
| ... | ... |
@@ -831,9 +818,9 @@ |
| 831 | 818 |
} while(S>=1); |
| 832 | 819 |
return std::sqrt(-2*std::log(S)/S)*V1; |
| 833 | 820 |
} |
| 834 |
/// Gauss distribution with given mean and standard deviation |
|
| 821 |
/// Normal (Gauss) distribution with given mean and standard deviation |
|
| 835 | 822 |
|
| 836 |
/// Gauss distribution with given mean and standard deviation. |
|
| 823 |
/// Normal (Gauss) distribution with given mean and standard deviation. |
|
| 837 | 824 |
/// \sa gauss() |
| 838 | 825 |
double gauss(double mean,double std_dev) |
| 839 | 826 |
{
|
| ... | ... |
@@ -864,7 +851,7 @@ |
| 864 | 851 |
/// standard deviation. The return value can direcly be passed to |
| 865 | 852 |
/// lognormal(). |
| 866 | 853 |
std::pair<double,double> lognormalParamsFromMD(double mean, |
| 867 |
|
|
| 854 |
double std_dev) |
|
| 868 | 855 |
{
|
| 869 | 856 |
double fr=std_dev/mean; |
| 870 | 857 |
fr*=fr; |
| ... | ... |
@@ -872,14 +859,14 @@ |
| 872 | 859 |
return std::pair<double,double>(std::log(mean)-lg/2.0,std::sqrt(lg)); |
| 873 | 860 |
} |
| 874 | 861 |
/// Lognormal distribution with given mean and standard deviation |
| 875 |
|
|
| 862 |
|
|
| 876 | 863 |
/// Lognormal distribution with given mean and standard deviation. |
| 877 | 864 |
/// |
| 878 | 865 |
double lognormalMD(double mean,double std_dev) |
| 879 | 866 |
{
|
| 880 | 867 |
return lognormal(lognormalParamsFromMD(mean,std_dev)); |
| 881 | 868 |
} |
| 882 |
|
|
| 869 |
|
|
| 883 | 870 |
/// Exponential distribution with given mean |
| 884 | 871 |
|
| 885 | 872 |
/// This function generates an exponential distribution random number |
| ... | ... |
@@ -983,7 +970,6 @@ |
| 983 | 970 |
|
| 984 | 971 |
///\name Two dimensional distributions |
| 985 | 972 |
/// |
| 986 |
|
|
| 987 | 973 |
///@{
|
| 988 | 974 |
|
| 989 | 975 |
/// Uniform distribution on the full unit circle |
| ... | ... |
@@ -1000,7 +986,7 @@ |
| 1000 | 986 |
} while(V1*V1+V2*V2>=1); |
| 1001 | 987 |
return dim2::Point<double>(V1,V2); |
| 1002 | 988 |
} |
| 1003 |
/// A kind of two dimensional Gauss distribution |
|
| 989 |
/// A kind of two dimensional normal (Gauss) distribution |
|
| 1004 | 990 |
|
| 1005 | 991 |
/// This function provides a turning symmetric two-dimensional distribution. |
| 1006 | 992 |
/// Both coordinates are of standard normal distribution, but they are not |
0 comments (0 inline)