#ifndef ROOT_Math_TUnuranDistrMulti
#define ROOT_Math_TUnuranDistrMulti
#include "TF1.h"
#include <cassert>
class TUnuranDistrMulti {
public:
TUnuranDistrMulti () :
fFunc(0),
fHasDomain(0)
{}
TUnuranDistrMulti (TF1 * func) :
fFunc(func),
fHasDomain(0)
{
assert(func != 0);
fDim = func->GetNdim();
}
~TUnuranDistrMulti ();
unsigned int NDim() const {
return fDim;
}
inline double operator() ( const double * x) const {
return fFunc->EvalPar(x);
}
void Gradient( const double * x, double * grad) const;
double Derivative( const double * x, int icoord) const;
bool GetDomain(const double * xmin, const double * xmax) const {
xmin = &fXmin.front();
xmax = &fXmax.front();
return fHasDomain;
}
void SetDomain(double *xmin, double *xmax) {
fXmin = std::vector<double>(xmin,xmin+fDim);
fXmax = std::vector<double>(xmax,xmax+fDim);
fHasDomain = true;
}
protected:
private:
mutable TF1 * fFunc;
unsigned int fDim;
std::vector<double> fXmin;
std::vector<double> fXmax;
bool fHasDomain;
};
#endif /* ROOT_Math_TUnuranDistrMulti */
ROOT page - Class index - Class Hierarchy - Top of the page
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.