COIN-OR::LEMON - Graph Library

Ticket #164: 0badf3bb38c2.patch

File 0badf3bb38c2.patch, 3.4 KB (added by Peter Kovacs, 12 years ago)
  • lemon/random.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1225201677 -3600
    # Node ID 0badf3bb38c2a0ef9cb4c0dc1c2bd994979d043a
    # Parent  2593e163e407403990ba8f4323f684190a625a62
    Minor doc improvements
    
    diff --git a/lemon/random.h b/lemon/random.h
    a b  
    540540    ///
    541541    /// @{
    542542
    543     ///\name Initialization
    544     ///
    545     /// @{
    546 
    547543    /// \brief Default constructor
    548544    ///
    549545    /// Constructor with constant seeding.
     
    708704      return real<Number>() * (b - a) + a;
    709705    }
    710706
    711     /// @}
    712 
    713     ///\name Uniform distributions
    714     ///
    715     /// @{
    716 
    717707    /// \brief Returns a random real number from the range [0, 1)
    718708    ///
    719709    /// It returns a random double from the range [0, 1).
     
    771761      return _random_bits::IntConversion<Number, Word>::convert(core);
    772762    }
    773763
    774     /// @}
    775 
    776764    unsigned int uinteger() {
    777765      return uinteger<unsigned int>();
    778766    }
     
    806794
    807795    ///\name Non-uniform distributions
    808796    ///
    809 
    810797    ///@{
    811798
    812     /// \brief Returns a random bool
     799    /// \brief Returns a random bool with given probability of true result.
    813800    ///
    814801    /// It returns a random bool with given probability of true result.
    815802    bool boolean(double p) {
    816803      return operator()() < p;
    817804    }
    818805
    819     /// Standard Gauss distribution
     806    /// Standard normal (Gauss) distribution
    820807
    821     /// Standard Gauss distribution.
     808    /// Standard normal (Gauss) distribution.
    822809    /// \note The Cartesian form of the Box-Muller
    823810    /// transformation is used to generate a random normal distribution.
    824811    double gauss()
     
    831818      } while(S>=1);
    832819      return std::sqrt(-2*std::log(S)/S)*V1;
    833820    }
    834     /// Gauss distribution with given mean and standard deviation
     821    /// Normal (Gauss) distribution with given mean and standard deviation
    835822
    836     /// Gauss distribution with given mean and standard deviation.
     823    /// Normal (Gauss) distribution with given mean and standard deviation.
    837824    /// \sa gauss()
    838825    double gauss(double mean,double std_dev)
    839826    {
     
    864851    /// standard deviation. The return value can direcly be passed to
    865852    /// lognormal().
    866853    std::pair<double,double> lognormalParamsFromMD(double mean,
    867                                                    double std_dev)
     854                                                   double std_dev)
    868855    {
    869856      double fr=std_dev/mean;
    870857      fr*=fr;
     
    872859      return std::pair<double,double>(std::log(mean)-lg/2.0,std::sqrt(lg));
    873860    }
    874861    /// Lognormal distribution with given mean and standard deviation
    875    
     862
    876863    /// Lognormal distribution with given mean and standard deviation.
    877864    ///
    878865    double lognormalMD(double mean,double std_dev)
    879866    {
    880867      return lognormal(lognormalParamsFromMD(mean,std_dev));
    881868    }
    882    
     869
    883870    /// Exponential distribution with given mean
    884871
    885872    /// This function generates an exponential distribution random number
     
    983970
    984971    ///\name Two dimensional distributions
    985972    ///
    986 
    987973    ///@{
    988974
    989975    /// Uniform distribution on the full unit circle
     
    1000986      } while(V1*V1+V2*V2>=1);
    1001987      return dim2::Point<double>(V1,V2);
    1002988    }
    1003     /// A kind of two dimensional Gauss distribution
     989    /// A kind of two dimensional normal (Gauss) distribution
    1004990
    1005991    /// This function provides a turning symmetric two-dimensional distribution.
    1006992    /// Both coordinates are of standard normal distribution, but they are not