54 if (
this == &rhs)
return *
this;
77 assert(
fPdf !=
nullptr);
85 unsigned int ndim =
NDim();
86 for (
unsigned int i = 0; i < ndim; ++i)
98 assert(
fPdf !=
nullptr);
102 std::vector<double> xx(
NDim() );
104 xx[coord] =
x[coord]+
h;
double f1 = (*fPdf)(&xx.front());
105 xx[coord] =
x[coord]-
h;
double f2 = (*fPdf)(&xx.front());
107 xx[coord] =
x[coord]+
h/2;
double g1 = (*fPdf)(&xx.front());
108 xx[coord] =
x[coord]-
h/2;
double g2 = (*fPdf)(&xx.front());
111 double h2 = 1/(2.*
h);
113 double d2 = 2*(g1 - g2);
115 double deriv = h2*(4*d2 - d0)/3.;
Documentation for the abstract class IBaseFunctionMultiDim.
virtual IBaseFunctionMultiDimTempl< T > * Clone() const =0
Clone a function.
TUnuranBaseDist, base class for Unuran distribution classes such as TUnuranContDist (for one-dimensio...
TUnuranMultiContDist class describing multi dimensional continuous distributions.
TUnuranMultiContDist(TF1 *func=nullptr, unsigned int dim=0, bool isLogPdf=false)
Constructor from a TF1 object representing the Probability density function.
bool fIsLogPdf
flag to control if function pointer represent log of pdf
double Pdf(const double *x) const
evaluate the probability density function, used by UnuRan
double Derivative(const double *x, int icoord) const
evaluate the partial derivative for the given coordinate.
std::vector< double > fXmax
vector with upper x values of the domain
void Gradient(const double *x, double *grad) const
evaluate the gradient vector of the Pdf.
std::vector< double > fXmin
vector with lower x values of the domain
std::vector< double > fMode
vector representing the x coordinates of the maximum of the pdf
TUnuranMultiContDist & operator=(const TUnuranMultiContDist &rhs)
Assignment operator.
bool fOwnFunc
flag to indicate if class manages the function pointers
const ROOT::Math::IMultiGenFunction * fPdf
unsigned int NDim() const
get number of dimension of the distribution
~TUnuranMultiContDist() override
Destructor.
WrappedMultiTF1Templ< double > WrappedMultiTF1