Changeset 706 for trunk/yat/random


Ignore:
Timestamp:
Dec 19, 2006, 9:59:19 AM (15 years ago)
Author:
Jari Häkkinen
Message:

Addresses #65 and #170.

Location:
trunk/yat/random
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/random/random.cc

    r680 r706  
    8585  }
    8686
     87  // --------------------- Discrete distribtuions ---------------------
     88
     89  Discrete::Discrete(void)
     90    : rng_(RNG::instance())
     91  {
     92  }
     93
     94 
     95  Discrete::~Discrete(void)
     96  {
     97  }
     98
    8799
    88100  DiscreteGeneral::DiscreteGeneral(const statistics::Histogram& hist)
     
    103115  }
    104116
     117
     118  Poisson::Poisson(const double m)
     119    : m_(m)
     120  {
     121  }
     122
     123  // --------------------- Continuous distribtuions ---------------------
     124
     125  Continuous::Continuous(void)
     126    : rng_(RNG::instance())
     127  {
     128  }
     129
     130
     131  Continuous::~Continuous(void)
     132  {
     133  }
     134
     135
     136  ContinuousGeneral::ContinuousGeneral(const statistics::Histogram& hist)
     137    : discrete_(DiscreteGeneral(hist)), hist_(hist)
     138  {
     139  }
     140
     141
     142  Exponential::Exponential(const double m)
     143    : m_(m)
     144  {
     145  }
     146
     147
     148  Gaussian::Gaussian(const double s, const double m)
     149    : m_(m), s_(s)
     150  {
     151  }
     152
    105153}}} // of namespace random, yat, and theplu
  • trunk/yat/random/random.h

    r680 r706  
    193193    /// @brief Constructor
    194194    ///
    195     inline Discrete(void) { rng_=RNG::instance(); }
    196 
    197     inline virtual ~Discrete(void) { }
     195    Discrete(void);
     196
     197    ///
     198    /// @brief The destructor
     199    ///
     200    virtual ~Discrete(void);
    198201
    199202    ///
     
    338341    ///
    339342    /// @param m is expectation value
    340     inline Poisson(const double m=1) : m_(m) {}
     343    ///
     344    Poisson(const double m=1);
    341345
    342346    ///
     
    373377    /// @brief Constructor
    374378    ///
    375     inline Continuous(void) { rng_=RNG::instance(); }
    376 
    377     inline virtual ~Continuous(void) { }
     379    Continuous(void);
     380
     381    ///
     382    /// @brief The destructor
     383    ///
     384    virtual ~Continuous(void);
    378385
    379386    ///
     
    434441    /// @param hist is a Histogram defining the probability distribution
    435442    ///
    436     inline ContinuousGeneral(const statistics::Histogram& hist)
    437       : discrete_(DiscreteGeneral(hist)), hist_(hist) {}
    438 
    439     ///
    440     /// @brief Destructor
    441     ///
    442     ~ContinuousGeneral(void);
     443    ContinuousGeneral(const statistics::Histogram& hist);
    443444
    444445    ///
     
    475476    /// @param m is the expectation value of the distribution.
    476477    ///
    477     inline Exponential(const double m=1) : m_(m) {}
     478    inline Exponential(const double m=1);
    478479
    479480    ///
     
    514515    ///
    515516    /// @brief Constructor
     517    ///
    516518    /// @param s is the standard deviation \f$ \sigma \f$ of distribution
    517519    /// @param m is the expectation value \f$ \mu \f$ of the distribution
    518520    ///
    519     inline Gaussian(const double s=1, const double m=0) : m_(m), s_(s) {}
     521    Gaussian(const double s=1, const double m=0);
    520522
    521523    ///
     
    528530    /// @return A random Gaussian number with standard deviation \a s
    529531    /// and expectation value 0.
     532    ///
    530533    /// @note this operator ignores parameters given in Constructor
    531534    ///
     
    536539    /// @return A random Gaussian number with standard deviation \a s
    537540    /// and expectation value \a m.
     541    ///
    538542    /// @note this operator ignores parameters given in Constructor
    539543    ///
Note: See TracChangeset for help on using the changeset viewer.