Changeset 340:0badf3bb38c2 in lemon-main
- Timestamp:
- 10/28/08 14:47:57 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/random.h
r339 r340 541 541 /// @{ 542 542 543 ///\name Initialization544 ///545 /// @{546 547 543 /// \brief Default constructor 548 544 /// … … 709 705 } 710 706 711 /// @}712 713 ///\name Uniform distributions714 ///715 /// @{716 717 707 /// \brief Returns a random real number from the range [0, 1) 718 708 /// … … 771 761 return _random_bits::IntConversion<Number, Word>::convert(core); 772 762 } 773 774 /// @}775 763 776 764 unsigned int uinteger() { … … 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. … … 817 804 } 818 805 819 /// Standard Gaussdistribution820 821 /// Standard Gaussdistribution.806 /// Standard normal (Gauss) distribution 807 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. … … 832 819 return std::sqrt(-2*std::log(S)/S)*V1; 833 820 } 834 /// Gaussdistribution with given mean and standard deviation835 836 /// Gaussdistribution with given mean and standard deviation.821 /// Normal (Gauss) distribution with given mean and standard deviation 822 823 /// Normal (Gauss) distribution with given mean and standard deviation. 837 824 /// \sa gauss() 838 825 double gauss(double mean,double std_dev) … … 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; … … 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 /// … … 880 867 return lognormal(lognormalParamsFromMD(mean,std_dev)); 881 868 } 882 869 883 870 /// Exponential distribution with given mean 884 871 … … 984 971 ///\name Two dimensional distributions 985 972 /// 986 987 973 ///@{ 988 974 … … 1001 987 return dim2::Point<double>(V1,V2); 1002 988 } 1003 /// A kind of two dimensional Gaussdistribution989 /// A kind of two dimensional normal (Gauss) distribution 1004 990 1005 991 /// This function provides a turning symmetric two-dimensional distribution.
Note: See TracChangeset
for help on using the changeset viewer.