All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes
o2scl::prob_dens_uniform Class Reference

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

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 254 of file prob_dens_func.h.

#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 sample () const
 Sample from the specified density.
 
virtual double operator() (double x) const
 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.
 
gsl_rng * r
 The GSL random number generator.
 

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).
Hosted at Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads..