14 #ifndef ROOT_Math_TUnuranDiscrDist
15 #define ROOT_Math_TUnuranDiscrDist
17 #ifndef ROOT_Math_TUnuranBaseDist
21 #ifndef ROOT_Math_IFunctionfwd
72 template<
class Iterator>
193 double Pmf (
int x)
const;
198 double Cdf(
int x)
const;
TUnuranBaseDist, base class for Unuran distribution classees such as TUnuranContDist (for one-dimensi...
bool HasCdf() const
flag to control if distribution provides also a Cdf
int Mode() const
get the mode (x location of function maximum)
void SetProbSum(double sum)
set the value of the sum of the probabilities in the given domain
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
const ROOT::Math::IGenFunction * fCdf
const ROOT::Math::IGenFunction * fPmf
void SetMode(int mode)
set the mode of the distribution (location of maximum probability)
ClassImp(TIterator) Bool_t TIterator return false
Compare two iterator objects.
double Pmf(int x) const
evaluate the distribution (probability mesh function) at the integer value x.
TUnuranDiscrDist(Iterator *begin, Iterator *end)
Constructor from a vector of probability.
#define ClassDef(name, id)
double cdf(double *x, double *p)
TUnuranDiscrDist(const ROOT::Math::IGenFunction &func, bool copyFunc=false)
Constructor from a generic function object specifying the pdf.
bool GetDomain(int &xmin, int &xmax) const
check if distribution has domain and return in case its domain
void SetDomain(int xmin, int xmax)
Set the distribution domain, by default the domain is [0,INT_MAX] If xmin >= xmax a domain is removed...
TUnuranDiscrDist class for one dimensional discrete distribution.
void SetCdf(const ROOT::Math::IGenFunction &cdf)
set cdf distribution from a generic function interface.
const std::vector< double > & ProbVec() const
retrieve a reference to the vector of the probabilities : Prob(i) If the distribution is defined from...
bool HasMode() const
flag to control if distribution provides the mode
TUnuranDiscrDist & operator=(const TUnuranDiscrDist &rhs)
Assignment operator.
double ProbSum() const
return area of the pdf
bool HasProbSum() const
flag to control if distribution provides the total area of the probability function ...
double func(double *x, double *p)
double Cdf(int x) const
evaluate the integral (cdf) on the given domain
virtual TUnuranDiscrDist * Clone() const
Clone (required by base class)
virtual ~TUnuranDiscrDist()
Destructor.
std::vector< double > fPVecSum
std::vector< double > fPVec