shark::NegExponential< RngType > Class Template Reference

Implements the Negative exponential distribution. More...

#include <shark/Rng/NegExponential.h>

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

Public Member Functions

 NegExponential (RngType &rng, double mean=0)
 
double operator() (double mean)
 Draws a random number from the negative exponential distribution with the mean defined in the argument. More...
 
double mean () const
 Returns the mean of the negative exponential distribution. More...
 
void mean (double newMean)
 Sets the mean of the negative exponential distribution. More...
 
double p (double x)
 

Detailed Description

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

Implements the Negative exponential distribution.

It's propability distribution is defined as

\[ p(x) = e^{-\lambda x}\]

Instead of lambda, we define the exponential distribution using the mean

\[ \mu = 1.0/\lambda \]

Definition at line 51 of file NegExponential.h.

Constructor & Destructor Documentation

◆ NegExponential()

template<typename RngType = shark::DefaultRngType>
shark::NegExponential< RngType >::NegExponential ( RngType &  rng,
double  mean = 0 
)
inline

Definition at line 57 of file NegExponential.h.

Member Function Documentation

◆ mean() [1/2]

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

Returns the mean of the negative exponential distribution.

Definition at line 73 of file NegExponential.h.

◆ mean() [2/2]

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

Sets the mean of the negative exponential distribution.

Parameters
newMeanthe new Mean value

Definition at line 80 of file NegExponential.h.

◆ operator()()

template<typename RngType = shark::DefaultRngType>
double shark::NegExponential< RngType >::operator() ( double  mean)
inline

Draws a random number from the negative exponential distribution with the mean defined in the argument.

Parameters
meanthe mean of the distribution from which the number is drawn

Definition at line 66 of file NegExponential.h.

◆ p()

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

Definition at line 85 of file NegExponential.h.

References lambda.


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