#include <TUnuranMultiContDist.h>
Inheritance diagram for TUnuranMultiContDist:
Public Member Functions | |
TUnuranMultiContDist (TF1 *func=0, unsigned int dim=0, bool isLogPdf=false) | |
TUnuranMultiContDist (const ROOT::Math::IMultiGenFunction &pdf, bool isLogPdf=false) | |
virtual | ~TUnuranMultiContDist () |
TUnuranMultiContDist (const TUnuranMultiContDist &) | |
TUnuranMultiContDist & | operator= (const TUnuranMultiContDist &rhs) |
virtual TUnuranMultiContDist * | Clone () const |
unsigned int | NDim () const |
void | SetDomain (const double *xmin, const double *xmax) |
void | SetMode (const double *x) |
const double * | GetLowerDomain () const |
const double * | GetUpperDomain () const |
const double * | GetMode () const |
bool | IsLogPdf () const |
double | Pdf (const double *x) const |
void | Gradient (const double *x, double *grad) const |
double | Derivative (const double *x, int icoord) const |
Private Attributes | |
const ROOT::Math::IMultiGenFunction * | fPdf |
std::vector< double > | fXmin |
std::vector< double > | fXmax |
std::vector< double > | fMode |
bool | fIsLogPdf |
bool | fOwnFunc |
The derivatives of the pdf which are used by some UNURAN methods are estimated numerically in the Derivative() method. Some extra information (like distribution mode) can be set using SetMode. Some methods require instead of the pdf the log of the pdf. This can also be controlled by setting a flag when constructing this class.
Definition at line 49 of file TUnuranMultiContDist.h.
TUnuranMultiContDist::TUnuranMultiContDist | ( | TF1 * | func = 0 , |
|
unsigned int | dim = 0 , |
|||
bool | isLogPdf = false | |||
) |
Constructor from a TF1 object representing the Probability density function. The derivatives of the Pdf are estimated, when required by the UNURAN algorithm, using numerical derivation. If a value of dim 0 is passed , the dimension of the function is taken from TF1::GetNdim(). This works only for 2D and 3D (for TF2 and TF3 objects).
Definition at line 29 of file TUnuranMultiContDist.cxx.
Referenced by Clone().
TUnuranMultiContDist::TUnuranMultiContDist | ( | const ROOT::Math::IMultiGenFunction & | pdf, | |
bool | isLogPdf = false | |||
) |
Constructor as before but from a generic function object interface for multi-dim functions
Definition at line 20 of file TUnuranMultiContDist.cxx.
TUnuranMultiContDist::~TUnuranMultiContDist | ( | ) | [virtual] |
TUnuranMultiContDist::TUnuranMultiContDist | ( | const TUnuranMultiContDist & | ) |
TUnuranMultiContDist & TUnuranMultiContDist::operator= | ( | const TUnuranMultiContDist & | rhs | ) |
Assignment operator
Definition at line 47 of file TUnuranMultiContDist.cxx.
References ROOT::Math::IBaseFunctionMultiDim::Clone(), fIsLogPdf, fMode, fOwnFunc, fPdf, fXmax, and fXmin.
Referenced by TUnuranMultiContDist().
virtual TUnuranMultiContDist* TUnuranMultiContDist::Clone | ( | ) | const [inline, virtual] |
Clone (required by base class)
Implements TUnuranBaseDist.
Definition at line 88 of file TUnuranMultiContDist.h.
References TUnuranMultiContDist().
unsigned int TUnuranMultiContDist::NDim | ( | ) | const [inline] |
get number of dimension of the distribution
Definition at line 94 of file TUnuranMultiContDist.h.
References fPdf, and ROOT::Math::IBaseFunctionMultiDim::NDim().
Referenced by Derivative(), Gradient(), SetDomain(), and SetMode().
set the domain of the distribution giving an array of minimum and maximum values By default otherwise the domain is undefined, i.e. is [-inf,+inf] To remove the domain do a SetDomain(0,0). There is no possibility to have a domain defined in only one coordinate. Use instead inf or DOUBLE_MAX to specify un infinite domain in that coordinate
Definition at line 105 of file TUnuranMultiContDist.h.
References fXmax, fXmin, and NDim().
Referenced by unuranMulti2D(), and unuranMultiDim().
void TUnuranMultiContDist::SetMode | ( | const double * | x | ) | [inline] |
set the mode of the distribution (coordinates of the distribution maximum values)
Definition at line 114 of file TUnuranMultiContDist.h.
Referenced by unuranMulti2D(), and unuranMultiDim().
const double* TUnuranMultiContDist::GetLowerDomain | ( | ) | const [inline] |
get the distribution lower domain values. Return a null pointer if domain is not defined
Definition at line 121 of file TUnuranMultiContDist.h.
const double* TUnuranMultiContDist::GetUpperDomain | ( | ) | const [inline] |
get the distribution upper domain values. Return a null pointer if domain is not defined
Definition at line 128 of file TUnuranMultiContDist.h.
const double* TUnuranMultiContDist::GetMode | ( | ) | const [inline] |
get the mode (vector of coordinate positions of the maxima of the distribution) If a mode has not defined return a NULL pointer
Definition at line 138 of file TUnuranMultiContDist.h.
References fMode.
bool TUnuranMultiContDist::IsLogPdf | ( | ) | const [inline] |
flag to control if given function represent the log of a pdf
Definition at line 147 of file TUnuranMultiContDist.h.
References fIsLogPdf.
evaluate the probability density function, used by UnuRan
Definition at line 71 of file TUnuranMultiContDist.cxx.
References fPdf.
evaluate the gradient vector of the Pdf. Used by UnuRan
Definition at line 78 of file TUnuranMultiContDist.cxx.
References Derivative(), i, and NDim().
evaluate the partial derivative for the given coordinate. Used by UnuRan
Definition at line 88 of file TUnuranMultiContDist.cxx.
References f2, fPdf, g2(), h, h2, and NDim().
Referenced by Gradient().
const ROOT::Math::IMultiGenFunction* TUnuranMultiContDist::fPdf [private] |
Definition at line 168 of file TUnuranMultiContDist.h.
Referenced by Derivative(), NDim(), operator=(), Pdf(), and ~TUnuranMultiContDist().
std::vector<double> TUnuranMultiContDist::fXmin [private] |
Definition at line 170 of file TUnuranMultiContDist.h.
Referenced by GetLowerDomain(), GetUpperDomain(), operator=(), and SetDomain().
std::vector<double> TUnuranMultiContDist::fXmax [private] |
Definition at line 171 of file TUnuranMultiContDist.h.
Referenced by GetLowerDomain(), GetUpperDomain(), operator=(), and SetDomain().
std::vector<double> TUnuranMultiContDist::fMode [private] |
Definition at line 172 of file TUnuranMultiContDist.h.
Referenced by GetMode(), operator=(), and SetMode().
bool TUnuranMultiContDist::fIsLogPdf [private] |
bool TUnuranMultiContDist::fOwnFunc [private] |
Definition at line 175 of file TUnuranMultiContDist.h.
Referenced by operator=(), and ~TUnuranMultiContDist().