44 fPmf( (func) ? new
ROOT::
Math::WrappedTF1 ( *func) : 0 ),
71 if (
this == &rhs)
return *
this;
125 if (
x <
static_cast<int>(
fPVec.size()) ||
x >=
static_cast<int>(
fPVec.size()) )
return 0;
128 return (*
fPmf)(double(
x));
137 return (*
fCdf)(double(
x));
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 classees such as TUnuranContDist (for one-dimensi...
TUnuranDiscrDist class for one dimensional discrete distribution.
double Cdf(int x) const
evaluate the integral (cdf) on the given domain
std::vector< double > fPVecSum
virtual ~TUnuranDiscrDist()
Destructor.
void SetCdf(const ROOT::Math::IGenFunction &cdf)
set cdf distribution from a generic function interface.
const ROOT::Math::IGenFunction * fCdf
double Pmf(int x) const
evaluate the distribution (probability mesh function) at the integer value x.
std::vector< double > fPVec
const ROOT::Math::IGenFunction * fPmf
TUnuranDiscrDist(const ROOT::Math::IGenFunction &func, bool copyFunc=false)
Constructor from a generic function object specifying the pdf.
TUnuranDiscrDist & operator=(const TUnuranDiscrDist &rhs)
Assignment operator.
Namespace for new Math classes and functions.
Namespace for new ROOT classes and functions.
static long int sum(long int i)