shark::LogNormal< RngType > Class Template Reference

Implements a log-normal distribution with parameters location m and Scale s. More...

#include <shark/Rng/LogNormal.h>

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

Public Member Functions

 LogNormal (RngType &rng, double location=0, double scale=1)
 C'tor, associates the distribution with a custom RNG. More...
 
double operator() (double location, double scale)
 Samples a random number. More...
 
double location () const
 Accesses the location of the distribution. More...
 
double scale () const
 Accesses the scale of the distribution. More...
 
void location (double newLocation)
 Adjusts the location of the distribution. More...
 
void scale (double newScale)
 Adjusts the scale of the distribution. More...
 
double p (double x) const
 Calculates the probability of x > 0. More...
 

Detailed Description

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

Implements a log-normal distribution with parameters location m and Scale s.

The propability distribution is

\[ p(x)= \frac {1} {x s \sqrt{2 \pi}}e^{-\frac{(\ln x -m)^2}{2 s^2}}\]

Definition at line 53 of file LogNormal.h.

Constructor & Destructor Documentation

◆ LogNormal()

template<typename RngType = shark::DefaultRngType>
shark::LogNormal< RngType >::LogNormal ( RngType &  rng,
double  location = 0,
double  scale = 1 
)
inline

C'tor, associates the distribution with a custom RNG.

Parameters
[in,out]rngThe custom rng.
[in]locationThe location of the distribution, default value is 0.
[in]scaleThe scale of the distribution, default value is 1.

Definition at line 73 of file LogNormal.h.

Member Function Documentation

◆ location() [1/2]

template<typename RngType = shark::DefaultRngType>
double shark::LogNormal< RngType >::location ( ) const
inline

Accesses the location of the distribution.

Definition at line 96 of file LogNormal.h.

Referenced by shark::LogNormal< RngType >::location(), shark::LogNormal< RngType >::p(), and shark::LogNormal< RngType >::scale().

◆ location() [2/2]

template<typename RngType = shark::DefaultRngType>
void shark::LogNormal< RngType >::location ( double  newLocation)
inline

Adjusts the location of the distribution.

Definition at line 110 of file LogNormal.h.

References shark::LogNormal< RngType >::location(), and shark::LogNormal< RngType >::scale().

◆ operator()()

template<typename RngType = shark::DefaultRngType>
double shark::LogNormal< RngType >::operator() ( double  location,
double  scale 
)
inline

Samples a random number.

Parameters
[in]locationThe location of the distribution.
[in]scaleThe scale of the distribution.

Definition at line 89 of file LogNormal.h.

◆ p()

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

Calculates the probability of x > 0.

Definition at line 129 of file LogNormal.h.

References shark::LogNormal< RngType >::location(), and shark::LogNormal< RngType >::scale().

◆ scale() [1/2]

template<typename RngType = shark::DefaultRngType>
double shark::LogNormal< RngType >::scale ( ) const
inline

Accesses the scale of the distribution.

Definition at line 103 of file LogNormal.h.

Referenced by shark::LogNormal< RngType >::location(), shark::LogNormal< RngType >::p(), and shark::LogNormal< RngType >::scale().

◆ scale() [2/2]

template<typename RngType = shark::DefaultRngType>
void shark::LogNormal< RngType >::scale ( double  newScale)
inline

Adjusts the scale of the distribution.

Definition at line 120 of file LogNormal.h.

References shark::LogNormal< RngType >::location(), and shark::LogNormal< RngType >::scale().


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