44 fPmf( (func) ? new
ROOT::
Math::WrappedTF1 ( *func) : nullptr ),
71 if (
this == &rhs)
return *
this;
125 if (
x <
static_cast<int>(
fPVec.size()) ||
x >=
static_cast<int>(
fPVec.size()) )
return 0;
151 for (
int i = i0; i < iN; ++i) {
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
virtual IBaseFunctionOneDim * Clone() const =0
Clone a function.
Class to Wrap a ROOT Function class (like TF1) in a IParamFunction interface of one dimensions to be ...
TUnuranBaseDist, base class for Unuran distribution classes such as TUnuranContDist (for one-dimensio...
TUnuranDiscrDist class for one dimensional discrete distribution.
int fMode
mode of the distribution
double Cdf(int x) const
evaluate the integral (cdf) on the given domain
std::vector< double > fPVecSum
Vector of the sum of the probabilities.
~TUnuranDiscrDist() override
Destructor.
void SetCdf(const ROOT::Math::IGenFunction &cdf)
set cdf distribution from a generic function interface.
const ROOT::Math::IGenFunction * fCdf
pointer to the cumulative distribution function
bool fHasSum
flag to control if distribution has a pre-computed sum of the probabilities
double fSum
total sum of the probabilities in the given domain
bool fHasMode
flag to control if distribution has a pre-computed mode
double Pmf(int x) const
evaluate the distribution (probability mesh function) at the integer value x.
std::vector< double > fPVec
Vector of the probabilities.
const ROOT::Math::IGenFunction * fPmf
pointer to a function calculating the probability
bool fOwnFunc
flag to control if distribution owns the function pointers
TUnuranDiscrDist(const ROOT::Math::IGenFunction &func, bool copyFunc=false)
Constructor from a generic function object specifying the pdf.
int fXmax
upper value of the domain
int fXmin
lower value of the domain
TUnuranDiscrDist & operator=(const TUnuranDiscrDist &rhs)
Assignment operator.
bool fHasDomain
flag to control if distribution has a defined domain (otherwise is [0,INT_MAX])
Namespace for new Math classes and functions.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
static uint64_t sum(uint64_t i)