Public Member Functions | Protected Attributes | List of all members
o2scl::prob_dens_uniform Class Reference

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

#include <prob_dens_func.h>

Inheritance diagram for o2scl::prob_dens_uniform:
o2scl::prob_dens_frange o2scl::prob_dens_func

Public Member Functions

 prob_dens_uniform ()
 Create a blank uniform distribution.
 prob_dens_uniform (double a, double b)
 Create a uniform distribution from $ a<x<b $.
 prob_dens_uniform (const prob_dens_uniform &pdg)
 Copy constructor.
prob_dens_uniformoperator= (const prob_dens_uniform &pdg)
 Copy constructor with operator=.
void set_seed (unsigned long int s)
 Set the seed.
void set_limits (double a, double b)
 Set the limits of the uniform distribution.
virtual double lower_limit () const
 Lower limit of the range.
virtual double upper_limit () const
 Uower limit of the range.
virtual double operator() () const
 Operator from the specified density.
virtual double pdf (double x) const
 The normalized density.
virtual double log_pdf (double x) const
 The log of the normalized density.
virtual double cdf (double x) const
 The cumulative distribution function (from the lower tail)
virtual double invert_cdf (double in_cdf) const
 The inverse cumulative distribution function.
virtual double entropy () const
 The inverse cumulative distribution function.

Protected Attributes

double ll
 Lower limit.
double ul
 Upper limit.
rng_gsl r
 The GSL random number generator.

Detailed Description

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.

Definition at line 289 of file prob_dens_func.h.

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

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).