shark::TruncatedExponential< RngType > Class Template Reference

Implements a generator for the truncated exponential function. More...

#include <shark/Rng/TruncatedExponential.h>

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

Public Member Functions

 TruncatedExponential (RngType &rng, double lambda=1, double max=1.0)
 
 TruncatedExponential (double integral, RngType &rng, double lambda=1, double max=1.0)
 special version, when the integral of the truncated exponential is allready known More...
 
double operator() (double lambda, double max=1.0)
 
double lambda () const
 
double max () const
 
void setLambda (double newLambda)
 
void setMax (double newMax)
 
double p (double x)
 

Detailed Description

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

Implements a generator for the truncated exponential function.

Often, not the full range of an exponential distribution is needed. instead only an interval between [0,b] is required. In this case, the TruncatedExponential can be used. The propability function is \( p(x)=\frac{\lambda e^{-\lambda x}}{1-e^{-\lambda b}} \) as default, the maximum value for x is 1

Definition at line 117 of file TruncatedExponential.h.

Constructor & Destructor Documentation

◆ TruncatedExponential() [1/2]

template<typename RngType = DefaultRngType>
shark::TruncatedExponential< RngType >::TruncatedExponential ( RngType &  rng,
double  lambda = 1,
double  max = 1.0 
)
inline

Definition at line 122 of file TruncatedExponential.h.

◆ TruncatedExponential() [2/2]

template<typename RngType = DefaultRngType>
shark::TruncatedExponential< RngType >::TruncatedExponential ( double  integral,
RngType &  rng,
double  lambda = 1,
double  max = 1.0 
)
inline

special version, when the integral of the truncated exponential is allready known

Definition at line 127 of file TruncatedExponential.h.

Member Function Documentation

◆ lambda()

template<typename RngType = DefaultRngType>
double shark::TruncatedExponential< RngType >::lambda ( ) const
inline

Definition at line 138 of file TruncatedExponential.h.

◆ max()

template<typename RngType = DefaultRngType>
double shark::TruncatedExponential< RngType >::max ( ) const
inline

Definition at line 141 of file TruncatedExponential.h.

◆ operator()()

template<typename RngType = DefaultRngType>
double shark::TruncatedExponential< RngType >::operator() ( double  lambda,
double  max = 1.0 
)
inline

◆ p()

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

◆ setLambda()

template<typename RngType = DefaultRngType>
void shark::TruncatedExponential< RngType >::setLambda ( double  newLambda)
inline

◆ setMax()

template<typename RngType = DefaultRngType>
void shark::TruncatedExponential< RngType >::setMax ( double  newMax)
inline

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