shark::Erlang< RngType > Class Template Reference

Erlang distributed random variable. More...

#include <shark/Rng/Erlang.h>

+ Inheritance diagram for shark::Erlang< RngType >:

Public Member Functions

 Erlang (RngType &rng, double mean=0, double variance=1)
 Default c'tor, associates the distribution with the supplied RNG. More...
 
double operator() (double mean, double variance)
 Reinitializes the distribution for the supplied parameters and samples a new random number. Default values are omitted to distinguish the operator from the default one. More...
 
double mean () const
 Accesses the mean of the distribution. More...
 
double variance () const
 Accesses the variance of the distribution. More...
 
void mean (double newMean)
 Adjusts the mean of the distribution. More...
 
void variance (double newVariance)
 Adjusts the variance of the distribution. More...
 
double p (double &x) const
 Calculates the probability of x. More...
 

Detailed Description

template<typename RngType = shark::DefaultRngType>
class shark::Erlang< RngType >

Erlang distributed random variable.

Definition at line 135 of file Erlang.h.

Constructor & Destructor Documentation

§ Erlang()

template<typename RngType = shark::DefaultRngType>
shark::Erlang< RngType >::Erlang ( RngType &  rng,
double  mean = 0,
double  variance = 1 
)
inlineexplicit

Default c'tor, associates the distribution with the supplied RNG.

Parameters
[in,out]rngThe RNG to associate the distribution with.
[in]meanThe parameter mean, default value 0.
[in]varianceThe parameter variance, default value 1.

Definition at line 148 of file Erlang.h.

Member Function Documentation

§ mean() [1/2]

template<typename RngType = shark::DefaultRngType>
double shark::Erlang< RngType >::mean ( ) const
inline

Accesses the mean of the distribution.

Definition at line 173 of file Erlang.h.

§ mean() [2/2]

template<typename RngType = shark::DefaultRngType>
void shark::Erlang< RngType >::mean ( double  newMean)
inline

Adjusts the mean of the distribution.

Definition at line 189 of file Erlang.h.

§ operator()()

template<typename RngType = shark::DefaultRngType>
double shark::Erlang< RngType >::operator() ( double  mean,
double  variance 
)
inline

Reinitializes the distribution for the supplied parameters and samples a new random number. Default values are omitted to distinguish the operator from the default one.

Parameters
[in]meanThe new mean.
[in]varianceThe new variance.

Definition at line 164 of file Erlang.h.

§ p()

template<typename RngType = shark::DefaultRngType>
double shark::Erlang< RngType >::p ( double &  x) const
inline

Calculates the probability of x.

Definition at line 205 of file Erlang.h.

References shark::Erlang_distribution< RealType >::mean(), and shark::Erlang_distribution< RealType >::variance().

§ variance() [1/2]

template<typename RngType = shark::DefaultRngType>
double shark::Erlang< RngType >::variance ( ) const
inline

Accesses the variance of the distribution.

Definition at line 181 of file Erlang.h.

§ variance() [2/2]

template<typename RngType = shark::DefaultRngType>
void shark::Erlang< RngType >::variance ( double  newVariance)
inline

Adjusts the variance of the distribution.

Definition at line 197 of file Erlang.h.

References shark::Erlang_distribution< RealType >::mean().


The documentation for this class was generated from the following file: