Implements a continuous uniform distribution. More...
#include <shark/Rng/Uniform.h>
Public Member Functions | |
Uniform (RngType &rng, double low_=0., double high_=1.) | |
Default c'tor. Initializes the sampling interval and associates this distribution with the supplied RNG. More... | |
double | operator() (double low_, double high_) |
Resets the distribution to the supplied interval and samples a random number. More... | |
double | low () const |
Accesses the lower bound of the interval. More... | |
double | high () const |
Accesses the upper bound of the interval. More... | |
void | setRange (double low_, double high_) |
Adjusts the interval of the distribution. More... | |
double | p (double x) const |
Calculates the probability of x. More... | |
Public Member Functions inherited from shark::AbstractDistribution | |
virtual | ~AbstractDistribution () |
Dtor. More... | |
virtual double | logP (double x) const |
Implements a continuous uniform distribution.
|
inline |
Default c'tor. Initializes the sampling interval and associates this distribution with the supplied RNG.
[in,out] | rng | The RNG to associate this distribution with. |
[in] | low_ | The lower bound of the sampling interval. |
[in] | high_ | The upper bound of the sampling interval. |
|
inline |
Accesses the upper bound of the interval.
Definition at line 96 of file Uniform.h.
Referenced by shark::Uniform< RngType >::p().
|
inline |
Accesses the lower bound of the interval.
Definition at line 88 of file Uniform.h.
Referenced by shark::Uniform< RngType >::p().
|
inline |
Resets the distribution to the supplied interval and samples a random number.
[in] | low_ | The lower bound of the interval. |
[in] | high_ | The upper bound of the interval. |
Definition at line 78 of file Uniform.h.
References remora::max(), and remora::min().
|
inlinevirtual |
Calculates the probability of x.
[in] | x | The observation. |
Implements shark::AbstractDistribution.
Definition at line 116 of file Uniform.h.
References shark::Uniform< RngType >::high(), and shark::Uniform< RngType >::low().
|
inline |
Adjusts the interval of the distribution.
[in] | low_ | The lower bound of the interval. |
[in] | high_ | The upper bound of the interval. |
Definition at line 106 of file Uniform.h.
References remora::max(), and remora::min().