Class prob_dens_uniform (o2scl)

O2scl : Class List

class prob_dens_uniform : public o2scl::prob_dens_frange

A uniform one-dimensional probability density over a finite range.

A flat distribution given by \( P(x)=1/(b-a) \) for \( a<x<b \), where \( a \) is the lower limit and \( b \) is the upper limit.

This class is experimental.

Public Functions

inline prob_dens_uniform()

Create a blank uniform distribution.

inline prob_dens_uniform(double a, double b)

Create a uniform distribution from \( a<x<b \).

inline virtual ~prob_dens_uniform()
inline prob_dens_uniform(const prob_dens_uniform &pdg)

Copy constructor.

inline prob_dens_uniform &operator=(const prob_dens_uniform &pdg)

Copy constructor with operator=.

inline void set_seed(unsigned long int s)

Set the seed.

inline void set_limits(double a, double b)

Set the limits of the uniform distribution.

inline virtual double lower_limit() const

Lower limit of the range.

inline virtual double upper_limit() const

Uower limit of the range.

inline virtual double operator()() const

Operator from the specified density.

inline virtual double pdf(double x) const

The normalized density.

inline virtual double log_pdf(double x) const

The log of the normalized density.

inline virtual double cdf(double x) const

The cumulative distribution function (from the lower tail)

inline virtual double invert_cdf(double in_cdf) const

The inverse cumulative distribution function.

inline virtual double entropy() const

Entropy of the distribution ( \( - \int f \ln f \) )

Protected Attributes

double ll

Lower limit.

double ul

Upper limit.

rng r

The GSL random number generator.