• Main Page
  • Classes
  • Files
  • Examples
  • File List

Erlang.h

Go to the documentation of this file.
00001 //===========================================================================
00042 //===========================================================================
00043 
00044 
00045 #ifndef __ERLANG_H
00046 #define __ERLANG_H
00047 
00048 #include "Rng/RandomVar.h"
00049 
00050 
00051 //===========================================================================
00091 class Erlang : public RandomVar< double >
00092 {
00093 public:
00094 
00098     Erlang(double mean = 0, double variance = 1);
00099 
00100 
00105     Erlang(double mean, double variance, RNG& r);
00106 
00107 
00108 //========================================================================
00125     double mean() const
00126     {
00127         return pMean;
00128     }
00129 
00130 
00131 //========================================================================
00148     double variance() const
00149     {
00150         return pVariance;
00151     }
00152 
00153 
00154 //========================================================================
00186     void   mean(double newMean)
00187     {
00188         pMean     = newMean; setState();
00189     }
00190 
00191 
00192 //========================================================================
00222     void   variance(double newVar)
00223     {
00224         pVariance = newVar;  setState();
00225     }
00226 
00227 
00230     double operator()(unsigned k, double a);
00231 
00235     double operator()();
00236 
00241     double p(const double&) const;
00242 
00243 protected:
00244 
00251     double pMean;
00252 
00260     double pVariance;
00261 
00262 private:
00263 
00264     // The distribution's parameter "k" (the order of the distribution)
00265     unsigned pK;
00266 
00267     // The distributions parameter "alpha" (the scale of the distribution)
00268     double   pA;
00269 
00270     // See "Erlang.cpp" for description.
00271     void setState();
00272 };
00273 
00274 #endif  /* !__ERLANG_H */
00275 
  • Shark Main Page
  • Array
  • Rng
  • LinAlg
  • FileUtil
  • EALib
  • MOO-EALib
  • ReClaM
  • Fuzzy
  • Mixture
  • Tutorials
  • FAQ