class TUnuranDiscrDist: public TUnuranBaseDist

Function Members (Methods)

public:
TUnuranDiscrDist(TF1* func = 0)
TUnuranDiscrDist(const TUnuranDiscrDist&)
TUnuranDiscrDist(double* begin, double* end)
virtual~TUnuranDiscrDist()
doubleCdf(int x) const
static TClass*Class()
virtual TUnuranDiscrDist*Clone() const
boolGetDomain(int& xmin, int& xmax) const
boolHasCdf() const
boolHasMode() const
boolHasProbSum() const
virtual TClass*IsA() const
intMode() const
TUnuranDiscrDist&operator=(const TUnuranDiscrDist& rhs)
doublePmf(int x) const
doubleProbSum() const
const vector<double>&ProbVec() const
voidSetCdf(TF1* cdf)
voidSetDomain(int xmin, int xmax)
voidSetMode(int mode)
voidSetProbSum(double sum)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)

Data Members

private:
TF1*fCdfpointer to the cumulative distribution function
boolfHasDomainflag to control if distribution has a defined domain (otherwise is [0,INT_MAX])
boolfHasModeflag to control if distribution has a pre-computed mode
boolfHasSumflag to control if distribution has a pre-computed sum of the probabilities
intfModemode of the distribution
vector<double>fPVecVector of the probabilities
TF1*fPmfpointer to a function calculating the probability
doublefSumtotal sum of the probabilities in the given domain
doublefX[1]! cached vector for using TF1::EvalPar
intfXmaxupper value of the domain
intfXminlower value of the domain

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TUnuranDiscrDist(TF1 * func)
Constructor from a TF1 objects
TUnuranDiscrDist(const TUnuranDiscrDist & rhs)
 Implementation of copy ctor using aassignment operator
double Pmf(int x) const
 evaluate the distribution
double Cdf(int x) const
 evaluate the cumulative distribution
 otherwise evaluate from the sum of the probabilities
TUnuranDiscrDist(TF1 * func = 0)
      Constructor from a TF1 objects specifying the pdf

~TUnuranDiscrDist()
      Destructor (no operations)

{}
TUnuranDiscrDist * Clone()
      Clone (required by base class)

{ return new TUnuranDiscrDist(*this); }
void SetCdf(TF1* cdf)
      set cdf distribution. If a method requires it
      and is not set it is estimated numerically

{ fCdf = cdf; }
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

void SetMode(int mode)
      set the mode of the distribution (location of maximum probability)

{ fMode = mode; fHasMode=true;}
void SetProbSum(double sum)
      set the value of the sum of the probabilities in the given domain

{ fSum = sum; fHasSum=true; }
bool GetDomain(int& xmin, int& xmax) const
      check if distribution has domain and return in case its domain

int Mode()
      get the mode   (x location of function maximum)

{ return fMode; }
double ProbSum()
      return area of the pdf

{ return fSum; }
bool HasMode()
      flag to control if distribution provides the mode

{ return fHasMode; }
bool HasProbSum()
      flag to control if distribution provides the total area of the probability function

{ return fHasSum; }
bool HasCdf()
      flag to control if distribution provides also a Cdf

{ return fCdf != 0; }
const std::vector<double> & ProbVec()
      retrieve a reference to the vector of the probabilities : Prob(i)
      If the distribution is defined from a function (i.e. for distribution with undefined domain)
      the vector is empty.

{ return fPVec; }

Last change: root/unuran:$Id: TUnuranDiscrDist.h 21526 2007-12-20 10:42:41Z moneta $
Last generated: 2008-10-31 16:21
Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.