Implements a generator for the truncated exponential function. More...
#include <shark/Rng/TruncatedExponential.h>
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) |
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.
|
inline |
Definition at line 122 of file TruncatedExponential.h.
|
inline |
special version, when the integral of the truncated exponential is allready known
Definition at line 127 of file TruncatedExponential.h.
|
inline |
Definition at line 138 of file TruncatedExponential.h.
|
inline |
Definition at line 141 of file TruncatedExponential.h.
|
inline |
Definition at line 133 of file TruncatedExponential.h.
References shark::TruncatedExponential_distribution< RealType >::max().
|
inline |
Definition at line 151 of file TruncatedExponential.h.
References shark::TruncatedExponential_distribution< RealType >::lambda(), and shark::TruncatedExponential_distribution< RealType >::max().
|
inline |
Definition at line 144 of file TruncatedExponential.h.
References shark::TruncatedExponential_distribution< RealType >::max().
|
inline |
Definition at line 147 of file TruncatedExponential.h.
References shark::TruncatedExponential_distribution< RealType >::lambda().